cloudfoundry/cloud_controller_ng

View on GitHub

Showing 556 of 2,660 total issues

File validators_spec.rb has 605 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'spec_helper'
require 'lightweight_spec_helper'
require 'messages/validators'
require 'messages/base_message'
require 'messages/empty_lifecycle_data_message'
Severity: Major
Found in spec/unit/messages/validators_spec.rb - About 1 day to fix

    File app_usage_event_repository_spec.rb has 592 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'spec_helper'
    require 'repositories/app_usage_event_repository'
    
    module VCAP::CloudController
      module Repositories
    Severity: Major
    Found in spec/unit/repositories/app_usage_event_repository_spec.rb - About 1 day to fix

      File seeds_spec.rb has 583 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'spec_helper'
      require 'cloud_controller/seeds'
      
      module VCAP::CloudController
        RSpec.describe VCAP::CloudController::Seeds do
      Severity: Major
      Found in spec/unit/lib/cloud_controller/seeds_spec.rb - About 1 day to fix

        File encryptor_spec.rb has 572 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'spec_helper'
        
        module VCAP::CloudController
          RSpec.describe Encryptor do
            let(:salt) { Encryptor.generate_salt }
        Severity: Major
        Found in spec/unit/lib/cloud_controller/encryptor_spec.rb - About 1 day to fix

          File 20230725110800_restructure_index_for_improved_pagination_order.rb has 566 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          Sequel.migration do
            index_migration_data = [
              # CREATED AT
              {
                table: :organizations,

            File staging_action_builder_spec.rb has 555 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'spec_helper'
            
            module VCAP::CloudController
              module Diego
                module Buildpack

              File config_spec.rb has 554 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'spec_helper'
              
              module VCAP::CloudController
                RSpec.describe Config do
                  let(:test_config_hash) do
              Severity: Major
              Found in spec/unit/lib/cloud_controller/config_spec.rb - About 1 day to fix

                File updater_spec.rb has 553 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'spec_helper'
                require 'cloud_controller/deployment_updater/updater'
                
                module VCAP::CloudController
                  RSpec.describe DeploymentUpdater::Updater do
                Severity: Major
                Found in spec/unit/lib/cloud_controller/deployment_updater/updater_spec.rb - About 1 day to fix

                  File process_update_message_spec.rb has 542 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'spec_helper'
                  require 'messages/process_update_message'
                  require 'messages/metadata_base_message'
                  
                  module VCAP::CloudController
                  Severity: Major
                  Found in spec/unit/messages/process_update_message_spec.rb - About 1 day to fix

                    File broker_api_v2.15_spec.rb has 528 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'spec_helper'
                    
                    RSpec.describe 'Service Broker API integration' do
                      describe 'v2.15' do
                        include VCAP::CloudController::BrokerApiHelper
                    Severity: Major
                    Found in spec/acceptance/broker_api_compatibility/broker_api_v2.15_spec.rb - About 1 day to fix

                      File dashboard_client_manager_spec.rb has 525 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require 'spec_helper'
                      
                      module VCAP::Services::SSO
                        RSpec.describe DashboardClientManager do
                          let(:client_manager) { double('client_manager') }
                      Severity: Major
                      Found in spec/unit/lib/services/sso/dashboard_client_manager_spec.rb - About 1 day to fix

                        File syslog_drain_urls_controller_spec.rb has 505 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require 'spec_helper'
                        
                        ## NOTICE: Prefer request specs over controller specs as per ADR #0003 ##
                        
                        module VCAP::CloudController
                        Severity: Major
                        Found in spec/unit/controllers/internal/syslog_drain_urls_controller_spec.rb - About 1 day to fix

                          File buildpacks_spec.rb has 486 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'spec_helper'
                          require 'messages/buildpack_upload_message'
                          require 'request_spec_shared_examples'
                          
                          RSpec.describe 'buildpacks' do
                          Severity: Minor
                          Found in spec/request/buildpacks_spec.rb - About 7 hrs to fix

                            File stagings_controller_spec.rb has 475 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            require 'spec_helper'
                            
                            ## NOTICE: Prefer request specs over controller specs as per ADR #0003 ##
                            
                            module VCAP::CloudController
                            Severity: Minor
                            Found in spec/unit/controllers/runtime/stagings_controller_spec.rb - About 7 hrs to fix

                              File isolation_segments_spec.rb has 474 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              require 'spec_helper'
                              require 'isolation_segment_assign'
                              require 'request_spec_shared_examples'
                              
                              RSpec.describe 'IsolationSegmentModels' do
                              Severity: Minor
                              Found in spec/request/isolation_segments_spec.rb - About 7 hrs to fix

                                File process_model.rb has 454 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                require 'cloud_controller/process_observer'
                                require 'cloud_controller/database_uri_generator'
                                require 'cloud_controller/errors/application_missing'
                                require 'repositories/app_usage_event_repository'
                                require 'presenters/v3/cache_key_presenter'
                                Severity: Minor
                                Found in app/models/runtime/process_model.rb - About 6 hrs to fix

                                  File uaa_token_decoder_spec.rb has 452 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  require 'spec_helper'
                                  require 'cloud_controller/uaa/uaa_token_decoder'
                                  
                                  module VCAP::CloudController
                                    RSpec.describe UaaTokenDecoder do
                                  Severity: Minor
                                  Found in spec/unit/lib/uaa/uaa_token_decoder_spec.rb - About 6 hrs to fix

                                    File space_diff_manifest_spec.rb has 450 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    require 'spec_helper'
                                    require 'actions/space_diff_manifest'
                                    
                                    module VCAP::CloudController
                                      RSpec.describe SpaceDiffManifest do
                                    Severity: Minor
                                    Found in spec/unit/actions/space_diff_manifest_spec.rb - About 6 hrs to fix

                                      Method update has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def self.update(quota, message)
                                            if log_rate_limit(message) != QuotaDefinition::UNLIMITED
                                              orgs = orgs_with_unlimited_processes(quota)
                                              unlimited_processes_exist_error!(orgs) if orgs.any?
                                            end
                                      Severity: Minor
                                      Found in app/actions/organization_quotas_update.rb - About 6 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

                                      Function stemmer has 166 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        lunr.stemmer = (function(){
                                          var step2list = {
                                                "ational" : "ate",
                                                "tional" : "tion",
                                                "enci" : "ence",
                                      Severity: Major
                                      Found in docs/v3/source/javascripts/lib/_lunr.js - About 6 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language