Showing 5 of 5 total issues
Method paths
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def paths
js_assets = @config.js_assets.kind_of?(Array) ? @config.js_assets : [@config.js_assets]
css_assets = @config.css_assets.kind_of?(Array) ? @config.css_assets : [@config.css_assets]
image_assets = @config.image_assets.kind_of?(Array) ? @config.image_assets : [@config.image_assets]
font_assets = @config.font_assets.kind_of?(Array) ? @config.font_assets : [@config.font_assets]
- 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 asset_digest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def asset_digest(source)
return '' unless defined? settings
return '' unless settings.respond_to?(:assets)
return '' unless settings.assets.respond_to?(:[])
settings.assets[source] && settings.assets[source].digest
- 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 serve_compressed?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def serve_compressed?
env = (defined?(PADRINO_ENV) && PADRINO_ENV) || \
(defined?(RACK_ENV) && RACK_ENV) || \
(defined?(RAKE_ENV) && RAKE_ENV)
enable_compression || env == "production"
- 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 setup_pipeline
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def setup_pipeline
js_prefix, css_prefix, image_prefix, font_prefix = @config.js_prefix, @config.css_prefix, @config.image_prefix, @config.font_prefix
js_assets, css_assets, image_assets, font_assets = @config.js_assets, @config.css_assets, @config.image_assets, @config.font_assets
packages = self.packages
compression_enabled = @config.serve_compressed?
- 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 require_pipeline
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def require_pipeline(config, &block)
yield config if block_given?
rescue NameError => e
raise if @_tried
@_tried = true
- 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"