Showing 647 of 687 total issues
Avoid too many return
statements within this method. Open
return 'an expression'
Avoid too many return
statements within this method. Open
return if node.multiline? && allow_in_multiline_conditions?
Avoid too many return
statements within this method. Open
return if allow_if_method_has_argument?(node.send_node)
Avoid too many return
statements within this method. Open
return if allow_comments? && contains_comments?(node)
Avoid too many return
statements within this method. Open
return if allowed_method_name?(dispatch_node.method_name)
Avoid too many return
statements within this method. Open
return if node.block_type? && destructuring_block_argument?(arguments_node)
Avoid too many return
statements within this method. Open
return if begin_node.parent&.if_type? && begin_node.parent.ternary?
Avoid too many return
statements within this method. Open
return if node.semantic_operator? && begin_node.parent
Avoid too many return
statements within this method. Open
return true if delimiter?(node, escaped[0])
Avoid too many return
statements within this method. Open
return 'an interpolated expression' if interpolation?(begin_node)
Avoid too many return
statements within this method. Open
return if begin_node.chained?
Avoid too many return
statements within this method. Open
return unless begin_node.parent.nil?
Avoid too many return
statements within this method. Open
return if ALLOWED_NODE_TYPES.include?(begin_node.parent&.type)
Avoid too many return
statements within this method. Open
return if exist_argument_between_heredoc_end_and_closing_parentheses?(node)
Method cleanup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.cleanup(config_store, verbose, cache_root = nil)
return if inhibit_cleanup # OPTIMIZE: For faster testing
cache_root ||= cache_root(config_store)
return unless File.exist?(cache_root)
- 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 references
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def references(cop, see_objects) # rubocop:disable Metrics/AbcSize
cop_config = config.for_cop(cop)
urls = RuboCop::Cop::MessageAnnotator.new(config, cop.name, cop_config, {}).urls
return '' if urls.empty? && see_objects.empty?
- 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 find_target_line
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_target_line
configuration_entries.find.with_index do |line, index|
next unless cop_name_line?(line)
return index if badge.to_s < line
- 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_send
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_send(node)
return unless cop_class_name
return unless (config_name_node = cop_config_accessor?(node))
return if always_allowed?(config_name_node)
return if configuration_key_defined?(config_name_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"
Further reading
Method move_pos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def move_pos(src, pos, step, condition, regexp)
offset = step == -1 ? -1 : 0
pos += step while condition && regexp.match?(src[pos + offset])
pos.negative? ? 0 : pos
end
- 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 check_alignment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_alignment(items, base_column = nil)
base_column ||= display_column(items.first.source_range) unless items.empty?
each_bad_alignment(items, base_column) do |current|
expr = current.source_range
- 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"