Showing 21 of 39 total issues
Method exec
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def exec(command, options={})
options = OpenStruct.new(config.send(:table).merge(options))
options.ui.logger.debug { "config=#{options.send(:table).inspect}" }
options.ui.logger.debug { "options=#{options.send(:table).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 exec
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def exec(command, options={})
options = OpenStruct.new(config.send(:table).merge(options))
options.ui.logger.debug { "config=#{config.send(:table).inspect}" }
options.ui.logger.debug { "options=#{options.send(:table).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 exec
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exec(command, options={})
options = OpenStruct.new(config.send(:table).merge(options))
options.ui.logger.debug { "config=#{options.send(:table).inspect}" }
options.ui.logger.debug { "options=#{options.send(:table).inspect}" }
Method exec
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exec(command, options={})
options = OpenStruct.new(config.send(:table).merge(options))
options.ui.logger.debug { "config=#{config.send(:table).inspect}" }
options.ui.logger.debug { "options=#{options.send(:table).inspect}" }
Method process
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process(&block)
!block_given? and log_and_raise(ParallelError, "You must supply a block to the process method!")
config.ui.logger.debug { "forks(#{@forks.inspect})" }
Method process
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def process(&block)
!block_given? and log_and_raise(ParallelError, "You must supply a block to the process method!")
config.ui.logger.debug { "forks(#{@forks.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 list
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def list(dataset, headers, &block)
!block_given? and log_and_raise(ReportError, "You must supply a block!")
headers.nil? and log_and_raise(ReportError, "Headers can not be nil!")
dataset.nil? and log_and_raise(ReportError, "Dataset can not be 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 ready?
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def ready?
config.host.nil? and log_and_raise(TCPSocketCheckError, "You must supply a host!")
config.port.nil? and log_and_raise(TCPSocketCheckError, "You must supply a port!")
socket = TCPSocket.new(config.host, config.port)
- 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 try
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def try(options={}, &block)
options = Base.build_config({
:tries => 1,
:on => Exception,
:delay => 1,
- 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 spreadsheet
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def spreadsheet(dataset, headers, &block)
!block_given? and log_and_raise(ReportError, "You must supply a block!")
headers.nil? and log_and_raise(ReportError, "Headers can not be nil!")
dataset.nil? and log_and_raise(ReportError, "Dataset can not be nil!")
Method belongs_to
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def belongs_to(key, options={})
belongs_to_relations[key] = {
:class_name => key.to_s.classify,
:key => key
}.merge(options)
Method list
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list(dataset, headers, &block)
!block_given? and log_and_raise(ReportError, "You must supply a block!")
headers.nil? and log_and_raise(ReportError, "Headers can not be nil!")
dataset.nil? and log_and_raise(ReportError, "Dataset can not be nil!")
Method attribute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def attribute(key, options={})
klass = self.to_s.split('::').last.downcase
option_key = "#{klass}_#{key}"
attribute_options[option_key] = options
- 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 spreadsheet
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def spreadsheet(dataset, headers, &block)
!block_given? and log_and_raise(ReportError, "You must supply a block!")
headers.nil? and log_and_raise(ReportError, "Headers can not be nil!")
dataset.nil? and log_and_raise(ReportError, "Dataset can not be 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 belongs_to
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def belongs_to(key, options={})
belongs_to_relations[key] = {
:class_name => key.to_s.classify,
:key => key
}.merge(options)
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(severity, message=nil, progname=nil, shift=0, &block)
Method bench
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def bench(options={}, &block)
options = Base.build_config({
:use_spinner => true
}, options)
- 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 method_missing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(method_name, *method_args)
raise "You must supply a block to the profiler method #{method_name.inspect}!" unless block_given?
@@start_time ||= Time.now.utc
- 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 wait
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wait(flags=0)
config.ui.logger.debug { "wait" }
config.ui.logger.debug { "forks(#{@forks.inspect})" }
return nil if @forks.count <= 0
- 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 tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def tag
tags = Array.new
user_host = "#{config.user}@#{config.host_name}"
port = (config.port ? ":#{config.port}" : 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"