rubocop-hq/rubocop

View on GitHub

Showing 428 of 428 total issues

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 Changelog has 23 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 SafeNavigation has 23 methods (exceeds 20 allowed). Consider refactoring.
      Open

            class SafeNavigation < Base
              include NilMethods
              include RangeHelp
              extend AutoCorrector
      
      
      Severity: Minor
      Found in lib/rubocop/cop/style/safe_navigation.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 TargetFinder has 23 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 2 hrs to fix

            Class CommentConfig has 22 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class CommentConfig
                # @api private
                REDUNDANT_DISABLE = 'Lint/RedundantCopDisableDirective'
            
                # @api private
            Severity: Minor
            Found in lib/rubocop/comment_config.rb - About 2 hrs to fix

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

                    class TrivialAccessors < Base
                      include AllowedMethods
                      extend AutoCorrector
              
                      MSG = 'Use `attr_%<kind>s` to define trivial %<kind>s methods.'
              Severity: Minor
              Found in lib/rubocop/cop/style/trivial_accessors.rb - About 2 hrs to fix

                Class SpaceAroundOperators has 22 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 2 hrs to fix

                  File variable_force.rb has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module RuboCop
                    module Cop
                      # This force provides a way to track local variables and scopes of Ruby.
                      # Cops interact with this force need to override some of the hook methods.
                      #
                  Severity: Minor
                  Found in lib/rubocop/cop/variable_force.rb - About 2 hrs to fix

                    Method reference! has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                            def reference!(node)
                              reference = Reference.new(node, @scope)
                              @references << reference
                              consumed_branches = nil
                    
                    
                    Severity: Minor
                    Found in lib/rubocop/cop/variable_force/variable.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 DisabledConfigFormatter has 21 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                        class DisabledConfigFormatter < BaseFormatter
                          include PathUtil
                    
                          HEADING = <<~COMMENTS
                            # This configuration was generated by
                    Severity: Minor
                    Found in lib/rubocop/formatter/disabled_config_formatter.rb - About 2 hrs to fix

                      Class FileName has 21 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.'
                      Severity: Minor
                      Found in lib/rubocop/cop/naming/file_name.rb - About 2 hrs to fix

                        Class RedundantCopDisableDirective has 21 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                              class RedundantCopDisableDirective < Base
                                include RangeHelp
                                extend AutoCorrector
                        
                                COP_NAME = 'Lint/RedundantCopDisableDirective'
                        Severity: Minor
                        Found in lib/rubocop/cop/lint/redundant_cop_disable_directive.rb - About 2 hrs to fix

                          Class Offense has 21 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class Offense
                                include Comparable
                          
                                # @api private
                                COMPARISON_ATTRIBUTES = %i[line column cop_name
                          Severity: Minor
                          Found in lib/rubocop/cop/offense.rb - About 2 hrs to fix

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

                                class VariableForce
                                  # Namespace for branch classes for each control structure.
                                  module Branch
                                    def self.of(target_node, scope: nil)
                                      ([target_node] + target_node.ancestors).each do |node|
                            Severity: Minor
                            Found in lib/rubocop/cop/variable_force/branch.rb - About 2 hrs to fix

                              File base.rb has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              module RuboCop
                                module Cop
                                  # A scaffold for concrete cops.
                                  #
                                  # The Cop::Base class is meant to be extended.
                              Severity: Minor
                              Found in lib/rubocop/cop/base.rb - About 2 hrs to fix

                                Method find_class_or_module has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def find_class_or_module(node, namespace)
                                          return nil unless node
                                
                                          name = namespace.pop
                                
                                
                                Severity: Minor
                                Found in lib/rubocop/cop/naming/file_name.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 on_return has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def on_return(node)
                                          # Check Lint/NonLocalExitFromIterator first before this cop
                                          node.each_ancestor(:block, :def, :defs) do |n|
                                            break if scoped_node?(n)
                                
                                
                                Severity: Minor
                                Found in lib/rubocop/cop/style/return_nil.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 expect_correction has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def expect_correction(correction, loop: true, source: nil)
                                        if source
                                          expected_annotations = parse_annotations(source, raise_error: false)
                                          @processed_source = parse_processed_source(expected_annotations.plain_source)
                                          _investigate(cop, @processed_source)
                                Severity: Minor
                                Found in lib/rubocop/rspec/expect_offense.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 on_return has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def on_return(return_node)
                                          return if return_value?(return_node)
                                
                                          return_node.each_ancestor(:block, :def, :defs) do |node|
                                            break if scoped_node?(node)
                                Severity: Minor
                                Found in lib/rubocop/cop/lint/non_local_exit_from_iterator.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

                                Severity
                                Category
                                Status
                                Source
                                Language