rubocop-hq/rubocop

View on GitHub

Showing 655 of 655 total issues

Method issue_offenses has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def issue_offenses(node, left, right, start_ok, end_ok)
Severity: Minor
Found in lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb - About 35 mins to fix

    Method line_breaks has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def line_breaks(node, source, previous_line_num, base_line_num, node_index)
    Severity: Minor
    Found in lib/rubocop/cop/correctors/percent_literal_corrector.rb - About 35 mins to fix

      Method autocorrect_line has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def autocorrect_line(corrector, line_begin_pos, expr, column_delta,
                                   taboo_ranges)
      Severity: Minor
      Found in lib/rubocop/cop/correctors/alignment_corrector.rb - About 35 mins to fix

        Method wrap_contents has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def wrap_contents(corrector, node, contents, char, delimiters)
        Severity: Minor
        Found in lib/rubocop/cop/correctors/percent_literal_corrector.rb - About 35 mins to fix

          Method empty_corrections has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def empty_corrections(processed_source, corrector, empty_config,
                                        left_token, right_token)
          Severity: Minor
          Found in lib/rubocop/cop/correctors/space_corrector.rb - About 35 mins to fix

            Method check_right_brace has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def check_right_brace(node, inner, left_brace, right_brace, single_line)
            Severity: Minor
            Found in lib/rubocop/cop/layout/space_inside_block_braces.rb - About 35 mins to fix

              Method check_space has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      def check_space(space_begin_pos, space_end_pos, range, msg, node = nil)
              Severity: Minor
              Found in lib/rubocop/cop/layout/space_around_block_parameters.rb - About 35 mins to fix

                Method handle_exiting_options has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def handle_exiting_options
                      return unless Options::EXITING_OPTIONS.any? { |o| @options.key? o }
                
                      run_command(:version) if @options[:version] || @options[:verbose_version]
                      run_command(:show_cops) if @options[:show_cops]
                Severity: Minor
                Found in lib/rubocop/cli.rb - About 35 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 on_send has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                        def on_send(node)
                          return unless (parent = node.parent)
                          return unless parent.send_type? && parent.method?(:expression)
                          return unless parent.receiver.receiver
                
                
                Severity: Minor
                Found in lib/rubocop/cop/internal_affairs/location_expression.rb - About 35 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 aligned_with_assignment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def aligned_with_assignment(token, line_range)
                        token_line_indent    = processed_source.line_indentation(token.line)
                        assignment_lines     = relevant_assignment_lines(line_range)
                        relevant_line_number = assignment_lines[1]
                
                
                Severity: Minor
                Found in lib/rubocop/cop/mixin/preceding_following_alignment.rb - About 35 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 on_case has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                        def on_case(node)
                          node.each_when do |when_node|
                            next if when_node.body
                            next if cop_config['AllowComments'] && contains_comments?(when_node)
                
                
                Severity: Minor
                Found in lib/rubocop/cop/lint/empty_when.rb - About 35 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 version has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.version(debug: false, env: nil)
                      if debug
                        verbose_version = format(MSG, version: STRING, parser_version: parser_version,
                                                      rubocop_ast_version: RuboCop::AST::Version::STRING,
                                                      ruby_engine: RUBY_ENGINE, ruby_version: RUBY_VERSION,
                Severity: Minor
                Found in lib/rubocop/version.rb - About 35 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 merge has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def merge(base_hash, derived_hash, **opts)
                      result = base_hash.merge(derived_hash)
                      keys_appearing_in_both = base_hash.keys & derived_hash.keys
                      keys_appearing_in_both.each do |key|
                        if opts[:unset_nil] && derived_hash[key].nil?
                Severity: Minor
                Found in lib/rubocop/config_loader_resolver.rb - About 35 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 gem_config_path has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def gem_config_path(gem_name, relative_config_path)
                      if defined?(Bundler)
                        gem = Bundler.load.specs[gem_name].first
                        gem_path = gem.full_gem_path if gem
                      end
                Severity: Minor
                Found in lib/rubocop/config_loader_resolver.rb - About 35 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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def run(paths)
                      target_files = find_target_files(paths)
                      if @options[:list_target_files]
                        list_files(target_files)
                      else
                Severity: Minor
                Found in lib/rubocop/runner.rb - About 35 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 obsoletions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def obsoletions
                      rules.map do |rule|
                        next unless rule.violated?
                
                        if rule.warning?
                Severity: Minor
                Found in lib/rubocop/config_obsoletion.rb - About 35 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 excludes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def excludes(offending_files, cop_name, parent)
                        # Exclude properties in .rubocop_todo.yml override default ones, as well as any custom
                        # excludes in .rubocop.yml, so in order to retain those excludes we must copy them.
                        # There can be multiple .rubocop.yml files in subdirectories, but we just look at the
                        # current working directory.
                Severity: Minor
                Found in lib/rubocop/formatter/disabled_config_formatter.rb - About 35 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 extra_enabled_comments_with_names has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def extra_enabled_comments_with_names(extras:, names:)
                      each_directive do |directive|
                        next unless comment_only_line?(directive.line_number)
                
                        if directive.enabled_all?
                Severity: Minor
                Found in lib/rubocop/comment_config.rb - About 35 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 each_inspected_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def each_inspected_file(files)
                      files.reduce(true) do |all_passed, file|
                        offenses = process_file(file)
                        yield file
                
                
                Severity: Minor
                Found in lib/rubocop/runner.rb - About 35 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 check_symmetrical has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def check_symmetrical(node)
                        if opening_brace_on_same_line?(node)
                          return if closing_brace_on_same_line?(node)
                
                          add_offense(node.loc.end, message: self.class::SAME_LINE_MESSAGE) do |corrector|
                Severity: Minor
                Found in lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb - About 35 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

                Severity
                Category
                Status
                Source
                Language