Method generate_multiply_renderers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def generate_multiply_renderers(method, renderer_name)
return if method_with_block?(method)
return unless MULTIPLY.include?(method.name)
# multiply called
parameters = method.parameters
- 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_general_renderers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_general_renderers(method, renderer_name)
return if method_with_block?(method)
return if MULTIPLY.include?(method.name)
parameters = method.parameters
self.class.send(:define_method, renderer_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 delete_keys_recursive
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delete_keys_recursive(keys, leave = [])
each_with_object({}) do |(k, v), h|
next h if keys.include?(k)
v = v.delete_keys_recursive(keys, leave) if v.is_a?(::Hash) && !leave.include?(k)
h[k] = v
- 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_block_renderers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generate_block_renderers(method, renderer_name)
return unless method_with_block?(method)
parameters = method.parameters
if parameters.size > 1
self.class.send(:define_method, renderer_name) do |value|
- 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"