lib/spider-gazelle/spider.rb
Method load_gazelles
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def load_gazelles(mode, count, options)
defer = @thread.defer
@loading[mode] = defer
if mode == :inline
Method load_gazelle_thread
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def load_gazelle_thread(reactor, thread, mode, options, loading)
Method ready
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def ready
load_promise = load_applications
load_promise.then do
# Check a shutdown request didn't occur as we were loading
if @running
- 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_applications
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def load_applications
loaded = []
@logger.info "Environment: #{ENV['RACK_ENV']} on #{RUBY_ENGINE || 'ruby'} #{RUBY_VERSION}"
# Load the different types of gazelles required
- 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"