Class MultilineMethodCallIndentation
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class MultilineMethodCallIndentation < Base
include ConfigurableEnforcedStyle
include Alignment
include MultilineExpressionIndentation
extend AutoCorrector
Method find_multiline_block_chain_node
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_multiline_block_chain_node(node)
return unless (block_node = node.each_descendant(:block, :numblock).first)
return unless block_node.multiline? && block_node.parent.call_type?
if node.receiver.call_type?
- 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 extra_indentation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def extra_indentation(given_style, parent)
if given_style == :indented_relative_to_receiver
if parent && (parent.splat_type? || parent.kwsplat_type?)
configured_indentation_width - parent.loc.operator.length
else
- 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 offending_range
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def offending_range(node, lhs, rhs, given_style)
return false unless begins_its_line?(rhs)
return false if not_for_this_cop?(node)
@base = alignment_base(node, rhs, given_style)
- 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"