Skip to content
Permalink
Browse files

fix duplicate method in G::A::A::QueryComplexity

with rubocop settings for it
  • Loading branch information...
gfx committed Feb 21, 2019
1 parent d5da369 commit 63727048a324e16dfc929f719aa4fb115a730700
@@ -26,6 +26,9 @@ Layout/EndAlignment:
Lint/UselessAssignment:
Enabled: true

Lint/DuplicateMethods:
Enabled: true

Metrics/ParameterLists:
Max: 7
CountKeywordArgs: false
@@ -9,7 +9,7 @@ class MaxQueryComplexity < QueryComplexity
def result
return if query.max_complexity.nil?

total_complexity = super
total_complexity = max_possible_complexity

if total_complexity > query.max_complexity
GraphQL::AnalysisError.new("Query has complexity of #{total_complexity}, which exceeds max complexity of #{query.max_complexity}")
@@ -57,7 +57,8 @@ def on_leave_fragment_spread(node, _, visitor)
visitor.leave_fragment_spread_inline(node)
end

def result
# @return [Integer]
def max_possible_complexity
@complexities_on_type.last.max_possible_complexity
end

0 comments on commit 6372704

Please sign in to comment.
You can’t perform that action at this time.