Showing 41 of 41 total issues
Method dispatch_method
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def dispatch_method(subject,
subject_class,
method_name,
arguments,
keyword_arguments,
Method bind
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def bind
unless class_instance_method_defined(subject_class, original_method_alias_name)
unless class_instance_method_defined(subject_class, :method_missing)
@placeholder_method_defined = true
subject_class.class_eval do
- 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(subject, subject_class, method_name, args, kwargs, block)
Method bind
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def bind
unless class_instance_method_defined(subject_class, original_method_alias_name, false)
unless class_instance_method_defined(subject_class, :singleton_method_added, false)
@placeholder_method_defined = true
subject_class.class_eval do
- 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 record_call
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def record_call(subject, method_name, arguments, keyword_arguments, block)
Method add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(subject, method_name, arguments, keyword_arguments, block)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(double_injection, subject, args, kwargs, block)
Method call
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def call(definition, method_name, args, kwargs, handler)
Method call_original_method
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call_original_method
if subject_has_original_method?
if KeywordArguments.fully_supported?
subject.__send__(original_method_alias_name, *args, **kwargs, &block)
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 load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load
return if @loaded
hook
if RR.debug?
puts "Loaded adapter: #{name}"
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(double_definition_create, &block) #:nodoc:
@double_definition_create = double_definition_create
BlankSlate.call(respond_to?(:class) ? self.class : __blank_slated_class)
if block_given?
- 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
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return matches.matching_doubles.first # This will raise a TimesCalledError
Avoid too many return
statements within this method. Open
return false unless value == other_value
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false unless found
Avoid too many return
statements within this method. Open
return nil
Method verify_ordered_double
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def verify_ordered_double(double)
unless double.terminal?
raise RR::Errors.build_error(:DoubleOrderError,
"Ordered Doubles cannot have a NonTerminal TimesCalledExpectation")
end
- 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 call_implementation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call_implementation
if implementation_is_original_method?
space.record_call(subject, method_name, args, kwargs, block)
double.method_call(args, kwargs)
call_original_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 call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call(klass)
klass.instance_eval do
instance_methods.each do |unformatted_method_name|
method_name = unformatted_method_name.to_s
unless method_name =~ /^_/ || Space.blank_slate_whitelist.any? {|whitelisted_method_name| method_name == whitelisted_method_name}
- 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"