core/lib/compass/configuration/inheritance.rb
File inheritance.rb
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
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.
Method inherited_array
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def inherited_array(*attributes)
options = attributes.last.is_a?(Hash) ? attributes.pop : {}
inherited_reader(*attributes)
inherited_writer(*attributes)
attributes.each do |attr|
Method debug
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def debug
normalized_attrs = {}
(ATTRIBUTES + ARRAY_ATTRIBUTES).each do |prop|
values = []
chain.each do |instance|
- Read upRead up
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
Open
def serialize_to_config(prop)
if v = @data.raw(prop)
"#{prop} = #{v.inspect}"
else
s = ""
- Read upRead up
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"