Showing 630 of 1,218 total issues

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_object_acl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_object_acl(bucket_name, object_name, options = {})
          response = Excon::Response.new
          if acl = self.data[:acls][:object][bucket_name] && self.data[:acls][:object][bucket_name][object_name]
            response.status = 200
            if acl.is_a?(String)
Severity: Minor
Found in lib/fog/aws/requests/storage/get_object_acl.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_db_cluster has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def create_db_cluster(cluster_name, options={})
          response = Excon::Response.new
          if self.data[:clusters][cluster_name]
            raise Fog::AWS::RDS::IdentifierTaken.new("DBClusterAlreadyExists")
          end
Severity: Minor
Found in lib/fog/aws/requests/rds/create_db_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 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_spot_price_history has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_spot_price_history(filters = {})
          params = {}

          for key in %w(AvailabilityZone StartTime EndTime MaxResults NextToken)
            if filters.is_a?(Hash) && filters.key?(key)
Severity: Minor
Found in lib/fog/aws/requests/compute/describe_spot_price_history.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 attach_internet_gateway has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def attach_internet_gateway(internet_gateway_id, vpc_id)
          response = Excon::Response.new
          if internet_gateway_id && vpc_id
            response.status = 200
            response.body = {
Severity: Minor
Found in lib/fog/aws/requests/compute/attach_internet_gateway.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 associate_dhcp_options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def associate_dhcp_options(dhcp_options_id, vpc_id)
          response = Excon::Response.new
          if dhcp_options_id && vpc_id
            response.status = 200
            response.body = {
Severity: Minor
Found in lib/fog/aws/requests/compute/associate_dhcp_options.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 deregister_container_instance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def deregister_container_instance(params={})
          response = Excon::Response.new
          response.status = 200

          instance_id = params.delete('containerInstance')
Severity: Minor
Found in lib/fog/aws/requests/ecs/deregister_container_instance.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_container_instances has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_container_instances(params={})
          response = Excon::Response.new
          response.status = 200

          cluster = params.delete('cluster') || 'default'
Severity: Minor
Found in lib/fog/aws/requests/ecs/describe_container_instances.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_function has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_function(params={})
          response = Excon::Response.new
          response.status = 200
          response.body = ''

Severity: Minor
Found in lib/fog/aws/requests/lambda/get_function.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_task_definition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_task_definition(params={})
          response = Excon::Response.new
          response.status = 200

          taskdef_error = "ClientException => Task Definition can not be blank."
Severity: Minor
Found in lib/fog/aws/requests/ecs/describe_task_definition.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_event_source_mapping has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def create_event_source_mapping(params={})
          enabled          = params.delete('Enabled')   || false
          batch_size       = params.delete('BatchSize') || 100
          event_source_arn = params.delete('EventSourceArn')
          function_name    = params.delete('FunctionName')
Severity: Minor
Found in lib/fog/aws/requests/lambda/create_event_source_mapping.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_user has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_user(username = nil, options = {})
          response  = Excon::Response.new
          user_body = nil

          if username.nil? # show current user
Severity: Minor
Found in lib/fog/aws/requests/iam/get_user.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 detach_internet_gateway has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def detach_internet_gateway(internet_gateway_id, vpc_id)
          response = Excon::Response.new
          if internet_gateway_id && vpc_id
            response.status = 200
            response.body = {
Severity: Minor
Found in lib/fog/aws/requests/compute/detach_internet_gateway.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_tasks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_tasks(params={})
          response = Excon::Response.new
          response.status = 200

          unless tasks = params.delete('tasks')
Severity: Minor
Found in lib/fog/aws/requests/ecs/describe_tasks.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_access_key has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def create_access_key(options)
          #FIXME: Not 100% correct as AWS will use the signing credentials when there is no 'UserName' in the options hash
          #       Also doesn't raise an error when there are too many keys
          if user = options['UserName']
            if data[:users].key? user
Severity: Minor
Found in lib/fog/aws/requests/iam/create_access_key.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_vpc_attribute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def modify_vpc_attribute(vpc_id, options = {})
          response = Excon::Response.new
          if options.size == 0
            raise Fog::AWS::Compute::Error.new("InvalidParameterCombination => No attributes specified.")
          elsif options.size > 1
Severity: Minor
Found in lib/fog/aws/requests/compute/modify_vpc_attribute.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_file_systems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_file_systems(options={})
          response = Excon::Response.new

          file_systems = if id = options[:id]
                           if fs = self.data[:file_systems][id]
Severity: Minor
Found in lib/fog/aws/requests/efs/describe_file_systems.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_scheduled_update_group_action has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def put_scheduled_update_group_action(auto_scaling_group_name, scheduled_action_name, time=nil, options = {})
          # The 'Time' parameter is now an alias for StartTime and needs to be identical if specified.
          time = options['StartTime'].nil? ? time : options['StartTime']
          if !time.nil?
            time = time.class == Time ? time.utc.iso8601 : Time.parse(time).utc.iso8601
Severity: Minor
Found in lib/fog/aws/requests/auto_scaling/put_scheduled_update_group_action.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_services has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_services(params={})
          response = Excon::Response.new
          response.status = 200

          cluster = params.delete('cluster') || 'default'
Severity: Minor
Found in lib/fog/aws/requests/ecs/describe_services.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