Showing 31 of 35 total issues
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 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?(:name) ? feature[:name].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"
Further reading
Method filled_scenarios
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def filled_scenarios
scenarios do |file, feature, scenario|
next unless scenario.include? :steps
next if scenario[:steps].empty?
yield(file, feature, 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 lint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def lint
features do |file, feature|
next unless feature.include? :name
expected_feature_name = title_case file
next if ignore_whitespaces(feature[:name]).casecmp(ignore_whitespaces(expected_feature_name)) == 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 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 line
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def line(feature, scenario, step)
line = feature.nil? ? nil : feature[:location][:line]
line = scenario[:location][:line] unless scenario.nil?
line = step[:location][:line] unless step.nil?
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 evaluate_members
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def evaluate_members(linter)
@config.config[linter.class.name.split('::').last].each do |member, value|
next if member.downcase.casecmp('enabled').zero?
member = member.downcase.to_sym
raise 'Member not found! Check the YAML' unless linter.respond_to? member
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def lint
scenarios do |file, feature, scenario|
next if scenario[:name].empty?
references = [reference(file, feature, scenario)]
description = 'Prefer to rely just on Given and When steps when name your scenario to keep it stable'
- 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 reference
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reference(file, feature = nil, scenario = nil, step = nil)
return file if feature.nil? || feature[:name].empty?
result = "#{file} (#{line(feature, scenario, step)}): #{feature[:name]}"
result += ".#{scenario[:name]}" unless scenario.nil? || scenario[:name].empty?
result += " step: #{step[:text]}" unless step.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 lint
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def lint
scenarios do |file, feature, scenario|
next if match_pattern? tags(feature)
next if match_pattern? tags(scenario)
references = [reference(file, feature, 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"