Showing 18 of 24 total issues
Method parse_env
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def parse_env output
env = []
holder=nil
terminator=nil
output.each do |line|
- 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 load
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def load file_name
lines = []
file_lines = File.readlines(file_name)
shell = "bash"
shell = file_lines.shift.sub(/^#!/,'') if file_lines[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 process_test
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_test test
name, commands, execution_shell = test[:name], test[:commands], test[:shell]
shell = Session::Sh.new(:prog => execution_shell)
_env = env(shell)
@plugins.output_plugins(:start_test, test, _env)
Method parse_env
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_env output
env = []
holder=nil
terminator=nil
output.each do |line|
Method match_arg_klass
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def match_arg_klass arg, klass, type
klass = TF.const_get(klass)
return nil unless klass.respond_to? :argument_matches?
matches = klass.argument_matches? arg
return nil if matches.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 process_test
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process_test test
name, commands, execution_shell = test[:name], test[:commands], test[:shell]
shell = Session::Sh.new(:prog => execution_shell)
_env = env(shell)
@plugins.output_plugins(:start_test, test, _env)
- 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 execute_one
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute_one test, matcher, _stdout, _stderr, _stdboth, _status, env
Method execute_all
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute_all test, matcher, _stdout, _stderr, _stdboth, _status, env
Method execute_size
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute_size test, matcher, _stdout, _stderr, _stdboth, _status, env
Method execute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute test, _stdout, _stderr, _stdboth, _status, env
Method execute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute test, _stdout, _stderr, _stdboth, _status, env
Method execute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute test, _stdout, _stderr, _stdboth, _status, env
Method execute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute test, _stdout, _stderr, _stdboth, _status, env
Method execute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def execute test, _stdout, _stderr, _stdboth, _status, env
Method process_command_tests
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_command_tests _stdout, _stderr, _stdboth, _status, env, tests
Avoid too many return
statements within this method. Open
return nil
Method execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute test, _stdout, _stderr, _stdboth, _status, env
test =~ TF::EnvMatchTest::MATCHER
variable, sign, value = $1.strip, $2, $3
var_val = env[ variable ]
if !(var_val.nil?) && !(var_val.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 process_command_tests
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_command_tests _stdout, _stderr, _stdboth, _status, env, tests
tests.each do |test|
plugin = @plugins.test_plugins.find{|_plugin| _plugin.matches? test }
if plugin.nil?
status, msg = false, "Could not find plugin for test '#{test}'."
- 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"