Showing 30 of 240 total issues
Class Project
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Project
DEFAULT_OPTIONS = {
auto_remove: true,
author: nil,
Method run
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def run(cmd, opts = {})
src_image = last ? last.result_image : @from
no_commit = opts.fetch(:no_commit, false)
no_cache = opts.fetch(:no_cache, false)
- 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 create_container
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def self.create_container(cfg, &blk)
meta_options = cfg[:MetaOptions] || {}
timeout = meta_options.fetch(:read_timeout, Excon.defaults[:read_timeout]) || 60
Drydock.logger.debug(message: "Create container configuration: #{cfg.inspect}")
- 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 ==
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def ==(other)
return false if other.nil?
return false if self['OpenStdin'] || other['OpenStdin']
return false if self['AttachStdout'] != other['AttachStdout']
- 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 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(cmd, opts = {})
src_image = last ? last.result_image : @from
no_commit = opts.fetch(:no_commit, false)
no_cache = opts.fetch(:no_cache, false)
Method to_h
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def to_h
to_container_config.tap do |cc|
env = Array(opts[:env])
cc[:Env].push(*env) unless env.empty?
- 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 create_container
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.create_container(cfg, &blk)
meta_options = cfg[:MetaOptions] || {}
timeout = meta_options.fetch(:read_timeout, Excon.defaults[:read_timeout]) || 60
Drydock.logger.debug(message: "Create container configuration: #{cfg.inspect}")
Method add
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def add(severity, message = nil, progname = nil, &block)
annotation = nil
indent = 0
if message.nil?
- 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 parse!
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse!(args)
opts = new
parser = OptionParser.new do |cfg|
cfg.banner = "Usage: #{$PROGRAM_NAME} [options...] [drydock-filename]"
Method find
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.find(path, ignorefile, prepend_path: false, recursive: true)
path = path.sub(%r{/$}, '')
[].tap do |results|
::Find.find(path) do |subpath|
- 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 add
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add(severity, message = nil, progname = nil, &block)
annotation = nil
indent = 0
if message.nil?
Method to_h
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def to_h
{}.tap do |commit|
if opts.key?(:command)
commit['run'] ||= {}
commit['run'][:Cmd] = opts[:command]
- 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 archive_head
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def archive_head(path = '/', &blk)
query = { 'path' => path }
response = connection.raw_request(:head, path_for(:archive), query, response_block: blk)
return if response.nil?
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(file_or_filename, dotfiles: false)
@dotfiles = dotfiles
if file_or_filename.respond_to?(:readlines)
patterns = Array(file_or_filename.readlines)
- 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 write_to_container
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def write_to_container(buffer, digest)
label = "# COPY #{recursive ? 'dir' : 'file'}:md5:#{digest} TO #{target_path}"
chain.run(label, no_cache: no_cache) do |container|
target_stat = container.archive_head(target_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 propagate_config!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.propagate_config!(src_image, config_name, opts, opt_key)
if opts.key?(opt_key)
Drydock.logger.info("Command override: #{opts[opt_key].inspect}")
else
src_image.refresh!
- 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
Avoid too many return
statements within this method. Open
return false if self['Entrypoint'] != other['Entrypoint']
Avoid too many return
statements within this method. Open
return false unless other_ports.key?(my_port)
Avoid too many return
statements within this method. Open
return false if Array(self['Env']).sort != Array(other['Env']).sort
Avoid too many return
statements within this method. Open
return false if self['Tty'] != other['Tty']