sds/scss-lint

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

Summary

Maintainability
A
2 hrs
Test Coverage

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

    def node_defined_earlier_in_branch?(node_to_look_in, looking_for)
      # Look at all of the children of this node and return true if we find a
      # defining node that matches in name and type.
      node_to_look_in.children.each do |child_node|
        break unless before?(child_node, looking_for[:location])
Severity: Minor
Found in lib/scss_lint/linter/private_naming_convention.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 after_visit_all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def after_visit_all
      return unless @private_definitions

      @private_definitions.each_value do |nodes|
        nodes.each do |node_text, node_info|
Severity: Minor
Found in lib/scss_lint/linter/private_naming_convention.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