Showing 630 of 1,221 total issues

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

        def describe_load_balancer_policy_types(type_names = [])
          type_names = [*type_names]
          policy_types = if type_names.any?
            type_names.map do |type_name|
              policy_type = self.data[:policy_types].find { |pt| pt['PolicyTypeName'] == type_name }
Severity: Minor
Found in lib/fog/aws/requests/elb/describe_load_balancer_policy_types.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 release_address has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def release_address(public_ip_or_allocation_id)
          response = Excon::Response.new

          address = self.data[:addresses][public_ip_or_allocation_id] || self.data[:addresses].values.find {|a| a['allocationId'] == public_ip_or_allocation_id }

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

        def add_user_to_group(group_name, user_name)
          unless 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/add_user_to_group.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 describe_security_groups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_security_groups(filters = {})
          unless filters.is_a?(Hash)
            Fog::Logger.deprecation("describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead [light_black](#{caller.first})[/]")
            filters = {'group-name' => [*filters]}
          end
Severity: Minor
Found in lib/fog/aws/requests/compute/describe_security_groups.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_policies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_policies(options = {})
          results = { 'ScalingPolicies' => [] }
          policy_set = self.data[:scaling_policies]

          for opt_key, opt_value in options
Severity: Minor
Found in lib/fog/aws/requests/auto_scaling/describe_policies.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_alarms has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_alarms(options={})

          records = if alarm_names = options.delete('AlarmNames')
                      [*alarm_names].inject({}) do |r, name|
                        (record = data[:metric_alarms][name]) ? r.merge(name => record) : r
Severity: Minor
Found in lib/fog/aws/requests/cloud_watch/describe_alarms.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 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 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 attach_role_policy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def attach_role_policy(role_name, policy_arn)
          response = Excon::Response.new
          if policy_arn.nil?
            raise Fog::AWS::IAM::ValidationError, "1 validation error detected: Value null at 'policyArn' failed to satisfy constraint: Member must not be null"
          end
Severity: Minor
Found in lib/fog/aws/requests/iam/attach_role_policy.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 describe_volume_status has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_volume_status(filters = {})
          raise ArgumentError.new("Filters must be a hash, but is a #{filters.class}.") unless filters.is_a?(Hash)
          next_token = filters.delete('nextToken') || filters.delete('NextToken')
          max_results = filters.delete('maxResults') || filters.delete('MaxResults')

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

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

          mount_targets = if id = options[:id]
                            if mount_target = self.data[:mount_targets][id]
Severity: Minor
Found in lib/fog/aws/requests/efs/describe_mount_targets.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 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_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 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

Severity
Category
Status
Source
Language