Showing 22 of 22 total issues
Method find_to_optimize_recursive
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def find_to_optimize_recursive(dir)
to_optimize = []
Find.find(dir) do |path|
if File.file?(path)
next if exclude_file?(dir, 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"
Further reading
Method find_to_optimize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def find_to_optimize(paths)
to_optimize = []
paths.each do |path|
if File.file?(path)
if @image_optim.optimizable?(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"
Further reading
Method optimize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def optimize(src, dst, options = {})
if jpegrescan
args = %W[
#{src}
#{dst}
- 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
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def optimize(src, dst, options = {})
args = %W[
-k#{copy_chunks ? 1 : 0}
-s#{strategy}
-q
- 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 symlink_custom_bin!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def symlink_custom_bin!(name)
env_name = "#{name}_bin".upcase
path = ENV.fetch(env_name, nil)
return unless 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"
Further reading
Method resolve!
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def resolve!(name)
name = name.to_sym
resolving(name) do
path = symlink_custom_bin!(name) || full_path(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 optimize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def optimize(src, dst, options = {})
args = %W[
--output=#{dst}
--no-comments
--no-names
- 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 read_options
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_options(path)
begin
full_path = File.expand_path(path)
rescue ArgumentError => e
warn "Can't expand path #{path}: #{e}"
- 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 run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(*args)
if args.last.is_a?(Hash) && (timeout = args.last.delete(:timeout))
args.last[Gem.win_platform? ? :new_pgroup : :pgroup] = true
pid = Process.spawn(*args)
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def optimize(src, dst, options = {})
src.copy(dst)
args = %W[
-o #{level}
-quiet
- 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_image
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def optimize_image(original)
original = Path.convert(original)
return unless (workers = workers_for_image(original))
optimized = @cache.fetch(original) do
- 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 check_fail!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_fail!
unless version
fail UnknownVersion, "could not get version of #{name} at #{path}"
end
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, default, type_or_description, description = nil, &proc)
Method option
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def option(name, default, type, description = nil, &proc)
Method value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def value(worker, options)
value = options.key?(name) ? options[name] : default
if proc
if proc.arity == 2
worker.instance_exec(value, self, &proc)
- 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 check!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check!
check_fail!
return unless WARN_CHECKS[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 optimize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def optimize(src, dst, options = {})
src.copy(dst)
args = %W[
-o #{level}
--quiet
- 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 wrapped_text
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def wrapped_text(text, wrapped_width, wrapped_indent, columns)
wrapped = []
text.split("\n").each do |line|
if line.length <= columns
wrapped << line << "\n"
- 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 full_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def full_path(name)
# PATHEXT is needed only for windows
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
env_path.split(File::PATH_SEPARATOR).each do |dir|
exts.each do |ext|
- 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 fetch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fetch(original)
return yield unless @cache_dir
digest = digest(original, original.image_format)
cached = @cache_dir / 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"