Class Config
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Config
include PathUtil
COMMON_PARAMS = %w[Exclude Include Severity
AutoCorrect StyleGuide Details].freeze
File config.rb
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'pathname'
# rubbycop:disable Metrics/ClassLength
module RubbyCop
Method add_excludes_from_higher_level
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def add_excludes_from_higher_level(highest_config)
return unless highest_config.for_all_cops['Exclude']
excludes = for_all_cops['Exclude'] ||= []
highest_config.for_all_cops['Exclude'].each do |path|
- 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 make_excludes_absolute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def make_excludes_absolute
each do |key, _|
validate_section_presence(key)
next unless self[key]['Exclude']
- 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 validate_enforced_styles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate_enforced_styles(valid_cop_names)
valid_cop_names.each do |name|
styles = self[name].select { |key, _| key.start_with?('Enforced') }
styles.each do |style_name, style|
- 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"