Showing 6 of 6 total issues
Method optimize_retina!
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def optimize_retina!(name)
attachment = attachment_definitions[name]
## Check for style definitions
styles = attachment[:styles]
- 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 optimize_retina!
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def optimize_retina!(name, options={})
config = versions[name]
options[:retina] = false
processors = if config.respond_to?(:processors)
- 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 optimize_retina!
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def optimize_retina!(name, options={})
config = versions[name]
options[:retina] = false
processors = if config.respond_to?(:processors)
Method optimize_retina!
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def optimize_retina!(name)
attachment = attachment_definitions[name]
## Check for style definitions
styles = attachment[:styles]
Method retina_quality
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def retina_quality(percentage)
manipulate! do |img|
if defined?(Magick)
img.write(current_path) { self.quality = percentage } unless img.quality == percentage
elsif defined?(MiniMagick)
- 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 retina_image_tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def retina_image_tag(model, mounted_to, version, options={})
default = options.delete(:default)
# Check if we can find the dimensions of the uploaded image.
# If no image or dimensions available use default.
- 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"