Method freshen_dispatches!
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def freshen_dispatches!
umlaut_request.dispatched_services.each do | ds |
# go through dispatched_services and set still in progress but too long to failed temporary
if ( (ds.status == DispatchedService::InProgress ||
ds.status == DispatchedService::Queued ) &&
- 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 dispatch_background!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def dispatch_background!
# Now we do some crazy magic, start a Thread to run our background
# services. We are NOT going to wait for this thread to join,
# we're going to let it keep doing it's thing in the background after
# we return a response to the browser
- 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 gather_services
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gather_services
@service_definitions_flat.each_pair do | unique_id, svc_def |
next if svc_def.nil?
svc_def['service_id'] = unique_id
- 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"