Showing 16 of 20 total issues
Class StreamOutput
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class StreamOutput
DEFAULT_COLORS = {:failure => :red, :error => :magenta, :info => :blue, :success => :green}.freeze
def initialize(std_ios = nil, err_ios = nil)
@error_count = @groups_ran = @groups_skipped = @tests_ran = @tests_skipped = @assertions_failed = @assertions_passed = 0
Method run_end
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run_end(duration)
total_assertions = @assertions_passed + @assertions_failed
if duration >= 1
tests_per_second = (@tests_ran / duration).round(2)
- 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_end
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_end(duration)
total_assertions = @assertions_passed + @assertions_failed
if duration >= 1
tests_per_second = (@tests_ran / duration).round(2)
Method assert_raises
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def assert_raises(*expected)
msg = expected.pop if expected.last.is_a?(String)
begin
yield
no_exception = true
- 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 group_end
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def group_end(group_name, tests_ran, tests_skipped, assertions_passed, assertions_failed)
@tests_skipped += tests_skipped
if tests_ran == 0
if tests_skipped > 0
@groups_skipped += 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 find_relevant_stack
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def find_relevant_stack
retval = []
found_start = false
@backtrace.each do |location|
has_doh_test = location.index('dohtest')
- 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_configuration_file
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_configuration_file(start_path)
start_path = File.expand_path(start_path || '.')
if File.directory?(start_path)
start_directory = start_path
else
Method load_configuration_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_configuration_file(start_path)
start_path = File.expand_path(start_path || '.')
if File.directory?(start_path)
start_directory = start_path
else
- 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 group_end
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def group_end(group_name, tests_ran, tests_skipped, assertions_passed, assertions_failed)
Method group_end
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def group_end(group_name, tests_ran, tests_skipped, assertions_passed, assertions_failed)
Method run_tests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_tests
determine_test_methods
find_before_each_method
find_after_each_method
setup_brink
- 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_after_all
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run_after_all
@group.after_all if @group.respond_to?(:after_all)
@config[:post_group_callback].each do |callback|
if (!callback.call(total_problems))
@error_count += 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run
start_time = Time.now
srand(@config[:seed])
@output.run_begin(@config)
- 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_before_each
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run_before_each
@config[:pre_each_callback].each do |callback|
if !callback.call
@error_count += 1
@output.callback_failed(callback.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 run_before_all
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run_before_all
@group.before_all if @group.respond_to?(:before_all)
@config[:pre_group_callback].each do |callback|
if (!callback.call(@group))
@error_count += 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 run_after_each
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run_after_each
@group.send(@after_each_method) if @after_each_method
@config[:post_each_callback].each do |callback|
if !callback.call
@error_count += 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"