Showing 7 of 7 total issues
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 included
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(base)
base.class_eval do
use_inline_resources
action :create do
template new_resource.path do
Method send_command!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def send_command!(*args)
unless running?
raise "Eye service #{pid ? "#{pid} " : ''}(#{@pid_file}) is not running!"
end
return unless yield if block_given?
- 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_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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(type, node, params)
@node = node
@owner = params[:owner]
@group = params[:group]
@type = type == 'local' ? 'local' : 'user'
- 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"