rubocop-hq/rubocop

View on GitHub

Showing 382 of 407 total issues

File rubocop.rb has 630 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'English'
before_us = $LOADED_FEATURES.dup
require 'rainbow'

require 'set'
Severity: Major
Found in lib/rubocop.rb - About 1 day to fix

    Class Base has 53 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Base # rubocop:disable Metrics/ClassLength
          extend RuboCop::AST::Sexp
          extend NodePattern::Macros
          include RuboCop::AST::Sexp
          include Util
    Severity: Major
    Found in lib/rubocop/cop/base.rb - About 7 hrs to fix

      File conditional_assignment.rb has 420 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module RuboCop
        module Cop
          module Style
            # Helper module to provide common methods to classes needed for the
            # ConditionalAssignment Cop.
      Severity: Minor
      Found in lib/rubocop/cop/style/conditional_assignment.rb - About 6 hrs to fix

        File options.rb has 418 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'optparse'
        require 'shellwords'
        
        module RuboCop
          class IncorrectCopNameError < StandardError; end
        Severity: Minor
        Found in lib/rubocop/options.rb - About 6 hrs to fix

          Class SpaceAroundKeyword has 37 methods (exceeds 20 allowed). Consider refactoring.
          Open

                class SpaceAroundKeyword < Base
                  extend AutoCorrector
          
                  MSG_BEFORE = 'Space before keyword `%<range>s` is missing.'
                  MSG_AFTER = 'Space after keyword `%<range>s` is missing.'
          Severity: Minor
          Found in lib/rubocop/cop/layout/space_around_keyword.rb - About 4 hrs to fix

            Class Runner has 34 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class Runner # rubocop:disable Metrics/ClassLength
                # An exception indicating that the inspection loop got stuck correcting
                # offenses back and forth.
                class InfiniteCorrectionLoop < RuntimeError
                  attr_reader :offenses
            Severity: Minor
            Found in lib/rubocop/runner.rb - About 4 hrs to fix

              Class Config has 32 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class Config
                  include PathUtil
                  include FileFinder
                  extend Forwardable
              
              
              Severity: Minor
              Found in lib/rubocop/config.rb - About 4 hrs to fix

                Class Registry has 32 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class Registry
                      include Enumerable
                
                      attr_reader :options
                
                
                Severity: Minor
                Found in lib/rubocop/cop/registry.rb - About 4 hrs to fix

                  Class IndentationWidth has 32 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                        class IndentationWidth < Cop # rubocop:disable Metrics/ClassLength
                          include EndKeywordAlignment
                          include Alignment
                          include CheckAssignment
                          include IgnoredPattern
                  Severity: Minor
                  Found in lib/rubocop/cop/layout/indentation_width.rb - About 4 hrs to fix

                    Class BlockDelimiters has 31 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                          class BlockDelimiters < Base
                            include ConfigurableEnforcedStyle
                            include IgnoredMethods
                            extend AutoCorrector
                    
                    
                    Severity: Minor
                    Found in lib/rubocop/cop/style/block_delimiters.rb - About 3 hrs to fix

                      Class ConfigLoader has 28 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class ConfigLoader
                          DOTFILE = '.rubocop.yml'
                          XDG_CONFIG = 'config.yml'
                          RUBOCOP_HOME = File.realpath(File.join(File.dirname(__FILE__), '..', '..'))
                          DEFAULT_FILE = File.join(RUBOCOP_HOME, 'config', 'default.yml')
                      Severity: Minor
                      Found in lib/rubocop/config_loader.rb - About 3 hrs to fix

                        Class VariableForce has 28 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            class VariableForce < Force # rubocop:disable Metrics/ClassLength
                              VARIABLE_ASSIGNMENT_TYPE = :lvasgn
                              REGEXP_NAMED_CAPTURE_TYPE = :match_with_lvasgn
                              VARIABLE_ASSIGNMENT_TYPES =
                                [VARIABLE_ASSIGNMENT_TYPE, REGEXP_NAMED_CAPTURE_TYPE].freeze
                        Severity: Minor
                        Found in lib/rubocop/cop/variable_force.rb - About 3 hrs to fix

                          Class RedundantParentheses has 28 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                                class RedundantParentheses < Base
                                  include Parentheses
                                  extend AutoCorrector
                          
                                  def_node_matcher :square_brackets?,
                          Severity: Minor
                          Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 3 hrs to fix

                            Class LineLength has 27 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                  class LineLength < Cop
                                    include CheckLineBreakable
                                    include ConfigurableMax
                                    include IgnoredPattern
                                    include RangeHelp
                            Severity: Minor
                            Found in lib/rubocop/cop/layout/line_length.rb - About 3 hrs to fix

                              Class Team has 26 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                  class Team
                                    attr_reader :errors, :warnings, :updated_source_file, :cops
                              
                                    alias updated_source_file? updated_source_file
                              
                              
                              Severity: Minor
                              Found in lib/rubocop/cop/team.rb - About 3 hrs to fix

                                File runner.rb has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                require 'parallel'
                                
                                module RuboCop
                                  # This class handles the processing of files, which includes dealing with
                                  # formatters and letting cops inspect the files.
                                Severity: Minor
                                Found in lib/rubocop/runner.rb - About 2 hrs to fix

                                  Method on_send has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          def on_send(node)
                                            return unless struct_new(node) do
                                              node.arguments.each_with_index do |arg, index|
                                                # Ignore if the first argument is a class name
                                                next if index.zero? && arg.str_type?
                                  Severity: Minor
                                  Found in lib/rubocop/cop/lint/struct_new_override.rb - About 2 hrs 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

                                  Class CopsDocumentationGenerator has 24 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class CopsDocumentationGenerator # rubocop:disable Metrics/ClassLength
                                    include ::RuboCop::Cop::Documentation
                                    # This class will only generate documentation for cops that belong to one of
                                    # the departments given in the `departments` array. E.g. if we only wanted
                                    # documentation for Lint cops:
                                  Severity: Minor
                                  Found in lib/rubocop/cops_documentation_generator.rb - About 2 hrs to fix

                                    Class ConditionalAssignment has 24 methods (exceeds 20 allowed). Consider refactoring.
                                    Open

                                          class ConditionalAssignment < Base
                                            include ConditionalAssignmentHelper
                                            include ConfigurableEnforcedStyle
                                            include IgnoredNode
                                            extend AutoCorrector
                                    Severity: Minor
                                    Found in lib/rubocop/cop/style/conditional_assignment.rb - About 2 hrs to fix

                                      Class MethodCallWithArgsParentheses has 24 methods (exceeds 20 allowed). Consider refactoring.
                                      Open

                                            class MethodCallWithArgsParentheses
                                              # Style omit_parentheses
                                              module OmitParentheses
                                                TRAILING_WHITESPACE_REGEX = /\s+\Z/.freeze
                                                OMIT_MSG = 'Omit parentheses for method calls with arguments.'
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language