Showing 12 of 21 total issues
Method generate
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate
Graphoid::Scalars::DateTime ||= GraphQL::ScalarType.define do
name 'DateTime'
description 'DateTime ISO8601 formated'
Method generate
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(model)
Graphoid::Types::Meta ||= GraphQL::ObjectType.define do
name('xMeta')
description('xMeta Type')
field('count', types.Int)
Method eager_load
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def eager_load(selection, model, first = true)
referenced_relations = [
mongo_constants[:many_to_many],
mongo_constants[:has_many],
mongo_constants[:has_one],
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method relate_many
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def relate_many(scope, relation, value, operator)
parsed = {}
field_name = relation.inverse_name || scope.name.underscore
target = Graphoid::Queries::Processor.execute(relation.klass, value).to_a
Method relate_many
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def relate_many(scope, relation, value, operator)
parsed = {}
field_name = relation.inverse_name || scope.name.underscore
target = Graphoid::Queries::Processor.execute(relation.klass, value).to_a
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method generate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate(model)
LIST[model] ||= GraphQL::InputObjectType.define do
name("#{Utils.graphqlize(model.name)}Filter")
description("Generated model filter for #{model.name}")
Method eager_load
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def eager_load(selection, model, first = true)
referenced_relations = [
mongo_constants[:many_to_many],
mongo_constants[:has_many],
mongo_constants[:has_one],
Method process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process(scope, value, key = nil)
if key && %w[OR AND].exclude?(key)
operation = Operation.new(scope, key, value)
filter = operation.resolve
return Graphoid.driver.execute_and(scope, filter)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method generate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def generate
Graphoid::Scalars::DateTime ||= GraphQL::ScalarType.define do
name 'DateTime'
description 'DateTime ISO8601 formated'
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method resolve_many
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def resolve_many(field, _model, association)
field.resolve lambda { |obj, args, _ctx|
filter = args['where'].to_h
order = args['order'].to_h
limit = args['limit']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method relate_many
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def relate_many(scope, relation, value, operator)
field_name = relation.inverse_name || scope.name.underscore
target = Graphoid::Queries::Processor.execute(relation.klass, value).to_a
if relation.embeds_many?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse(attribute, value, operator, prefix = nil)
field = attribute.name
field = "#{prefix}.#{field}" if prefix
parsed = {}
case operator
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"