Showing 644 of 684 total issues
Method issue_offenses
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def issue_offenses(node, left, right, start_ok, end_ok)
Method check_space
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_space(space_begin_pos, space_end_pos, range, msg, node = nil)
Method check_right_brace
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_right_brace(node, inner, left_brace, right_brace, single_line)
Method correct_key_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def correct_key_value(corrector, delta, key, value, separator)
Method inspect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def inspect(node, block_argument_node, condition_node, return_value_node, range)
Method compact_offenses
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def compact_offenses(node, left, right, start_ok, end_ok)
Method empty_corrections
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def empty_corrections(processed_source, corrector, empty_config,
left_token, right_token)
Method wrap_contents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def wrap_contents(corrector, node, contents, char, delimiters)
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)
Method autocorrect_line
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def autocorrect_line(corrector, line_begin_pos, expr, column_delta,
taboo_ranges)
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]
- 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 each_inspected_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each_inspected_file(files)
files.reduce(true) do |all_passed, file|
offenses = process_file(file)
yield file
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def on_send(node)
return unless node.arguments.count == 2
return unless valid_method_name?(node)
actual_name = node.first_argument.value.to_s
- 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_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
- 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 aligned_with_assignment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def aligned_with_assignment(token, line_range)
token_line_indent = processed_source.line_indentation(token.line)
assignment_lines = relevant_assignment_lines(line_range)
relevant_line_number = assignment_lines[1]
- 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 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
- 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 extra_enabled_comments_with_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def extra_enabled_comments_with_names(extras:, names:)
each_directive do |directive|
next unless comment_only_line?(directive.line_number)
if directive.enabled_all?
- 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 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,
target_ruby_version: target_ruby_version(env),
- 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 start
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def start
@reader.read do |request|
if !request.key?(:method)
@routes.handle_method_missing(request)
elsif (route = @routes.for(request[:method]))
- 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 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)
- 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"