Class: RuboCop::Cop::GraphQL::MaxComplexitySchema
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::GraphQL::MaxComplexitySchema
- Defined in:
- lib/rubocop/cop/graphql/max_complexity_schema.rb
Overview
Detects missing max_complexity configuration in schema files
Constant Summary collapse
- MSG =
"max_complexity should be configured for schema."
Instance Method Summary collapse
Instance Method Details
#max_complexity(node) ⇒ Object
17 18 19 |
# File 'lib/rubocop/cop/graphql/max_complexity_schema.rb', line 17 def_node_matcher :max_complexity, "`(send nil? :max_complexity ...)\n" |
#on_class(node) ⇒ Object
23 24 25 26 27 |
# File 'lib/rubocop/cop/graphql/max_complexity_schema.rb', line 23 def on_class(node) return if ::RuboCop::GraphQL::Class.new(node).nested? || max_complexity(node) add_offense(node) end |