sds/slim-lint

View on GitHub
lib/slim_lint/sexp.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method match? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def match?(sexp_pattern)
      # Delegate matching logic if we're comparing against a matcher
      if sexp_pattern.is_a?(SlimLint::Matcher::Base)
        return sexp_pattern.match?(self)
      end
Severity: Minor
Found in lib/slim_lint/sexp.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 display has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def display(depth = 1) # rubocop:disable Metrics/AbcSize
      indentation = ' ' * 2 * depth
      output = '['.dup

      each_with_index do |nested_sexp, index|
Severity: Minor
Found in lib/slim_lint/sexp.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

There are no issues that match your filters.

Category
Status