charlierudolph/cucumber_lint

View on GitHub

Showing 4 of 4 total issues

Method parse_config has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_config
      defaults = load_default_config
      overrides = load_config "#{@dir}/cucumber_lint.yml"

      overrides.each_pair do |style, style_overrides|
Severity: Minor
Found in lib/cucumber_lint/config.rb - About 45 mins 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 lint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def lint
      previous_keyword = nil

      @steps.each do |step|
        current_keyword = step.keyword.strip
Severity: Minor
Found in lib/cucumber_lint/linter/steps_linter.rb - About 35 mins 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 resolve_fix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def resolve_fix
      if errors.empty?
        :passed
      elsif delete?
        delete
Severity: Minor
Found in lib/cucumber_lint/linted_file.rb - About 25 mins 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 error_messages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def error_messages exclude_fixes
      errors.map do |error|
        next if error[:fix] && exclude_fixes
        location = @path.to_s
        location += ":#{error[:line_number]}" if error[:line_number]
Severity: Minor
Found in lib/cucumber_lint/linted_file.rb - About 25 mins 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

Severity
Category
Status
Source
Language