Showing 35 of 35 total issues
Class Linter
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Linter
attr_reader :issues
def self.descendants
ObjectSpace.each_object(::Class).select { |klass| klass < self }
Method lint
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def lint
scenarios do |file, feature, scenario|
next unless scenario.key? :examples
next unless scenario[:examples].length > 1
scenario[:examples].each do |example|
- 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 lint
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def lint
scenarios do |file, feature, scenario|
next unless scenario.key? :examples
scenario[:examples].each do |example|
next unless example.key? :tableHeader
- 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 lint
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def lint
scenarios do |file, feature, scenario|
next unless scenario[:type] == :ScenarioOutline
next unless scenario.key? :examples
- 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 gather_scenarios
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def gather_scenarios(file, feature)
scenarios = []
return scenarios unless feature.include? :children
feature[:children].each do |scenario|
next unless scenario[:type] == :Scenario
- 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 expanded_steps
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def expanded_steps(feature)
feature[:children].each do |scenario|
next unless scenario[:type] != :Background
next unless scenario.include? :steps
next if scenario[:steps].empty?
- 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 gather_givens
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def gather_givens(feature)
return unless feature.include? :children
has_non_given_step = false
feature[:children].each do |scenario|
next unless scenario.include? :steps
- 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 lint_examples
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def lint_examples(file, feature)
feature[:children].each do |scenario|
tags = gather_same_tags_for_outline scenario
next if tags.nil? || tags.empty?
next unless scenario[:examples].length > 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 lint
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def lint
features do |file, feature|
next if scenarios_with_steps(feature) <= 1
givens = gather_givens feature
next if givens.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 used?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def used?(variable, scenario)
variable = "<#{variable}>"
return false unless scenario.key? :steps
scenario[:steps].each do |step|
return true if step[:text].include? variable
- 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 check_similarity
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_similarity(scenarios)
scenarios.product(scenarios) do |lhs, rhs|
next if lhs == rhs
next if lhs[:reference] > rhs[:reference]
similarity = determine_similarity(lhs[:text], rhs[:text])
- 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 scenarios_with_steps
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def scenarios_with_steps(feature)
scenarios = 0
return 0 unless feature.key? :children
feature[:children].each do |scenario|
next unless scenario.include? :steps
- 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 lint
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def lint
backgrounds do |file, feature, background|
next unless background.key? :steps
invalid_steps = background[:steps].select { |step| step[:keyword] == 'When ' || step[:keyword] == 'Then ' }
next if invalid_steps.empty?
- 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 gather_same_tags
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def gather_same_tags(feature)
result = nil
feature[:children].each do |scenario|
next if scenario[:type] == :Background
return nil unless scenario.include? :tags
- 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 elements
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def elements
@files.each do |file, content|
feature = content[:feature]
next if feature.nil?
next unless feature.key? :children
- 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_tag
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def filter_tag(data, tag)
return data.reject { |item| tag?(item, tag) }.map { |item| filter_tag(item, tag) } if data.class == Array
return {} if (data.class == Hash) && (data.include? :feature) && tag?(data[:feature], tag)
return data unless data.respond_to? :each_pair
result = {}
- 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 lint_scenarios
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def lint_scenarios(file, feature)
tags = gather_same_tags feature
return if tags.nil?
return if tags.empty?
return unless feature[:children].length > 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 lint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def lint
scenarios do |file, feature, scenario|
name = scenario.key?(:name) ? scenario[:name].strip : ''
references = [reference(file, feature, scenario)]
next unless name.empty?
- 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 gather_same_tags_for_outline
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def gather_same_tags_for_outline(scenario)
result = nil
return result unless scenario.include? :examples
scenario[:examples].each do |example|
return nil unless example.include? :tags
- 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 lint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def lint
features do |file, feature|
name = feature.key?(:description) ? feature[:description].strip : ''
next unless name.empty?
references = [reference(file, 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"