bbatsov/rubocop

View on GitHub

Showing 627 of 669 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 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 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 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 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 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 check_empty_lines_special has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    def check_empty_lines_special(body, first_line, last_line)
                      return unless body
            
                      if namespace?(body, with_one_child: true)
                        check_both(:no_empty_lines, first_line, last_line)
            Severity: Minor
            Found in lib/rubocop/cop/mixin/empty_lines_around_body.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 on_send has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    def on_send(node)
                      return unless (next_sibling = node.right_sibling) && next_sibling.send_type?
            
                      method_name = next_sibling.method_name
                      return unless CORRECTION_EXPECTATION_METHODS.include?(method_name)

            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_new_investigation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    def on_new_investigation
                      processed_source.tokens.each do |token|
                        next if !should_check?(token) || token.text.ascii_only?
            
                        message = token.type == :tIDENTIFIER ? IDENTIFIER_MSG : CONSTANT_MSG
            Severity: Minor
            Found in lib/rubocop/cop/naming/ascii_identifiers.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_block has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    def on_block(node) # rubocop:disable Metrics/MethodLength, InternalAffairs/NumblockHandler
                      gem_specification(node) do |block_var|
                        metadata_value = metadata(node)
                        mfa_value = mfa_value(metadata_value)
            
            
            Severity: Minor
            Found in lib/rubocop/cop/gemspec/require_mfa.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 output_cop_param_comments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def output_cop_param_comments(output_buffer, params, default_cfg)
                    config_params = params.reject { |p| p.start_with?('Supported') }
                    output_buffer.puts("# Configuration parameters: #{config_params.join(', ')}.")
            
                    params.each do |param|
            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 detected_styles_for_column has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def detected_styles_for_column(column, left_parenthesis, left_brace)
                    styles = []
                    if column == (left_brace.source_line =~ /\S/)
                      styles << :consistent
                      styles << :special_inside_parentheses unless left_parenthesis
            Severity: Minor
            Found in lib/rubocop/cop/mixin/multiline_element_indentation.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 investigate_tokens has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                    def investigate_tokens
                      processed_source.tokens.each do |token|
                        next unless check_token?(token.type)
            
                        word_locations = scan_for_words(token.text)
            Severity: Minor
            Found in lib/rubocop/cop/naming/inclusive_language.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 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 heredoc? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                  def heredoc?(node)
                    return false unless node.is_a?(RuboCop::AST::Node)
                    return true if node.loc.respond_to?(:heredoc_body)
            
                    return heredoc_send?(node) if node.send_type?
            Severity: Minor
            Found in lib/rubocop/cop/mixin/trailing_comma.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 parser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def parser
                  return @parser if defined?(@parser)
            
                  @parser = if @lockfile_path && File.exist?(@lockfile_path) && bundler_lock_parser_defined?
                              begin
            Severity: Minor
            Found in lib/rubocop/lockfile.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