Showing 687 of 687 total issues
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 autocorrect_line
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def autocorrect_line(corrector, line_begin_pos, expr, column_delta,
taboo_ranges)
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 wrap_contents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def wrap_contents(corrector, node, contents, char, delimiters)
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 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 excludes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def excludes(offending_files, cop_name, parent)
# Exclude properties in .rubocop_todo.yml override default ones, as well as any custom
# excludes in .rubocop.yml, so in order to retain those excludes we must copy them.
# There can be multiple .rubocop.yml files in subdirectories, but we just look at the
# current working directory.
- 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 detected_styles_for_column
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def detected_styles_for_column(column, left_parenthesis, left_brace)
styles = []
if column == (left_brace.source_line =~ /\S/)
styles << :consistent
styles << :special_inside_parentheses unless left_parenthesis
- 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 reposition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def reposition(src, pos, step, include_newlines: false)
offset = step == -1 ? -1 : 0
pos += step while SINGLE_SPACE_REGEXP.match?(src[pos + offset]) ||
(include_newlines && src[pos + offset] == "\n")
pos.negative? ? 0 : pos
- 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 check_empty_lines_special
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_empty_lines_special(body, first_line, last_line)
return unless body
if namespace?(body, with_one_child: true)
check_both(:no_empty_lines, first_line, last_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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run(paths)
target_files = find_target_files(paths)
if @options[:list_target_files]
list_files(target_files)
else
- 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"
Further reading
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 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 merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def merge(base_hash, derived_hash, **opts)
result = base_hash.merge(derived_hash)
keys_appearing_in_both = base_hash.keys & derived_hash.keys
keys_appearing_in_both.each do |key|
if opts[:unset_nil] && derived_hash[key].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
Method output_cop_param_comments
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def output_cop_param_comments(output_buffer, params, default_cfg)
config_params = params.reject { |p| p.start_with?('Supported') }
output_buffer.puts("# Configuration parameters: #{config_params.join(', ')}.")
params.each do |param|
- 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_case
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def on_case(node)
node.when_branches.each do |when_node|
next if when_node.body
next if cop_config['AllowComments'] && contains_comments?(when_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 examples
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def examples(example_objects, cop)
return '' if example_objects.none?
example_objects.each_with_object(cop_subsection('Examples', cop).dup) do |example, content|
content << "\n" unless content.end_with?("\n\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 obsoletions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def obsoletions
rules.map do |rule|
next unless rule.violated?
if rule.warning?
- 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"