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
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
Class SafeNavigation
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class SafeNavigation < Base
include NilMethods
include RangeHelp
extend AutoCorrector
Class Next
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Next < Base
include ConfigurableEnforcedStyle
include MinBodyLength
include RangeHelp
extend AutoCorrector
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
Class CommentConfig
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class CommentConfig
# @api private
REDUNDANT_DISABLE = 'Lint/RedundantCopDisableDirective'
# @api private
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.'
Class SpaceAroundOperators
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class SpaceAroundOperators < Base
include PrecedingFollowingAlignment
include RangeHelp
include RationalLiteral
extend AutoCorrector
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.
#
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
- Read upRead up
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
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.'
Class RedundantCopDisableDirective
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class RedundantCopDisableDirective < Base
include RangeHelp
extend AutoCorrector
COP_NAME = 'Lint/RedundantCopDisableDirective'
Class Offense
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Offense
include Comparable
# @api private
COMPARISON_ATTRIBUTES = %i[line column cop_name
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|
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.
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
- Read upRead up
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)
- Read upRead up
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)
- Read upRead up
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)
- Read upRead up
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"