Showing 630 of 1,221 total issues

Method prepare_body_for_slice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def prepare_body_for_slice(body)
          if body.respond_to? :byteslice
            r = yield(body, :byteslice)
          else
            if body.respond_to? :encoding
Severity: Minor
Found in lib/fog/aws/glacier.rb - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            if @section == :hosted_zone
              case name
              when 'Id'
                @hosted_zone[name]= value.sub('/hostedzone/', '')
Severity: Minor
Found in lib/fog/aws/parsers/dns/get_hosted_zone.rb - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            if @in_tag_set
              case name
              when 'item'
                @address['tagSet'][@tag['key']] = @tag['value']
Severity: Minor
Found in lib/fog/aws/parsers/compute/describe_addresses.rb - About 25 mins 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 modify_cache_cluster has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def modify_cache_cluster(id, options = {})
          response        = Excon::Response.new
          cluster         = self.data[:clusters][id]
          pending_values  = Hash.new
          # For any given option, update the cluster's corresponding value
Severity: Minor
Found in lib/fog/aws/requests/elasticache/modify_cache_cluster.rb - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            if @in_tag_set
              case name
                when 'item'
                  @vpc['tagSet'][@tag['key']] = @tag['value']
Severity: Minor
Found in lib/fog/aws/parsers/compute/create_vpc.rb - About 25 mins 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 6 (exceeds 5 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 25 mins 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_element has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def start_element(name,attrs = [])
            super
            case name

            when 'InstanceProfile'
Severity: Minor
Found in lib/fog/aws/parsers/iam/base_instance_profile.rb - About 25 mins 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 put_bucket has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def put_bucket(bucket_name, options = {})
          acl = options['x-amz-acl'] || 'private'
          if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl)
            raise Excon::Errors::BadRequest.new('invalid x-amz-acl')
          else
Severity: Minor
Found in lib/fog/aws/requests/storage/put_bucket.rb - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            if @in_tag_set
              case name
                when 'item'
                  @vpc['tagSet'][@tag['key']] = @tag['value']
Severity: Minor
Found in lib/fog/aws/parsers/compute/describe_vpc_classic_link.rb - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            if @section == :resource_record_set
              case name
              when 'Type', 'TTL', 'SetIdentifier', 'Weight', 'Region', 'HealthCheckId', 'Failover'
                @resource_record_set[name] = value
Severity: Minor
Found in lib/fog/aws/parsers/dns/list_resource_record_sets.rb - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'member'
              if @in_block_device_mappings
                @launch_configuration['BlockDeviceMappings'] << @block_device_mapping
Severity: Minor
Found in lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb - About 25 mins 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 rules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def rules(key, value)
            case value
            when Hash
              process(value)
            when Array
Severity: Minor
Found in lib/fog/aws/parsers/lambda/base.rb - About 25 mins 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 describe_db_engine_versions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_db_engine_versions(opts={})
          params = {}
          params['DBParameterGroupFamily'] = opts[:db_parameter_group_family] if opts[:db_parameter_group_family]
          params['DefaultOnly'] = opts[:default_only] if opts[:default_only]
          params['Engine'] = opts[:engine] if opts[:engine]
Severity: Minor
Found in lib/fog/aws/requests/rds/describe_db_engine_versions.rb - About 25 mins 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 delete_message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def delete_message(queue_url, receipt_handle)
          Excon::Response.new.tap do |response|
            if (queue = data[:queues][queue_url])
              message_id, _ = queue[:receipt_handles].find { |msg_id, receipts|
                receipts.key?(receipt_handle)
Severity: Minor
Found in lib/fog/aws/requests/sqs/delete_message.rb - About 25 mins 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 get_invalidation_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_invalidation_list(distribution_id, options = {})
          distribution = self.data[:distributions][distribution_id]
          unless distribution
            Fog::AWS::CDN::Mock.error(:no_such_distribution)
          end
Severity: Minor
Found in lib/fog/aws/requests/cdn/get_invalidation_list.rb - About 25 mins 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 describe_event_subscriptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_event_subscriptions(options={})
          response = Excon::Response.new
          name     = options['SubscriptionName']

          subscriptions = self.data[:event_subscriptions].values
Severity: Minor
Found in lib/fog/aws/requests/rds/describe_event_subscriptions.rb - About 25 mins 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 merge_shards has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def merge_shards(options={})
          stream_name = options.delete("StreamName")
          shard_to_merge_id = options.delete("ShardToMerge")
          adjacent_shard_to_merge_id = options.delete("AdjacentShardToMerge")

Severity: Minor
Found in lib/fog/aws/requests/kinesis/merge_shards.rb - About 25 mins 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_image has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def create_image(instance_id, name, description, no_reboot = false, options = {})
          params = {}
          block_device_mappings = options[:block_device_mappings] || []
          params.merge!Fog::AWS.indexed_param('BlockDeviceMapping.%d.DeviceName', block_device_mappings.map{|mapping| mapping['DeviceName']})
          params.merge!Fog::AWS.indexed_param('BlockDeviceMapping.%d.NoDevice', block_device_mappings.map{|mapping| mapping['NoDevice']})
Severity: Minor
Found in lib/fog/aws/requests/compute/create_image.rb - About 25 mins 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 describe_db_log_files has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_db_log_files(rds_id=nil, opts={})
          params = {}
          params['DBInstanceIdentifier'] = rds_id if rds_id
          params['Marker'] = opts[:marker] if opts[:marker]
          params['MaxRecords'] = opts[:max_records] if opts[:max_records]
Severity: Minor
Found in lib/fog/aws/requests/rds/describe_db_log_files.rb - About 25 mins 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 get_invalidation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_invalidation(distribution_id, invalidation_id)
          distribution = self.data[:distributions][distribution_id]
          unless distribution
            Fog::AWS::CDN::Mock.error(:no_such_distribution)
          end
Severity: Minor
Found in lib/fog/aws/requests/cdn/get_invalidation.rb - About 25 mins 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

Severity
Category
Status
Source
Language