Showing 630 of 1,221 total issues

Method describe_volumes_modifications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_volumes_modifications(filters = {})
          response = Excon::Response.new

          modification_set = self.data[:volume_modifications].values

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

        def disassociate_address(public_ip, association_id=nil)
          response = Excon::Response.new
          response.status = 200
          if address = self.data[:addresses][public_ip]
            if address['allocationId'] && association_id.nil?
Severity: Minor
Found in lib/fog/aws/requests/compute/disassociate_address.rb - About 35 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_network_acl_entry has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def delete_network_acl_entry(network_acl_id, rule_number, egress)
          response = Excon::Response.new
          if self.data[:network_acls][network_acl_id]
            if self.data[:network_acls][network_acl_id]['entrySet'].find { |r| r['ruleNumber'] == rule_number && r['egress'] == egress }
              self.data[:network_acls][network_acl_id]['entrySet'].delete_if { |r| r['ruleNumber'] == rule_number && r['egress'] == egress }
Severity: Minor
Found in lib/fog/aws/requests/compute/delete_network_acl_entry.rb - About 35 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 update_group has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def update_group(group_name, options = {})
          raise Fog::AWS::IAM::NotFound.new(
            "The user with name #{group_name} cannot be found."
          ) unless self.data[:groups].key?(group_name)

Severity: Minor
Found in lib/fog/aws/requests/iam/update_group.rb - About 35 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 run_task has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

          unless task_def_id = params.delete('taskDefinition')
Severity: Minor
Found in lib/fog/aws/requests/ecs/run_task.rb - About 35 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_vpc_classic_link has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def describe_vpc_classic_link(options={})
          response = Excon::Response.new
          vpcs = self.data[:vpcs]
          if vpc_ids = options[:vpc_ids]
            vpcs = vpc_ids.collect do |vpc_id|
Severity: Minor
Found in lib/fog/aws/requests/compute/describe_vpc_classic_link.rb - About 35 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_permission has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def add_permission(params={})
          function_id = params.delete('FunctionName')
          function = self.get_function_configuration(
            'FunctionName' => function_id
          ).body
Severity: Minor
Found in lib/fog/aws/requests/lambda/add_permission.rb - About 35 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_mount_target_security_groups has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def modify_mount_target_security_groups(id, security_groups)
          if security_groups.nil? || security_groups.empty?
            raise Fog::AWS::EFS::Error.new("Must provide at least one security group.")
          end

Severity: Minor
Found in lib/fog/aws/requests/efs/modify_mount_target_security_groups.rb - About 35 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 stop_task has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

          unless task_id = params.delete('task')
Severity: Minor
Found in lib/fog/aws/requests/ecs/stop_task.rb - About 35 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_hosted_zone has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def create_hosted_zone(name, options = {})
          # Append a trailing period to the name if absent.
          name = name + "." unless name.end_with?(".")

          response = Excon::Response.new
Severity: Minor
Found in lib/fog/aws/requests/dns/create_hosted_zone.rb - About 35 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 fetch_ip_permission has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def fetch_ip_permission(range, options)
          ip_permission = {
            'FromPort'   => range.begin,
            'ToPort'     => range.end,
            'IpProtocol' => options[:ip_protocol] || 'tcp'
Severity: Minor
Found in lib/fog/aws/models/compute/security_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 end_element has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def end_element(name)
            case name
            when 'DefaultValue', 'ParameterKey'
              @parameter[name] = value
            when 'Description'
Severity: Minor
Found in lib/fog/aws/parsers/cloud_formation/validate_template.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 process_response has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def process_response(response, parser)
          if response &&
             response.body &&
             response.body.is_a?(String) &&
             !response.body.strip.empty? &&
Severity: Minor
Found in lib/fog/aws/lambda.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 all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def all(options = {})
          requires :zone
          options[:max_items]  ||= max_items
          options[:name]       ||= zone.domain
          options[:type]       ||= type
Severity: Minor
Found in lib/fog/aws/models/dns/records.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 reduce_digest_stack has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def reduce_digest_stack(digest, stack)
          stack.each_with_index{|s,i|
            unless digest
              digest = stack[i]
              next
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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get(key, options = {})
          remap_attributes(options, {
            :delimiter  => 'delimiter',
            :marker     => 'marker',
            :max_keys   => 'max-keys',
Severity: Minor
Found in lib/fog/aws/models/storage/directories.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def initialize(attributes={})
          self.groups     ||= ["default"] unless (attributes[:subnet_id] || attributes[:security_group_ids] || attributes[:network_interfaces])
          self.flavor_id  ||= 't1.micro'

          # Old 'connection' is renamed as service and should be used instead
Severity: Minor
Found in lib/fog/aws/models/compute/server.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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def save
          if !persisted?
            requires :name

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

        def upload_in_threads(target_directory_key, target_file_key, upload_id, pending, completed, thread_count)
          threads = []

          thread_count.times do
            thread = Thread.new do
Severity: Minor
Found in lib/fog/aws/models/storage/file.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 all has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def all(options = {})
          options[:marker]   ||= marker unless marker.nil?
          options[:maxitems] ||= max_items unless max_items.nil?
          data = service.list_hosted_zones(options).body['HostedZones']
          load(data)
Severity: Minor
Found in lib/fog/aws/models/dns/zones.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