Method run
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(args = ARGV)
@options, paths = Options.new.parse(args)
@env = Environment.new(@options, @config_store, paths)
profile_if_needed do
Method profile_if_needed
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def profile_if_needed
return yield unless @options[:profile]
return STATUS_ERROR unless require_gem('stackprof')
- 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 parallel_by_default!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parallel_by_default!
# See https://github.com/rubocop/rubocop/pull/4537 for JRuby and Windows constraints.
return if RUBY_ENGINE != 'ruby' || RuboCop::Platform.windows?
if (@options.keys - DEFAULT_PARALLEL_OPTIONS).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"