cloudfoundry/cloud_controller_ng

View on GitHub

Showing 2,660 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

                          Function 'porterStemmer' has too many statements (83). Maximum allowed is 30.
                          Open

                              var porterStemmer = function porterStemmer(w) {

                          enforce a maximum number of statements allowed in function blocks (max-statements)

                          The max-statements rule allows you to specify the maximum number of statements allowed in a function.

                          function foo() {
                            var bar = 1; // one statement
                            var baz = 2; // two statements
                            var qux = 3; // three statements
                          }

                          Rule Details

                          This rule enforces a maximum number of statements allowed in function blocks.

                          Options

                          This rule has a number or object option:

                          • "max" (default 10) enforces a maximum number of statements allows in function blocks

                          Deprecated: The object property maximum is deprecated; please use the object property max instead.

                          This rule has an object option:

                          • "ignoreTopLevelFunctions": true ignores top-level functions

                          max

                          Examples of incorrect code for this rule with the default { "max": 10 } option:

                          /*eslint max-statements: ["error", 10]*/
                          /*eslint-env es6*/
                          
                          function foo() {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                          
                            var foo11 = 11; // Too many.
                          }
                          
                          let foo = () => {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                          
                            var foo11 = 11; // Too many.
                          };

                          Examples of correct code for this rule with the default { "max": 10 } option:

                          /*eslint max-statements: ["error", 10]*/
                          /*eslint-env es6*/
                          
                          function foo() {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                            return function () {
                          
                              // The number of statements in the inner function does not count toward the
                              // statement maximum.
                          
                              return 42;
                            };
                          }
                          
                          let foo = () => {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                            return function () {
                          
                              // The number of statements in the inner function does not count toward the
                              // statement maximum.
                          
                              return 42;
                            };
                          }

                          ignoreTopLevelFunctions

                          Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

                          /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
                          
                          function foo() {
                            var foo1 = 1;
                            var foo2 = 2;
                            var foo3 = 3;
                            var foo4 = 4;
                            var foo5 = 5;
                            var foo6 = 6;
                            var foo7 = 7;
                            var foo8 = 8;
                            var foo9 = 9;
                            var foo10 = 10;
                            var foo11 = 11;
                          }

                          Related Rules

                          • [complexity](complexity.md)
                          • [max-depth](max-depth.md)
                          • [max-len](max-len.md)
                          • [max-nested-callbacks](max-nested-callbacks.md)
                          • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

                          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

                            Function has too many statements (81). Maximum allowed is 30.
                            Open

                            (function(){

                            enforce a maximum number of statements allowed in function blocks (max-statements)

                            The max-statements rule allows you to specify the maximum number of statements allowed in a function.

                            function foo() {
                              var bar = 1; // one statement
                              var baz = 2; // two statements
                              var qux = 3; // three statements
                            }

                            Rule Details

                            This rule enforces a maximum number of statements allowed in function blocks.

                            Options

                            This rule has a number or object option:

                            • "max" (default 10) enforces a maximum number of statements allows in function blocks

                            Deprecated: The object property maximum is deprecated; please use the object property max instead.

                            This rule has an object option:

                            • "ignoreTopLevelFunctions": true ignores top-level functions

                            max

                            Examples of incorrect code for this rule with the default { "max": 10 } option:

                            /*eslint max-statements: ["error", 10]*/
                            /*eslint-env es6*/
                            
                            function foo() {
                              var foo1 = 1;
                              var foo2 = 2;
                              var foo3 = 3;
                              var foo4 = 4;
                              var foo5 = 5;
                              var foo6 = 6;
                              var foo7 = 7;
                              var foo8 = 8;
                              var foo9 = 9;
                              var foo10 = 10;
                            
                              var foo11 = 11; // Too many.
                            }
                            
                            let foo = () => {
                              var foo1 = 1;
                              var foo2 = 2;
                              var foo3 = 3;
                              var foo4 = 4;
                              var foo5 = 5;
                              var foo6 = 6;
                              var foo7 = 7;
                              var foo8 = 8;
                              var foo9 = 9;
                              var foo10 = 10;
                            
                              var foo11 = 11; // Too many.
                            };

                            Examples of correct code for this rule with the default { "max": 10 } option:

                            /*eslint max-statements: ["error", 10]*/
                            /*eslint-env es6*/
                            
                            function foo() {
                              var foo1 = 1;
                              var foo2 = 2;
                              var foo3 = 3;
                              var foo4 = 4;
                              var foo5 = 5;
                              var foo6 = 6;
                              var foo7 = 7;
                              var foo8 = 8;
                              var foo9 = 9;
                              var foo10 = 10;
                              return function () {
                            
                                // The number of statements in the inner function does not count toward the
                                // statement maximum.
                            
                                return 42;
                              };
                            }
                            
                            let foo = () => {
                              var foo1 = 1;
                              var foo2 = 2;
                              var foo3 = 3;
                              var foo4 = 4;
                              var foo5 = 5;
                              var foo6 = 6;
                              var foo7 = 7;
                              var foo8 = 8;
                              var foo9 = 9;
                              var foo10 = 10;
                              return function () {
                            
                                // The number of statements in the inner function does not count toward the
                                // statement maximum.
                            
                                return 42;
                              };
                            }

                            ignoreTopLevelFunctions

                            Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

                            /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
                            
                            function foo() {
                              var foo1 = 1;
                              var foo2 = 2;
                              var foo3 = 3;
                              var foo4 = 4;
                              var foo5 = 5;
                              var foo6 = 6;
                              var foo7 = 7;
                              var foo8 = 8;
                              var foo9 = 9;
                              var foo10 = 10;
                              var foo11 = 11;
                            }

                            Related Rules

                            • [complexity](complexity.md)
                            • [max-depth](max-depth.md)
                            • [max-len](max-len.md)
                            • [max-nested-callbacks](max-nested-callbacks.md)
                            • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

                            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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language