Compass/compass

View on GitHub
core/lib/compass/configuration/inheritance.rb

Summary

Maintainability
B
6 hrs
Test Coverage

File inheritance.rb has 263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Compass
  module Configuration
    # The inheritance module makes it easy for configuration data to inherit from
    # other instances of configuration data. This makes it easier for external code to layer
    # bits of configuration from various sources.
Severity: Minor
Found in core/lib/compass/configuration/inheritance.rb - About 2 hrs to fix

    Method inherited_array has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def inherited_array(*attributes)
              options = attributes.last.is_a?(Hash) ? attributes.pop : {}
              inherited_reader(*attributes)
              inherited_writer(*attributes)
              attributes.each do |attr|
    Severity: Minor
    Found in core/lib/compass/configuration/inheritance.rb - About 1 hr to fix

      Method debug has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

              def debug
                normalized_attrs = {}
                (ATTRIBUTES + ARRAY_ATTRIBUTES).each do |prop|
                  values = []
                  chain.each do |instance|
      Severity: Minor
      Found in core/lib/compass/configuration/inheritance.rb - About 55 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 serialize_to_config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

                def serialize_to_config(prop)
                  if v = @data.raw(prop)
                    "#{prop} = #{v.inspect}"
                  else
                    s = ""
      Severity: Minor
      Found in core/lib/compass/configuration/inheritance.rb - About 55 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