Showing 2 of 2 total issues
Method process
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def process
ruleset.each do |rule|
mark_skipped(rule) && next if already_matched?(rule)
mark_not_match(rule) && next unless rule_matches?(rule)
- 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 RulesProcessor.configuration
is defined at both lib/rules_processor.rb:21 and lib/rules_processor.rb:25. Open
Open
def self.configuration
- Read upRead up
- Exclude checks
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