Showing 630 of 1,221 total issues

Method subscribe has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def subscribe(arn, endpoint, protocol)
          response = Excon::Response.new

          unless topic = self.data[:topics][arn]
            response.status = 400
Severity: Minor
Found in lib/fog/aws/requests/sns/subscribe.rb - About 1 hr to fix

    Method list_attached_user_policies has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def list_attached_user_policies(user_name, options={})
              unless self.data[:users].key?(user_name)
                raise Fog::AWS::IAM::NotFound.new("The user with name #{user_name} cannot be found.")
              end
    
    
    Severity: Minor
    Found in lib/fog/aws/requests/iam/list_attached_user_policies.rb - About 1 hr to fix

      Method list_roles has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def list_roles(options={})
                limit  = options['MaxItems']
                marker = options['Marker']
      
                if limit
      Severity: Minor
      Found in lib/fog/aws/requests/iam/list_roles.rb - About 1 hr to fix

        Method signature_v2 has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def signature_v2(params, expires)
                  headers = params[:headers] || {}
        
                  string_to_sign =
        <<-DATA
        Severity: Minor
        Found in lib/fog/aws/storage.rb - About 1 hr to fix

          Method request has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def request(params, &block)
                    refresh_credentials_if_expired
          
                    date = Fog::Time.now
          
          
          Severity: Minor
          Found in lib/fog/aws/storage.rb - About 1 hr to fix

            Method data has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def self.data
                      @data ||= Hash.new do |hash, region|
                        hash[region] = Hash.new do |region_hash, key|
                          tac_id = Fog::Mock.random_hex(5)
                          region_hash[key] = {
            Severity: Minor
            Found in lib/fog/aws/support.rb - About 1 hr to fix

              Method put_bucket_website has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def put_bucket_website(bucket_name, options, options_to_be_deprecated = {})
                        options ||= {}
              
                        # Method used to be called with the suffix as the second parameter. Warn user that this is not the case any more and move on
                        if options.is_a?(String)
              Severity: Minor
              Found in lib/fog/aws/requests/storage/put_bucket_website.rb - About 1 hr to fix

                Method end_element has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def end_element(name)
                            if @in_tag_set
                              case name
                              when 'item'
                                @subnet['tagSet'][@tag['key']] = @tag['value']
                Severity: Minor
                Found in lib/fog/aws/parsers/compute/describe_subnets.rb - About 1 hr to fix

                  Method end_element has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                            def end_element(name)
                              case name
                              when 'attachTime'
                                @block_device_mapping[name] = Time.parse(value)
                              when *@contexts
                  Severity: Minor
                  Found in lib/fog/aws/parsers/compute/spot_instance_requests.rb - About 1 hr to fix

                    Method end_element has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                              def end_element(name)
                                case name
                                when 'Name', 'Value'
                                  @dimension[name] = value
                                when 'AlarmConfigurationUpdatedTimestamp', 'StateUpdatedTimestamp'
                    Severity: Minor
                    Found in lib/fog/aws/parsers/cloud_watch/describe_alarms.rb - About 1 hr to fix

                      Method modify_db_instance has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              def modify_db_instance(db_name, apply_immediately, _options={})
                                options = _options.dup
                                response = Excon::Response.new
                                if server = self.data[:servers][db_name]
                                  if server["DBInstanceStatus"] != "available"
                      Severity: Minor
                      Found in lib/fog/aws/requests/rds/modify_db_instance.rb - About 1 hr to fix

                        Method create_db_instance_read_replica has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def create_db_instance_read_replica(instance_identifier, source_identifier, options={})
                                  # TODO: throw error when instance_identifier already exists,
                                  # or source_identifier doesn't exist
                        
                                  source = self.data[:servers][source_identifier]
                        Severity: Minor
                        Found in lib/fog/aws/requests/rds/create_db_instance_read_replica.rb - About 1 hr to fix

                          Method list_attached_role_policies has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  def list_attached_role_policies(role_name, options={})
                                    unless self.data[:roles].key?(role_name)
                                      raise Fog::AWS::IAM::NotFound.new("The role with name #{role_name} cannot be found.")
                                    end
                          
                          
                          Severity: Minor
                          Found in lib/fog/aws/requests/iam/list_attached_role_policies.rb - About 1 hr to fix

                            Method list_attached_group_policies has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    def list_attached_group_policies(group_name, options={})
                                      unless self.data[:groups].key?(group_name)
                                        raise Fog::AWS::IAM::NotFound.new("The group with name #{group_name} cannot be found.")
                                      end
                            
                            
                            Severity: Minor
                            Found in lib/fog/aws/requests/iam/list_attached_group_policies.rb - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                        if bucket = self.data[:buckets][bucket_name]
                                          contents = bucket[:objects].values.map(&:first).sort {|x,y| x['Key'] <=> y['Key']}.reject do |object|
                                              (prefix    && object['Key'][0...prefix.length] != prefix) ||
                                              (marker    && object['Key'] <= marker) ||
                                              (delimiter && object['Key'][(prefix ? prefix.length : 0)..-1].include?(delimiter) \
                              Severity: Critical
                              Found in lib/fog/aws/requests/storage/get_bucket.rb - About 1 hr to fix

                                Method end_element has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                          def end_element(name)
                                            case name
                                            when 'member'
                                              if @in_availability_zones && @in_load_balancer_addresses
                                                @availability_zone['LoadBalancerAddresses'] << @load_balancer_addresses
                                Severity: Minor
                                Found in lib/fog/aws/parsers/elbv2/create_load_balancer.rb - About 1 hr to fix

                                  Method end_element has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                            def end_element(name)
                                              case name
                                              when 'member'
                                                if @in_availability_zones && @in_load_balancer_addresses
                                                  @availability_zone['LoadBalancerAddresses'] << @load_balancer_addresses
                                  Severity: Minor
                                  Found in lib/fog/aws/parsers/elbv2/describe_load_balancers.rb - About 1 hr to fix

                                    Method end_element has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                              def end_element(name)
                                                if @in_tag_set
                                                  case name
                                                  when 'item'
                                                    @subnet['tagSet'][@tag['key']] = @tag['value']
                                    Severity: Minor
                                    Found in lib/fog/aws/parsers/compute/create_subnet.rb - About 1 hr to fix

                                      Method end_element has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                                def end_element(name)
                                                  if @in_attachment_set
                                                    case name
                                                    when 'attachmentSet'
                                                      @in_attachment_set = false
                                      Severity: Minor
                                      Found in lib/fog/aws/parsers/compute/describe_volumes.rb - About 1 hr to fix

                                        Method end_element has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                  def end_element(name)
                                                    if @in_tag_set
                                                      case name
                                                        when 'item'
                                                          @dhcp_options['tagSet'][@tag['key']] = @tag['value']
                                        Severity: Minor
                                        Found in lib/fog/aws/parsers/compute/create_dhcp_options.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language