cloudfoundry/cloud_controller_ng

View on GitHub
spec/unit/controllers/base/model_controller_spec.rb

Summary

Maintainability
C
1 day
Test Coverage

File model_controller_spec.rb has 687 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'spec_helper'
require 'stringio'

module VCAP::CloudController
  RSpec.describe RestController::ModelController do
Severity: Major
Found in spec/unit/controllers/base/model_controller_spec.rb - About 1 day to fix

    Method run_delayed_job has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

                def run_delayed_job
                  Delayed::Worker.new.work_off if Delayed::Job.last
                end
    Severity: Minor
    Found in spec/unit/controllers/base/model_controller_spec.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