rgrabowski/rules_processor

View on GitHub

Showing 2 of 2 total issues

Method process has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def process
      ruleset.each do |rule|
        mark_skipped(rule) && next if already_matched?(rule)
        mark_not_match(rule) && next unless rule_matches?(rule)

Severity: Minor
Found in lib/rules_processor/processor.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 RulesProcessor.configuration is defined at both lib/rules_processor.rb:21 and lib/rules_processor.rb:25.
Open

  def self.configuration
Severity: Minor
Found in lib/rules_processor.rb by rubocop

This cop checks for duplicated instance (or singleton) method definitions.

Example:

# bad

def duplicated
  1
end

def duplicated
  2
end

Example:

# bad

def duplicated
  1
end

alias duplicated other_duplicated

Example:

# good

def duplicated
  1
end

def other_duplicated
  2
end
Severity
Category
Status
Source
Language