Method safe_load
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def safe_load(file, mtime=nil)
reload = mtime && mtime > mtimes[file]
logger.debug "Reloading #{relativize_path(file)}" if reload
- 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
File loader.rb
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'pathname'
module Spontaneous
class Loader
attr_reader :use_reloader, :load_paths
Method load_classes_with_requirements
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def load_classes_with_requirements(klasses)
klasses.uniq!
while klasses.size > 0
# Note size to make sure things are loading
- 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 safe_load
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def safe_load(file, mtime=nil)
reload = mtime && mtime > mtimes[file]
logger.debug "Reloading #{relativize_path(file)}" if reload
Method reload!
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reload!
changed_files = []
rotation do |file, mtime|
# Retrive the last modified time
new_file = mtimes[file].nil?
Method load_classes_with_requirements
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_classes_with_requirements(klasses)
klasses.uniq!
while klasses.size > 0
# Note size to make sure things are loading
Method reload!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reload!
rotation do |file, mtime|
# Retrive the last modified time
new_file = mtimes[file].nil?
previous_mtime = mtimes[file] ||= mtime
- 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 reload!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reload!
changed_files = []
rotation do |file, mtime|
# Retrive the last modified time
new_file = mtimes[file].nil?
- 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 safe_stat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def safe_stat(file)
return unless file
stat = ::File.stat(file)
return file, stat if stat.file?
rescue Errno::ENOENT, Errno::ENOTDIR
- 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"