Showing 105 of 107 total issues
Method process_item
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_item(items, index, &block)
return unless (item = items[index])
option, argument = extract_option(item) if item.start_with?('-')
Method start
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.start(target = nil, options = {})
return if Pry::Env['DISABLE_PRY']
if Pry::Env['FAIL_PRY']
raise 'You have FAIL_PRY set to true, which results in Pry calls failing'
end
Method parse_options
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_options(args = ARGV)
unless options
raise NoOptionsError,
"No command line options defined! Use Pry::CLI.add_options to " \
"add command line options."
Method handle_read_errors
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_read_errors
should_retry = true
exception_count = 0
begin
Method search_hash
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def search_hash(search, hash)
matching = {}
hash.each_pair do |key, value|
next unless key.is_a?(String)
- 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 blocking_flag_for_editor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def blocking_flag_for_editor(blocking)
case editor_name
when /^emacsclient/
'--no-wait' unless blocking
when /^[gm]vim/
- 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 read
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read
@indent.reset if pry.eval_string.empty?
current_prompt = pry.select_prompt
indentation = pry.config.auto_indent ? @indent.current_prefix : ''
- 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 control_d_handler=
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def control_d_handler=(value)
proxy_proc =
if value.arity == 2
Pry::Warning.warn(
"control_d_handler's arity of 2 parameters was deprecated " \
- 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 track_module_nesting
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def track_module_nesting(token, kind)
if kind == :keyword && %w[class module].include?(token)
@module_nesting << [token, nil]
@awaiting_class = true
elsif @awaiting_class
- 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 tokenize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def tokenize(val)
val = interpolate_string(val) if command_options[:interpolate]
self.class.command_regex =~ val
- 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 parse!
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse!(items = ARGV, &block)
if items.empty? && @callbacks[:empty]
@callbacks[:empty].each { |cb| cb.call(self) }
return items
end
Method from_binding
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def from_binding(binding)
meth_name = binding.eval('::Kernel.__method__')
if [:__script__, nil].include?(meth_name)
nil
else
Method recurse_namespace
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def recurse_namespace(klass, done = {}, &block)
return if !klass.is_a?(Module) || done[klass]
done[klass] = true
- 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 process
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process
state.old_stack ||= []
if arg_string.strip == "-"
unless state.old_stack.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 normal_method?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def normal_method?(method, binding)
if method && method.source_file && method.source_range
if binding.respond_to?(:source_location)
binding_file, binding_line = binding.source_location
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 process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process
meth = method_object
aliases = meth.aliases
output.puts(unindent(<<-OUTPUT))
- 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 signature
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def signature
if respond_to?(:parameters)
args = parameters.inject([]) do |args_array, (arg_type, name)|
name ||= (arg_type == :block ? 'block' : "arg#{args_array.size + 1}")
args_array.push(
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(slop, short, long, description, config = {}, &block)
Method view_clip
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.view_clip(obj, options = {})
max = options.fetch :max_length, 60
id = options.fetch :id, false
if obj.is_a?(Module) && obj.name.to_s != "" && obj.name.to_s.length <= max
obj.name.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 read_line
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read_line(current_prompt)
handle_read_errors do
if coolline_available?
input.completion_proc = proc do |cool|
completions = @pry.complete cool.completed_word
- 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"