Showing 6 of 6 total issues
Class Call
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Call < Base
# Mocha methods will only be processed if `--mocha` flag was given,
# i.e. `mocha` argument in constructor is true.
MOCHA_METHODS = %i[
expects
Class Call
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Call < Base
attr_reader :original
def initialize(exp)
assert_sexp_type(:call, exp)
Class Iter
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Iter < Base
def initialize(sexp, rails, mocha)
super(rails, mocha)
@exp = Model::Iter.new(sexp)
sexp.clear
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(receiver, any_instance, message, with, returns, count)
Method expect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def expect(target, eager, phase, matcher, any_instance)
Method to_rspec_exp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def to_rspec_exp
stub_chain = s(:call, nil, :receive, @message)
unless @with.nil?
stub_chain = s(:call, stub_chain, :with, @with)
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"