rubocop-hq/rubocop

View on GitHub

Showing 652 of 652 total issues

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

      class IfUnlessModifier < Base
        include StatementModifier
        include LineLengthHelp
        include AllowedPattern
        include RangeHelp
Severity: Minor
Found in lib/rubocop/cop/style/if_unless_modifier.rb - About 3 hrs to fix

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

        class Team
          # @return [Team]
          def self.new(cop_or_classes, config, options = {})
            # Support v0 api:
            return mobilize(cop_or_classes, config, options) if cop_or_classes.first.is_a?(Class)
    Severity: Minor
    Found in lib/rubocop/cop/team.rb - About 3 hrs to fix

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

            class EmptyLineBetweenDefs < Base
              include RangeHelp
              extend AutoCorrector
      
              MSG = 'Expected %<expected>s between %<type>s definitions; found %<actual>d.'
      Severity: Minor
      Found in lib/rubocop/cop/layout/empty_line_between_defs.rb - About 3 hrs to fix

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

              class SpaceAroundOperators < Base
                include PrecedingFollowingAlignment
                include RangeHelp
                include RationalLiteral
                extend AutoCorrector
        Severity: Minor
        Found in lib/rubocop/cop/layout/space_around_operators.rb - About 3 hrs to fix

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

            class TargetFinder
              HIDDEN_PATH_SUBSTRING = "#{File::SEPARATOR}."
          
              def initialize(config_store, options = {})
                @config_store = config_store
          Severity: Minor
          Found in lib/rubocop/target_finder.rb - About 3 hrs to fix

            Method find_previous_older_sibling has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

                    def find_previous_older_sibling(node) # rubocop:disable Metrics
                      search_node(node).left_siblings.reverse.find do |sibling|
                        next unless sibling.is_a?(AST::Node)
            
                        sibling = sibling_node(sibling)
            Severity: Minor
            Found in lib/rubocop/cop/style/require_order.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 RedundantCondition has 25 methods (exceeds 20 allowed). Consider refactoring.
            Open

                  class RedundantCondition < Base
                    include RangeHelp
                    extend AutoCorrector
            
                    MSG = 'Use double pipes `||` instead.'
            Severity: Minor
            Found in lib/rubocop/cop/style/redundant_condition.rb - About 2 hrs to fix

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

                    class SafeNavigation < Base
                      include NilMethods
                      include RangeHelp
                      extend AutoCorrector
                      extend TargetRubyVersion
              Severity: Minor
              Found in lib/rubocop/cop/style/safe_navigation.rb - About 2 hrs to fix

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

                      class LineLength < Base
                        include CheckLineBreakable
                        include AllowedPattern
                        include RangeHelp
                        include LineLengthHelp
                Severity: Minor
                Found in lib/rubocop/cop/layout/line_length.rb - About 2 hrs to fix

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

                        class FileName < Base
                          include RangeHelp
                  
                          MSG_SNAKE_CASE = 'The name of this source file (`%<basename>s`) should use snake_case.'
                          MSG_NO_DEFINITION = '`%<basename>s` should define a class or module called `%<namespace>s`.'
                  Severity: Minor
                  Found in lib/rubocop/cop/naming/file_name.rb - About 2 hrs to fix

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

                    class Changelog
                      ENTRIES_PATH = 'changelog/'
                      FIRST_HEADER = /#{Regexp.escape("## master (unreleased)\n")}/m.freeze
                      ENTRIES_PATH_TEMPLATE = "#{ENTRIES_PATH}%<type>s_%<name>s.md"
                      TYPE_REGEXP = /#{Regexp.escape(ENTRIES_PATH)}([a-z]+)_/.freeze
                    Severity: Minor
                    Found in tasks/changelog.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

                        File arguments_forwarding.rb has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        module RuboCop
                          module Cop
                            module Style
                              # In Ruby 2.7, arguments forwarding has been added.
                              #
                        Severity: Minor
                        Found in lib/rubocop/cop/style/arguments_forwarding.rb - About 2 hrs to fix

                          Method each_already_disabled has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def each_already_disabled(cop, line_ranges)
                                    line_ranges.each_cons(2) do |previous_range, range|
                                      next if ignore_offense?(range)
                                      # If a cop is disabled in a range that begins on the same line as
                                      # the end of the previous range, it means that the cop was
                          Severity: Minor
                          Found in lib/rubocop/cop/lint/redundant_cop_disable_directive.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 ConfigLoader has 23 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                            class ConfigLoader
                              DOTFILE = ConfigFinder::DOTFILE
                              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 2 hrs to fix

                            Class InclusiveLanguage has 23 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                                  class InclusiveLanguage < Base
                                    include RangeHelp
                                    extend AutoCorrector
                            
                                    EMPTY_ARRAY = [].freeze
                            Severity: Minor
                            Found in lib/rubocop/cop/naming/inclusive_language.rb - About 2 hrs to fix

                              Class SoleNestedConditional has 23 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                                    class SoleNestedConditional < Base
                                      include RangeHelp
                                      extend AutoCorrector
                              
                                      MSG = 'Consider merging nested conditions into outer `%<conditional_type>s` conditions.'
                              Severity: Minor
                              Found in lib/rubocop/cop/style/sole_nested_conditional.rb - About 2 hrs to fix

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

                                      class Next < Base
                                        include ConfigurableEnforcedStyle
                                        include MinBodyLength
                                        include RangeHelp
                                        extend AutoCorrector
                                Severity: Minor
                                Found in lib/rubocop/cop/style/next.rb - About 2 hrs to fix

                                  Class DirectiveComment has 23 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                    class DirectiveComment
                                      # @api private
                                      LINT_DEPARTMENT = 'Lint'
                                      # @api private
                                      LINT_REDUNDANT_DIRECTIVE_COP = "#{LINT_DEPARTMENT}/RedundantCopDisableDirective"
                                  Severity: Minor
                                  Found in lib/rubocop/directive_comment.rb - About 2 hrs to fix

                                    Class MultilineMethodCallIndentation has 23 methods (exceeds 20 allowed). Consider refactoring.
                                    Open

                                          class MultilineMethodCallIndentation < Base
                                            include ConfigurableEnforcedStyle
                                            include Alignment
                                            include MultilineExpressionIndentation
                                            extend AutoCorrector
                                    Severity: Minor
                                    Found in lib/rubocop/cop/layout/multiline_method_call_indentation.rb - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language