Compass/compass

View on GitHub
core/lib/compass/frameworks.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method pretty_print has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def pretty_print(skip_patterns = false)
      result = ""
      max = Compass::Frameworks::ALL.inject(0) do |gm, framework|
        fm = framework.template_directories.inject(0) do |lm,pattern|
          [lm, 7 + framework.name.size + pattern.size].max
Severity: Minor
Found in core/lib/compass/frameworks.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

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

      def initialize(name, *arguments)
        options = arguments.last.is_a?(Hash) ? arguments.pop : {}
        self.path = path = options[:path] || arguments.shift
        @name = name
        @templates_directory = options[:templates_directory]
Severity: Minor
Found in core/lib/compass/frameworks.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 discover has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def discover(frameworks_directory)
      if frameworks_directory == :defaults
        warn("The :defaults argument to Compass::Frameworks.discover is no longer necessary")
        return
      end
Severity: Minor
Found in core/lib/compass/frameworks.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