Showing 17 of 23 total issues
Method combine
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def combine(*args)
options = args[0].is_a?(Hash) ? args[0] : args
combine_opts = Hash.new { |h, k| h[k] = {} }
- 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 visit_relation
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def visit_relation(node, parent_relation = nil)
name, meta, header = node
other = visit(header, name)
if type
- 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
Class RelationProxy
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class RelationProxy
extend Initializer
extend Dry::Core::Deprecations[:rom]
include Relation::Materializable
Method changeset
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def changeset(*args)
opts = { command_compiler: command_compiler }
if args.size == 2
name, data = args
- 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 combine
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def combine(*args)
options = args[0].is_a?(Hash) ? args[0] : args
combine_opts = Hash.new { |h, k| h[k] = {} }
Method visit_relation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def visit_relation(node, parent_relation = nil)
name, meta, header = node
other = visit(header, name)
if type
Method node
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def node(name, &block)
if name.is_a?(Symbol) && !nodes.map { |n| n.name.relation }.include?(name)
raise ArgumentError, "#{name.inspect} is not a valid aggregate node name"
end
- 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 changeset
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def changeset(*args)
opts = { command_compiler: command_compiler }
if args.size == 2
name, data = args
Method visit_relation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def visit_relation(node)
relation_name, meta, header = node
name = meta[:combine_name] || relation_name
model = meta.fetch(:model) do
- 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 compose
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def compose(other, use_for_diff: other.is_a?(Pipe) ? other.use_for_diff : false)
new_proc = processor ? processor >> other : other
if use_for_diff
diff_proc = diff_processor ? diff_processor >> other : other
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, adapter, container, registry, plugins, options)
Method commands
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def commands(*names, mapper: nil, use: nil, **opts)
if names.any? || opts.any?
@commands = names + opts.to_a
@commands.each do |spec|
- 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 define_restricted_command_method
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def define_restricted_command_method(type, views, **opts)
views.each do |view_name|
meth_name = views.size > 1 ? :"#{type}_#{view_name}" : type
define_method(meth_name) do |*args|
- 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 setup_associates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def setup_associates(klass, relation, meta, parent_relation)
assoc_name =
if relation.associations.key?(parent_relation)
parent_relation
else
- 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 compile_command
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def compile_command(*args, mapper: nil, use: nil, **opts)
type, name = args + opts.to_a.flatten(1)
relation = name.is_a?(Symbol) ? relations[name] : name
- 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 method_missing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(meth, *args, &block)
if relation.respond_to?(meth)
result = relation.__send__(meth, *args, &block)
if result.kind_of?(Relation::Materializable) && !result.is_a?(Relation::Loaded)
- 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 extend
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extend(*steps, use_for_diff: false, **opts, &block)
options = { use_for_diff: use_for_diff, **opts }
if block
if steps.size > 0
- 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"