sds/scss-lint

View on GitHub
lib/scss_lint/linter/space_after_comma.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method find_comma_position has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def find_comma_position(arg) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
      offset = 0
      pos = arg.source_range.end_pos

      if character_at(pos, offset) != ','
Severity: Minor
Found in lib/scss_lint/linter/space_after_comma.rb - About 2 hrs 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 check_commas_after_args has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def check_commas_after_args(args, arg_type)
      # For each arg except the last, check the character following the comma
      args[0..-2].each do |arg|
        # Sometimes the line we're looking at doesn't even contain a comma!
        next unless engine.lines[arg.line - 1].include?(',')
Severity: Minor
Found in lib/scss_lint/linter/space_after_comma.rb - About 1 hr 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