Showing 9 of 15 total issues
Class Reporter
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Reporter
# List of all callback methods as symbols.
#
CALLBACKS = %i[
before_features
Method after_step
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def after_step(result, scenario, *)
return unless result.state == :failed
io.print red 'E'
Method after_step
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def after_step(result, scenario, *)
return unless result.state == :failed
io.print red 'E'
- 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 filter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def filter(options, files)
list = FeatureList.new
filter = Filter.new options, files
each do |feature|
- 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 expand_files
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def expand_files(files, options)
files = Dir[options[:pattern].to_s] if files.empty? && options[:pattern]
files.each_with_object([]) do |input, memo|
if File.directory? input
Dir["#{input}/**/*"].each do |file_in_dir|
- 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_exception
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def format_exception(err, backtrace: true, indent: 0)
s = ::StringIO.new
s << (' ' * indent) << err.class.to_s << ': ' << err.message.strip << "\n"
if backtrace && err.respond_to?(:backtrace)
- 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 after_features
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def after_features(features)
scenarios = features.map(&:scenarios).flatten
size = scenarios.size
passed = scenarios.count(&:passed?)
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(feature, file, line, tags, raw)
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run(runner, reporter)
reporter.invoke :before_scenario, self
_run(runner, reporter)
- 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"