Showing 4 of 4 total issues
Method evaluate
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def evaluate(context, locals, &block)
# Use custom importer that knows about Sprockets Caching
cache_store =
if defined?(Sprockets::SassProcessor::CacheStore)
Sprockets::SassProcessor::CacheStore.new(sprockets_cache_store, context.environment)
Method evaluate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def evaluate(context, locals, &block)
# Use custom importer that knows about Sprockets Caching
cache_store =
if defined?(Sprockets::SassProcessor::CacheStore)
Sprockets::SassProcessor::CacheStore.new(sprockets_cache_store, context.environment)
- 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 sass_options
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sass_options
@sass_options[:custom] ||= {}
@sass_options[:custom] = {:resolver => ::Sass::Rails::Resolver.new(CompassRails.context)}
@sass_options[:load_paths] ||= []
unless @sass_options[:load_paths].any? {|k| k.is_a?(::Sass::Rails::Importer) }
- 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 cachebust_generated_images
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cachebust_generated_images(path)
generated_images_dir = Compass.configuration.generated_images_dir
generated_images_dir = Rails.root.join(generated_images_dir)
sprockets_env = options[:sprockets][:environment]
- 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"