Showing 7 of 7 total issues
Method wait
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def wait
@accumulators = {}
waits = {}
@buffered_echo = []
- 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
Class CommandLine
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class CommandLine
include DefineOp
class << self
attr_accessor :output_stream
Method wait
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def wait
@accumulators = {}
waits = {}
@buffered_echo = []
Method consume_buffers
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def consume_buffers(readable)
if not(readable.nil? or readable.empty?)
readable.each do |io|
begin
while chunk = io.read_nonblock(4096)
- 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 define_chain_op
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def define_chain_op(opname, klass)
define_method(opname) do |other|
unless CommandLine === other
other = CommandLine.new(*[*other])
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 normalize_command_line
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def normalize_command_line(*args, &block)
command_line = nil
if args.empty? or args.first == nil
command_line = CommandLine.new
elsif args.all?{|arg| arg.is_a? String}
- 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 format_streams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def format_streams
"stdout:#{stdout.nil? || stdout.empty? ? "[empty]\n" : "\n#{stdout}"}" +
"stderr:#{stderr.nil? || stderr.empty? ? "[empty]\n" : "\n#{stderr}"}---"
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"