Showing 8 of 8 total issues
Method prepare
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def prepare(loading=false)
phen_defined_contexts.reverse.each do |context|
if !context.forgotten && (!context.persistent || !Rails.configuration.cache_classes)
while phen_context_active?(context) do
phen_deactivate_context(context)
- 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_files
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def load_files(path)
scan_dir(path) do |filepath, entry|
if File.file?(filepath) && entry.match(/.*\.rb/)
load filepath
elsif File.directory?(filepath)
- 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 find_all_contexts
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_all_contexts(name,contexts, prefix=nil, partial=false, details={}, key=nil, locals=[])
Method find_all
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
Method find_all_inactive
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_all_inactive(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
Method autoload_paths
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def autoload_paths(path,paths=[])
scan_dir(path) do |filepath, entry|
if File.directory?(filepath)
if (filepath.match(/.*\/controllers/) ||
filepath.match(/.*\/models/) ||
- 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 find_all_contexts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_all_contexts(name,contexts, prefix=nil, partial=false, details={}, key=nil, locals=[])
contexts.each do |context|
context_path = context.to_path
if !context_path.nil?
path = Path.build(name, "#{context_path}/views/#{prefix}", partial)
- 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 find
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find(*args)
templates = find_all(*args)
if templates.empty?
if find_all_inactive(*args).empty?
raise(MissingTemplate.new(self, *args))
- 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"