funkwerk/gherkin_lint

View on GitHub
lib/gherkin_lint/linter/use_outline.rb

Summary

Maintainability
A
2 hrs
Test Coverage

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
Severity: Minor
Found in lib/gherkin_lint/linter/use_outline.rb - About 1 hr to fix

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])
Severity: Minor
Found in lib/gherkin_lint/linter/use_outline.rb - About 1 hr to fix

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

There are no issues that match your filters.

Category
Status