searls/rubbycop

View on GitHub
lib/rubbycop/config.rb

Summary

Maintainability
C
1 day
Test Coverage

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
Severity: Minor
Found in lib/rubbycop/config.rb - About 5 hrs to fix

    File config.rb has 354 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'pathname'
    
    # rubbycop:disable Metrics/ClassLength
    
    module RubbyCop
    Severity: Minor
    Found in lib/rubbycop/config.rb - About 4 hrs to fix

      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|
      Severity: Minor
      Found in lib/rubbycop/config.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 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']
      
      
      Severity: Minor
      Found in lib/rubbycop/config.rb - About 55 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 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|
      Severity: Minor
      Found in lib/rubbycop/config.rb - About 55 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