rubocop-hq/rubocop

View on GitHub
lib/rubocop/cop/layout/multiline_method_call_indentation.rb

Summary

Maintainability
B
4 hrs
Test Coverage
A
100%

Class MultilineMethodCallIndentation has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

      class MultilineMethodCallIndentation < Base
        include ConfigurableEnforcedStyle
        include Alignment
        include MultilineExpressionIndentation
        extend AutoCorrector
Severity: Minor
Found in lib/rubocop/cop/layout/multiline_method_call_indentation.rb - About 2 hrs to fix

    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?
    Severity: Minor
    Found in lib/rubocop/cop/layout/multiline_method_call_indentation.rb - About 35 mins to fix

    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
    Severity: Minor
    Found in lib/rubocop/cop/layout/multiline_method_call_indentation.rb - About 35 mins to fix

    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)
    Severity: Minor
    Found in lib/rubocop/cop/layout/multiline_method_call_indentation.rb - About 25 mins to fix

    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

    There are no issues that match your filters.

    Category
    Status