Showing 8 of 8 total issues
Method get_image_path
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_image_path(name, path, is_relative, fallback_host)
#puts "@@@@@@@ calling get_image_path for name:#{name} path:#{path}, is_relative:#{is_relative}, fallback_host:#{fallback_host}"
begin
uri = URI(path)
rescue URI::InvalidURIError
- 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 manipulate_resource_list
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def manipulate_resource_list(resources)
puts "resources = #{resources.class}"
options = Extension.options_hash
sizes = options[:sizes]
namespace = options[:namespace_directory].join(',')
Method generate_svg
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def generate_svg(name, is_relative, options)
sizes, width, height = get_image_sizes(name, options)
fallback_host = false
if is_relative
- 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 initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(store, path, dimensions, origin, root_path, build_dir, source_dir)
Method automatic_clowncar_tag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def automatic_clowncar_tag(name, options={})
internal = ""
if options[:fallback]
fallback = File.basename thumbnail_url(name,:small)
- 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 manipulate_resource_list
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def manipulate_resource_list(resources)
puts "resources = #{resources.class}"
options = Extension.options_hash
sizes = options[:sizes]
namespace = options[:namespace_directory].join(',')
- 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 get_image_sizes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_image_sizes(name, options)
#puts "getting images sizes for #{name}"
main_abs_path = File.join(app.source_dir,name)
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render(*args, &block)
output_dir = File.join(@root_path,@build_dir)
dest_path = File.join(output_dir,@path)
img = nil
if Utils.timestamp_current?(@source_dir,@build_dir,@origin) && File.exist?(dest_path)
- 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"