Showing 6 of 6 total issues
Method on_send
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def on_send(node)
_, method_name, *args = *node
hash_node = args.find { |subnode| subnode.type == :hash }
return unless FILTERS.include?(method_name) && hash_node
- 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 on_def
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def on_def(node)
args = node.type == :defs ? node.to_a[2] : node.to_a[1]
return if args.to_a.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 investigate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def investigate(processed_source)
return unless processed_source.ast
processed_source.comments.each do |comment_node|
next unless comment_node.loc.expression.source =~ /rubocop:disable/
- 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 on_def
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_def(node)
_name, _args, body = *node
return if body.nil?
return unless (possibe_var = return_var?(body) || return_var_call?(body))
return unless (assign_node = find_assign(body, possibe_var))
- 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 skip_node?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def skip_node?(current_node)
key, value = *current_node
return true unless current_node.type == :pair
return true unless %w[if unless].include?(key.source)
return true unless value.type == :str
- 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 on_send
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_send(node)
_, method_name, *args = *node
return unless VALIDATEBLE_METHODS.include?(method_name)
return if args.empty?
- 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"