r-cochran/cuke_sniffer

View on GitHub
lib/cuke_sniffer/scenario.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method extract_inline_tables has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def extract_inline_tables(scenario_body)
      index = 0
      while index < scenario_body.size
        if scenario_body[index] =~ /^\|.*\|/
          start_index = index
Severity: Minor
Found in lib/cuke_sniffer/scenario.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 get_step_order has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_step_order
      order = []
      @steps.each do |line|
        next if is_comment?(line)
        match = line.match(STEP_REGEX)
Severity: Minor
Found in lib/cuke_sniffer/scenario.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 define_ranges has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def define_ranges(scenario)
      ranges = {}
      index = 0
      index += 1 until index >= scenario.length or scenario[index] =~ SCENARIO_TITLE_STYLES
      ranges[:tags] = scenario[0...index]
Severity: Minor
Found in lib/cuke_sniffer/scenario.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

There are no issues that match your filters.

Category
Status