Showing 10 of 10 total issues
Method check_symbol_to_proc
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def check_symbol_to_proc
return unless method_call.block_argument_names.count == 1
return if method_call.block_body.nil?
return unless method_call.block_body.sexp_type == :call
return if method_call.arguments.count > 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"
Further reading
Method traverse_sexp_tree
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def traverse_sexp_tree(sexp_tree)
return unless sexp_tree.is_a?(Sexp)
token = sexp_tree.first
- 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 check_first_offense
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_first_offense
return method_call unless method_call.receiver.is_a?(MethodCall)
case method_call.receiver.name
when :shuffle
- 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 scan_block_call_offense
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def scan_block_call_offense
traverse_tree(method_definition.body) do |element|
next unless element.sexp_type == :call
method_call = MethodCall.new(element)
- 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
Avoid too many return
statements within this method. Open
return unless body_method_call.arguments.count.zero?
Avoid too many return
statements within this method. Open
return if body_method_call.has_block?
Avoid too many return
statements within this method. Open
return if body_method_call.receiver.name != method_call.block_argument_names.first
Avoid too many return
statements within this method. Open
return if method_call.lambda_literal?
Avoid too many return
statements within this method. Open
return if body_method_call.receiver.nil?
Avoid too many return
statements within this method. Open
return if body_method_call.receiver.is_a?(Fasterer::Primitive)