Showing 11 of 11 total issues
Method doff_and_don
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def doff_and_don(&block)
return puts "[#{gem_name}] Skipped (not loaded on #{RUBY_VERSION})" unless gem_path
puts "[#{gem_name}] Doffing #{gem_path}" if verbose
Dir.mktmpdir do |tmp_dir|
- 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 print
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def print
string = ""
if all.empty?
string << nothing
elsif starters.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 initialize
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def initialize(**options)
@look_for_regex = options[:look_for_regex]
# find: Find gems containing specific strings in code
# bench: Find gems that can probably be benched (require: false) in the Gemfile
@check_type = @look_for_regex ? :find : :bench
- 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 print
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def print
string = ""
if all.empty?
string << nothing
elsif starters.empty?
Method doff_and_don
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def doff_and_don(&block)
return puts "[#{gem_name}] Skipped (not loaded on #{RUBY_VERSION})" unless gem_path
puts "[#{gem_name}] Doffing #{gem_path}" if verbose
Dir.mktmpdir do |tmp_dir|
Method initialize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(**options)
@look_for_regex = options[:look_for_regex]
# find: Find gems containing specific strings in code
# bench: Find gems that can probably be benched (require: false) in the Gemfile
@check_type = @look_for_regex ? :find : :bench
Method compare_gemfile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def compare_gemfile
benchers.each do |player|
scout.gemfile_lines.each do |line|
found = (line =~ player.gemfile_regex)
next unless found
- 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 initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, version, version_type, valid, relevant_lines, index, tokenized_line = nil)
Method create_tempfile_copy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_tempfile_copy(orig_file_path, tmp_dir, basename, debug_info, &block)
Method initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(all_lines, line, index)
@line = line.strip
@is_gem = self.line.match(GEM_REGEX)
if is_gem
@all_lines = all_lines
- 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 set_starter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_starter(file_path, line_match: nil)
return false if file_path =~ exclude_file_pattern
# Some gems may have zero files to check, as they may be using gem as a
# delivery system for shell scripts! As such we need to check which
- 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"