app/controllers/resolve_controller.rb
Method should_skip_menu
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
def should_skip_menu
# From usabilty test, do NOT skip if coming from A-Z list/journal lookup.
# First, is it over-ridden in url?
if ( params['umlaut.skip_resolve_menu'] == 'false')
return 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 should_skip_menu
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def should_skip_menu
# From usabilty test, do NOT skip if coming from A-Z list/journal lookup.
# First, is it over-ridden in url?
if ( params['umlaut.skip_resolve_menu'] == 'false')
return nil
Method init_processing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def init_processing
# intentionally trigger creation of session if it didn't already exist
# because we need to track session ID for caching. Can't find any
# way to force session creation without setting a value in session,
# so we do this weird one.
- 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"