cloudfoundry/cloud_controller_ng

View on GitHub

Showing 570 of 2,679 total issues

Method to_hash has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def to_hash
      {
        guid: usage_event.guid,
        created_at: usage_event.created_at,
        updated_at: usage_event.created_at,
Severity: Minor
Found in app/presenters/v3/service_usage_event_presenter.rb - About 1 hr to fix

    Method advanced_filtering has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def advanced_filtering(message, dataset, klass)
            advanced_filters = {}
            advanced_filters['created_at'] = message.created_ats if message.requested?(:created_ats)
            advanced_filters['updated_at'] = message.updated_ats if message.requested?(:updated_ats)
    
    
    Severity: Minor
    Found in app/fetchers/base_list_fetcher.rb - About 1 hr to fix

      Method save_staging_result has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def save_staging_result(payload)
                lifecycle_data = payload[:result][:lifecycle_metadata]
                buildpack_key  = nil
                buildpack_url  = nil
      
      
      Severity: Minor
      Found in lib/cloud_controller/diego/buildpack/staging_completion_handler.rb - About 1 hr to fix

        Method unique_blobstores has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def unique_blobstores
                  return @unique_blobstores if @unique_blobstores.present?
        
                  full_list = [
                    {
        Severity: Minor
        Found in app/jobs/runtime/orphaned_blobs_cleanup.rb - About 1 hr to fix

          Method decorate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def decorate(hash, service_instances)
                managed_service_instances = service_instances.select(&:managed_instance?)
                return hash if managed_service_instances.empty?
          
                offerings = Service.
          Severity: Minor
          Found in app/decorators/field_service_instance_offering_decorator.rb - About 1 hr to fix

            Method update has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def update(resource, labels, label_klass, destroy_nil: true)
                    starting_label_count_for_resource = label_klass.where(resource_guid: resource.guid).count
            
                    labels ||= {}
                    labels.each do |label_key, label_value|
            Severity: Minor
            Found in app/actions/labels_update.rb - About 1 hr to fix

              Method add_organization_role has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def add_organization_role(user_guid, relationship, org_guid)
                    organization = Organization.first(guid: org_guid)
                    user = User.first(guid: user_guid)
                    user.username = @uaa_username_lookup_client.usernames_for_ids([user.guid])[user.guid] || ''
              
              
              Severity: Minor
              Found in app/controllers/runtime/users_controller.rb - About 1 hr to fix

                Method upload_buildpack has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def upload_buildpack(buildpack, bits_file_path, new_filename)
                      return false if buildpack.locked
                
                      sha256 = Digester.new(algorithm: OpenSSL::Digest::SHA256).digest_path(bits_file_path)
                      new_key = "#{buildpack.guid}_#{sha256}"
                Severity: Minor
                Found in lib/cloud_controller/upload_buildpack.rb - About 1 hr to fix

                  Method filter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def filter(message, app, space_guids, dataset)
                          if message.requested?(:current) && app
                            dataset = dataset.extension(:null_dataset)
                            return dataset.nullify unless app.droplet
                  
                  
                  Severity: Minor
                  Found in app/fetchers/droplet_list_fetcher.rb - About 1 hr to fix

                    Method tables_for_vcap_relations_spec has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def tables_for_vcap_relations_spec
                        db.create_table :owners do
                          primary_key :id
                          String :guid, null: false, index: true
                        end
                    Severity: Minor
                    Found in spec/support/bootstrap/fake_model_tables.rb - About 1 hr to fix

                      Method update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def update(app, message, lifecycle)
                            validate_not_changing_lifecycle_type!(app, lifecycle)
                      
                            app.db.transaction do
                              app.lock!
                      Severity: Minor
                      Found in app/actions/app_update.rb - About 1 hr to fix

                        Method build_completed has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def build_completed(staging_guid)
                              staging_response = read_body
                              build = BuildModel.find(guid: staging_guid)
                              raise CloudController::Errors::ApiError.new_from_details('ResourceNotFound', 'Build not found') if build.nil?
                        
                        
                        Severity: Minor
                        Found in app/controllers/internal/staging_completion_controller.rb - About 1 hr to fix

                          Method validate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def validate(record)
                              unless record.rules.is_a?(Array)
                                record.errors.add :rules, 'must be an array'
                                return
                              end
                          Severity: Minor
                          Found in app/messages/validators/security_group_rule_validator.rb - About 1 hr to fix

                            Method validate_destination_contents has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def validate_destination_contents
                                  app_to_ports_hash = {}
                            
                                  destinations.each_with_index do |dst, index|
                                    unless dst.is_a?(Hash)
                            Severity: Minor
                            Found in app/messages/route_update_destinations_message.rb - About 1 hr to fix

                              Method define_message has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    def define_message(type)
                                      attrs   = Array(attributes)
                                      to_one  = @to_one_relationships ||= []
                                      to_many = @to_many_relationships ||= []
                              
                              
                              Severity: Minor
                              Found in lib/cloud_controller/rest_controller/messages.rb - About 1 hr to fix

                                Method action has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        def action
                                          download_droplet_action = ::Diego::Bbs::Models::DownloadAction.new(
                                            from: lifecycle_data[:droplet_uri],
                                            to: '.',
                                            cache_key: '',
                                Severity: Minor
                                Found in lib/cloud_controller/diego/buildpack/task_action_builder.rb - About 1 hr to fix

                                  Method build_api_error_matcher has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  def build_api_error_matcher(error_class, api_error_name, *api_error_args)
                                    supports_block_expectations
                                  
                                    match do |actual|
                                      actual.call
                                  Severity: Minor
                                  Found in spec/support/matchers/raise_api_error.rb - About 1 hr to fix

                                    Method update has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def update(service_instance, message)
                                          logger = Steno.logger('cc.action.user_provided_service_instance_update')
                                    
                                          updates = {}
                                          updates[:name] = message.name if message.requested?(:name)
                                    Severity: Minor
                                    Found in app/actions/service_instance_update_user_provided.rb - About 1 hr to fix

                                      Method purge has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          def purge(service_instance)
                                            logger.info("purging service instance #{service_instance.guid}")
                                      
                                            service_instance.db.transaction do
                                              service_instance.routes.each do |route|
                                      Severity: Minor
                                      Found in app/actions/service_instance_purge.rb - About 1 hr to fix

                                        Function _createWidget has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            _createWidget: function( options, element ) {
                                              element = $( element || this.defaultElement || this )[ 0 ];
                                              this.element = $( element );
                                              this.uuid = widget_uuid++;
                                              this.eventNamespace = "." + this.widgetName + this.uuid;
                                        Severity: Minor
                                        Found in docs/v3/source/javascripts/lib/_jquery_ui.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language