Showing 630 of 1,218 total issues

Method get_bucket_object_versions has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def get_bucket_object_versions(bucket_name, options = {})
          delimiter, key_marker, max_keys, prefix, version_id_marker = \
            options['delimiter'], options['key-marker'], options['max-keys'],options['prefix'],options['version-id-marker']

          unless bucket_name
Severity: Major
Found in lib/fog/aws/requests/storage/get_bucket_object_versions.rb - About 2 hrs to fix

    Method request_spot_instances has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def request_spot_instances(image_id, instance_type, spot_price, options = {})
              response = Excon::Response.new
              id       = Fog::AWS::Mock.spot_instance_request_id
    
              if (image_id && instance_type && spot_price)
    Severity: Major
    Found in lib/fog/aws/requests/compute/request_spot_instances.rb - About 2 hrs to fix

      Method change_resource_record_sets has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def change_resource_record_sets(zone_id, change_batch, options = {})
                response = Excon::Response.new
                errors   = []
      
      
      
      Severity: Major
      Found in lib/fog/aws/requests/dns/change_resource_record_sets.rb - About 2 hrs to fix

        Method end_element has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

                  def end_element(name)
                    if @in_default_actions
                      case name
                      when 'member'
                        if @in_target_groups
        Severity: Minor
        Found in lib/fog/aws/parsers/elbv2/describe_listeners.rb - About 2 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

        Method create_cluster has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

                def create_cluster(options = {})
                  db_name                             = options[:db_name]
                  cluster_identifier                  = options[:cluster_identifier]
                  cluster_type                        = options[:cluster_type]
                  node_type                           = options[:node_type]
        Severity: Minor
        Found in lib/fog/aws/requests/redshift/create_cluster.rb - About 2 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

        Method end_element has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

                  def end_element(name)
                    if @instance_profile
                      case name
                      when 'Arn', 'Path'
                        if @role
        Severity: Minor
        Found in lib/fog/aws/parsers/iam/base_instance_profile.rb - About 2 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

        Method run_instances has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

                def run_instances(image_id, min_count, max_count, options = {})
                  if block_device_mapping = options.delete('BlockDeviceMapping')
                    block_device_mapping.each_with_index do |mapping, index|
                      for key, value in mapping
                        options.merge!({ format("BlockDeviceMapping.%d.#{key}", index) => value })
        Severity: Minor
        Found in lib/fog/aws/requests/compute/run_instances.rb - About 2 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

        Method signature_v2 has a Cognitive Complexity of 21 (exceeds 5 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 2 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

        Method start_task has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def start_task(params={})
                  response = Excon::Response.new
                  response.status = 200
        
                  unless task_def_id = params.delete('taskDefinition')
        Severity: Major
        Found in lib/fog/aws/requests/ecs/start_task.rb - About 2 hrs to fix

          Method create_service has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def create_service(params={})
                    response = Excon::Response.new
                    response.status = 200
          
                    e = Fog::AWS::ECS::Error
          Severity: Major
          Found in lib/fog/aws/requests/ecs/create_service.rb - About 2 hrs to fix

            Method end_element has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                      def end_element(name)
                        case name
                        when 'DeleteMarker'
                          @response['Versions'] << {'DeleteMarker' => @delete_marker }
                          @delete_marker = { 'Owner' => {} }
            Severity: Minor
            Found in lib/fog/aws/parsers/storage/get_bucket_object_versions.rb - About 2 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

            Method end_element has a Cognitive Complexity of 20 (exceeds 5 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 2 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

            Method end_element has a Cognitive Complexity of 20 (exceeds 5 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 2 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

            Method _request has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                    def _request(scheme, host, port, params, original_params, &block)
                      connection(scheme, host, port).request(params, &block)
                    rescue Excon::Errors::MovedPermanently, Excon::Errors::TemporaryRedirect => error
                      headers = (error.response.is_a?(Hash) ? error.response[:headers] : error.response.headers)
                      new_params = {}
            Severity: Minor
            Found in lib/fog/aws/storage.rb - About 2 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

            Method fetch_credentials has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def fetch_credentials(options)
                      if options[:use_iam_profile] && Fog.mocking?
                        return Fog::AWS::Compute::Mock.data[:iam_role_based_creds]
                      end
                      if options[:use_iam_profile]
            Severity: Major
            Found in lib/fog/aws/credential_fetcher.rb - About 2 hrs to fix

              Method associate_address has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def associate_address(*args)
                        if args.first.kind_of? Hash
                          params = args.first
                        else
                          params = {
              Severity: Major
              Found in lib/fog/aws/requests/compute/associate_address.rb - About 2 hrs to fix

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

                          def end_element(name)
                            case name
                            when 'AutoMinorVersionUpgrade', 'CacheClusterId',
                              'CacheClusterStatus', 'CacheNodeType', 'Engine',
                              'PreferredAvailabilityZone', 'PreferredMaintenanceWindow'
                Severity: Major
                Found in lib/fog/aws/parsers/elasticache/cache_cluster_parser.rb - About 2 hrs to fix

                  Method create_volume has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def create_volume(availability_zone, size, options = {})
                            unless options.is_a?(Hash)
                              Fog::Logger.deprecation("create_volume with a bare snapshot_id is deprecated, use create_volume(availability_zone, size, 'SnapshotId' => snapshot_id) instead [light_black](#{caller.first})[/]")
                              options = { 'SnapshotId' => options }
                            end
                  Severity: Major
                  Found in lib/fog/aws/requests/compute/create_volume.rb - About 2 hrs to fix

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

                              def end_element(name)
                                case name
                                when 'ChangeSetId', 'ChangeSetName', 'Description', 'ExecutionStatus', 'StackId', 'StackName', 'StatusReason', 'Status'
                                  @response[name] = value
                                when 'CreationTime'
                    Severity: Major
                    Found in lib/fog/aws/parsers/cloud_formation/describe_change_set.rb - About 2 hrs to fix

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

                              def self.data
                                @data ||= Hash.new do |hash, key|
                                  owner_id = Fog::AWS::Mock.owner_id
                      
                                  hash[key] = {
                      Severity: Major
                      Found in lib/fog/aws/iam.rb - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language