bbatsov/rubocop

View on GitHub

Showing 672 of 672 total issues

Avoid too many return statements within this method.
Open

            return if node.multiline? && allow_in_multiline_conditions?
Severity: Major
Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return if allowed_method_name?(dispatch_node.method_name)
    Severity: Major
    Found in lib/rubocop/cop/style/symbol_proc.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return if node.semantic_operator? && begin_node.parent
      Severity: Major
      Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return 'an expression'
        Severity: Major
        Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                    return if begin_node.chained?
          Severity: Major
          Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return if allow_if_method_has_argument?(node.send_node)
            Severity: Major
            Found in lib/rubocop/cop/style/symbol_proc.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return if node.block_type? && destructuring_block_argument?(arguments_node)
              Severity: Major
              Found in lib/rubocop/cop/style/symbol_proc.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return if allow_comments? && contains_comments?(node)
                Severity: Major
                Found in lib/rubocop/cop/style/symbol_proc.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return if ALLOWED_NODE_TYPES.include?(begin_node.parent&.type)
                  Severity: Major
                  Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                              return 'an interpolated expression' if interpolation?(begin_node)
                    Severity: Major
                    Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return if begin_node.parent&.if_type? && begin_node.parent&.ternary?
                      Severity: Major
                      Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return unless begin_node.parent.nil?
                        Severity: Major
                        Found in lib/rubocop/cop/style/redundant_parentheses.rb - About 30 mins to fix

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  def check_case(node)
                                    else_branch = node.else_branch
                                    return false unless else_branch
                                    return false unless break_statement?(else_branch)
                          
                          
                          Severity: Minor
                          Found in lib/rubocop/cop/lint/unreachable_loop.rb and 1 other location - About 30 mins to fix
                          lib/rubocop/cop/lint/unreachable_code.rb on lines 82..89

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            module Cop
                              module Layout
                                # Checks for a line break before the first element in a
                                # multi-line hash.
                                #
                          Severity: Minor
                          Found in lib/rubocop/cop/layout/first_hash_element_line_break.rb and 1 other location - About 30 mins to fix
                          lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb on lines 4..72

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  def check_case(node)
                                    else_branch = node.else_branch
                                    return false unless else_branch
                                    return false unless flow_expression?(else_branch)
                          
                          
                          Severity: Minor
                          Found in lib/rubocop/cop/lint/unreachable_code.rb and 1 other location - About 30 mins to fix
                          lib/rubocop/cop/lint/unreachable_loop.rb on lines 176..187

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  def on_class(node)
                                    return unless struct_constructor?(node.parent_class)
                          
                                    add_offense(node.parent_class) do |corrector|
                                      corrector.remove(range_with_surrounding_space(node.loc.keyword, newlines: false))
                          Severity: Minor
                          Found in lib/rubocop/cop/style/struct_inheritance.rb and 1 other location - About 30 mins to fix
                          lib/rubocop/cop/style/data_inheritance.rb on lines 36..43

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            module Cop
                              module Layout
                                # Ensures that each parameter in a multi-line method definition
                                # starts on a separate line.
                                #
                          lib/rubocop/cop/layout/first_hash_element_line_break.rb on lines 4..63

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                def report_offense(file, offense)
                                  output.printf(
                                    "# %<path>s:%<line>d:%<column>d: %<severity>s: %<message>s\n",
                                    path: cyan(smart_path(file)),
                                    line: offense.line,
                          Severity: Minor
                          Found in lib/rubocop/formatter/tap_formatter.rb and 1 other location - About 30 mins to fix
                          lib/rubocop/formatter/clang_style_formatter.rb on lines 17..30

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  def on_class(node)
                                    return unless data_define?(node.parent_class)
                          
                                    add_offense(node.parent_class) do |corrector|
                                      corrector.remove(range_with_surrounding_space(node.loc.keyword, newlines: false))
                          Severity: Minor
                          Found in lib/rubocop/cop/style/data_inheritance.rb and 1 other location - About 30 mins to fix
                          lib/rubocop/cop/style/struct_inheritance.rb on lines 33..40

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                def report_offense(file, offense)
                                  output.printf(
                                    "%<path>s:%<line>d:%<column>d: %<severity>s: %<message>s\n",
                                    path: cyan(smart_path(file)),
                                    line: offense.line,
                          Severity: Minor
                          Found in lib/rubocop/formatter/clang_style_formatter.rb and 1 other location - About 30 mins to fix
                          lib/rubocop/formatter/tap_formatter.rb on lines 46..59

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 32.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language