searls/rubbycop

View on GitHub

Showing 270 of 302 total issues

File rubbycop.rb has 490 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'parser'
require 'rainbow'

require 'English'
require 'set'
Severity: Minor
Found in lib/rubbycop.rb - About 7 hrs to fix

    Class Node has 54 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Node < Parser::AST::Node # rubbycop:disable Metrics/ClassLength
          include RubbyCop::AST::Sexp
    
          COMPARISON_OPERATORS = %i[! == === != <= >= > < <=>].freeze
    
    
    Severity: Major
    Found in lib/rubbycop/ast/node.rb - About 7 hrs to fix

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

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

        Class Compiler has 38 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Compiler
              RSYM    = %r{:(?:[\w+@*/?!<>=~|%^-]+|\[\]=?)}
              ID_CHAR = /[a-zA-Z_-]/
              META    = /\(|\)|\{|\}|\[|\]|\$\.\.\.|\$|!|\^|\.\.\./
              NUMBER  = /-?\d+(?:\.\d+)?/
        Severity: Minor
        Found in lib/rubbycop/node_pattern.rb - About 5 hrs to fix

          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

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

                  class SpaceAroundKeyword < Cop
                    MSG_BEFORE = 'Space before keyword `%s` is missing.'.freeze
                    MSG_AFTER = 'Space after keyword `%s` is missing.'.freeze
            
                    DO = 'do'.freeze
            Severity: Minor
            Found in lib/rubbycop/cop/layout/space_around_keyword.rb - About 4 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

                File node.rb has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module RubbyCop
                  module AST
                    # `RubbyCop::AST::Node` is a subclass of `Parser::AST::Node`. It provides
                    # access to parent nodes and an object-oriented way to traverse an AST with
                    # the power of `Enumerable`.
                Severity: Minor
                Found in lib/rubbycop/ast/node.rb - About 4 hrs to fix

                  File node_pattern.rb has 343 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module RubbyCop
                    # This class performs a pattern-matching operation on an AST node.
                    #
                    # Initialize a new `NodePattern` with `NodePattern.new(pattern_string)`, then
                    # pass an AST node to `NodePattern#match`. Alternatively, use one of the class
                  Severity: Minor
                  Found in lib/rubbycop/node_pattern.rb - About 4 hrs to fix

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

                      class Runner # rubbycop: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/rubbycop/runner.rb - About 3 hrs to fix

                      Class Cop has 30 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                          class Cop
                            extend RubbyCop::AST::Sexp
                            extend NodePattern::Macros
                            include RubbyCop::AST::Sexp
                            include Util
                      Severity: Minor
                      Found in lib/rubbycop/cop/cop.rb - About 3 hrs to fix

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

                            class VariableForce < Force # rubbycop: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/rubbycop/cop/variable_force.rb - About 3 hrs to fix

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

                                class BlockDelimiters < Cop
                                  include ConfigurableEnforcedStyle
                          
                                  def on_send(node)
                                    return unless node.arguments?
                          Severity: Minor
                          Found in lib/rubbycop/cop/style/block_delimiters.rb - About 3 hrs to fix

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

                                  class ConditionalAssignment < Cop
                                    include ConditionalAssignmentHelper
                                    include ConfigurableEnforcedStyle
                                    include IgnoredNode
                            
                            
                            Severity: Minor
                            Found in lib/rubbycop/cop/style/conditional_assignment.rb - About 3 hrs to fix

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

                                    class IndentationWidth < Cop # rubbycop:disable Metrics/ClassLength
                                      include EndKeywordAlignment
                                      include AutocorrectAlignment
                                      include OnMethodDef
                                      include CheckAssignment
                              Severity: Minor
                              Found in lib/rubbycop/cop/layout/indentation_width.rb - About 2 hrs to fix

                                Class ExtraSpacing has 25 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                      class ExtraSpacing < Cop
                                        include PrecedingFollowingAlignment
                                
                                        MSG_UNNECESSARY = 'Unnecessary spacing detected.'.freeze
                                        MSG_UNALIGNED_ASGN = '`=` is not aligned with the %s assignment.'.freeze
                                Severity: Minor
                                Found in lib/rubbycop/cop/layout/extra_spacing.rb - About 2 hrs to fix

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

                                  require 'optparse'
                                  require 'shellwords'
                                  
                                  module RubbyCop
                                    # This class handles command line options.
                                  Severity: Minor
                                  Found in lib/rubbycop/options.rb - About 2 hrs to fix

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

                                          class TrivialAccessors < Cop
                                            MSG = 'Use `attr_%s` to define trivial %s methods.'.freeze
                                    
                                            def on_def(node)
                                              return if in_module_or_instance_eval?(node)
                                    Severity: Minor
                                    Found in lib/rubbycop/cop/style/trivial_accessors.rb - About 2 hrs to fix

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

                                            class Next < Cop
                                              include ConfigurableEnforcedStyle
                                              include MinBodyLength
                                      
                                              MSG = 'Use `next` to skip iteration.'.freeze
                                      Severity: Minor
                                      Found in lib/rubbycop/cop/style/next.rb - About 2 hrs to fix

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

                                            class SendNode < Node
                                              # The receiving node of the method invocation.
                                              #
                                              # @return [Node, nil] the receiver of the invoked method or `nil`
                                              def receiver
                                        Severity: Minor
                                        Found in lib/rubbycop/ast/node/send_node.rb - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language