Method ignore_comp
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def ignore_comp(should_hsh, is_hsh)
match = true
should_hsh.each do |k, v|
if v.is_a?(Hash) && is_hsh[k].is_a?(Hash)
- 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 remove_comp
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def remove_comp(should_hsh, is_hsh)
should_keys = should_hsh.keys - resource[:ignored_properties] - resource[:protected_properties]
is_keys = is_hsh.keys - resource[:ignored_properties] - resource[:protected_properties]
- 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
Assignment Branch Condition size for remove_comp is too high. [37.36/37] Open
def remove_comp(should_hsh, is_hsh)
should_keys = should_hsh.keys - resource[:ignored_properties] - resource[:protected_properties]
is_keys = is_hsh.keys - resource[:ignored_properties] - resource[:protected_properties]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method insync?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def insync?(is_val)
return false unless should.respond_to?(:keys) && is_val.respond_to?(:keys)
case resource[:handle_missing]
when :ignore
- 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"