rubocop-hq/rubocop

View on GitHub

Showing 624 of 666 total issues

Avoid too many return statements within this method.
Open

            return if super_call_without_arguments?(node)

    Avoid too many return statements within this method.
    Open

              return true if delimiter?(node, escaped[0])
    Severity: Major
    Found in lib/rubocop/cop/style/redundant_string_escape.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 unless begin_node.parent.nil?
        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 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 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 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.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 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 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 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 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 exist_argument_between_heredoc_end_and_closing_parentheses?(node)
                              Severity: Major
                              Found in lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb - About 30 mins to fix

                                Method summary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def summary
                                          if @correction_count.positive?
                                            if @correctable_count.positive?
                                              "#{files} inspected, #{offenses} detected, #{corrections} corrected, " \
                                                "#{correctable}"
                                Severity: Minor
                                Found in lib/rubocop/formatter/simple_text_formatter.rb - About 25 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 iterate_until_no_changes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def iterate_until_no_changes(source, offenses_by_iteration)
                                      # Keep track of the state of the source. If a cop modifies the source
                                      # and another cop undoes it producing identical source we have an
                                      # infinite loop.
                                      @processed_sources = []
                                Severity: Minor
                                Found in lib/rubocop/runner.rb - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def on_send(node)
                                          return if node.receiver
                                          return unless (argument = node.arguments[1])
                                          return unless argument.str_type? && argument.value.empty?
                                
                                
                                Severity: Minor
                                Found in lib/rubocop/cop/internal_affairs/create_empty_file.rb - About 25 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 move_pos_str has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                      def move_pos_str(src, pos, step, condition, needle)
                                        size = needle.length
                                        offset = step == -1 ? -size : 0
                                        pos += size * step while condition && src[pos + offset, size] == needle
                                        pos.negative? ? 0 : pos
                                Severity: Minor
                                Found in lib/rubocop/cop/mixin/range_help.rb - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        def on_send(node)
                                          return unless gem_declaration?(node)
                                          return if ignored_gem?(node)
                                          return if commented_any_descendant?(node)
                                          return if cop_config[CHECKED_OPTIONS_CONFIG].any? && !checked_options_present?(node)
                                Severity: Minor
                                Found in lib/rubocop/cop/bundler/gem_comment.rb - About 25 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