team-umlaut/umlaut

View on GitHub
app/models/collection.rb

Summary

Maintainability
A
3 hrs
Test Coverage

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 ) &&
Severity: Minor
Found in app/models/collection.rb - About 2 hrs to fix

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
Severity: Minor
Found in app/models/collection.rb - About 1 hr to fix

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
Severity: Minor
Found in app/models/collection.rb - About 25 mins to fix

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

There are no issues that match your filters.

Category
Status