Showing 630 of 1,221 total issues

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

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

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

        def register_image(name, description, location, block_devices=[], options={})
          unless name.empty?
            image = {
              'imageId' => Fog::AWS::Mock.image_id,
              'imageLocation' => '',
Severity: Minor
Found in lib/fog/aws/requests/compute/register_image.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 describe_volumes has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

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

        def authorize_db_security_group_ingress(name, opts = {})
          unless opts.key?('CIDRIP') || ((opts.key?('EC2SecurityGroupName') || opts.key?('EC2SecurityGroupId')) && opts.key?('EC2SecurityGroupOwnerId'))
            raise ArgumentError, 'Must specify CIDRIP, or one of EC2SecurityGroupName or EC2SecurityGroupId, and EC2SecurityGroupOwnerId'
          end

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

        def normalize_permissions(options)
          normalized_permissions = []
          if options['SourceSecurityGroupName']
            group_name = if options['SourceSecurityGroupName'] =~ /default_elb/
                           "default"
Severity: Minor
Found in lib/fog/aws/requests/compute/authorize_security_group_ingress.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 17 (exceeds 5 allowed). Consider refactoring.
Open

        def request(params, &block)
          refresh_credentials_if_expired

          date = Fog::Time.now

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 end_element has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          def end_element(name)
            super
            case name
            when 'containerOverrides'
              @task['overrides'] ||= {}
Severity: Major
Found in lib/fog/aws/parsers/ecs/task.rb - About 2 hrs to fix

    Method restore_db_instance_from_db_snapshot has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def restore_db_instance_from_db_snapshot(snapshot_id, db_name, options={})
    
              if self.data[:servers] and self.data[:servers][db_name]
                raise Fog::AWS::RDS::IdentifierTaken.new("DBInstanceAlreadyExists #{response.body.to_s}")
              end
    Severity: Major
    Found in lib/fog/aws/requests/rds/restore_db_instance_from_db_snapshot.rb - About 2 hrs to fix

      Method setup_default_vpc! has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def setup_default_vpc!
                return if default_vpc.present?
      
                disable_ec2_classic
      
      
      Severity: Major
      Found in lib/fog/aws/compute.rb - About 2 hrs to fix

        Method describe_load_balancers has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def describe_load_balancers(options = {})
                  unless options.is_a?(Hash)
                    Fog::Logger.deprecation("describe_load_balancers with #{options.class} is deprecated, use all('LoadBalancerNames' => []) instead [light_black](#{caller.first})[/]")
                    options = { 'LoadBalancerNames' => [options].flatten }
                  end
        Severity: Major
        Found in lib/fog/aws/requests/elb/describe_load_balancers.rb - About 2 hrs to fix

          Method create_stack has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def create_stack(stack_name, options = {})
                    params = {
                      'StackName' => stack_name,
                    }
          
          
          Severity: Major
          Found in lib/fog/aws/requests/cloud_formation/create_stack.rb - About 2 hrs to fix

            Method describe_images has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def describe_images(filters = {})
                      unless filters.is_a?(Hash)
                        Fog::Logger.deprecation("describe_images with #{filters.class} param is deprecated, use describe_images('image-id' => []) instead [light_black](#{caller.first})[/]")
                        filters = {'image-id' => [*filters]}
                      end
            Severity: Major
            Found in lib/fog/aws/requests/compute/describe_images.rb - About 2 hrs to fix

              Method describe_availability_zones has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def describe_availability_zones(filters = {})
                        unless filters.is_a?(Hash)
                          Fog::Logger.deprecation("describe_availability_zones with #{filters.class} param is deprecated, use describe_availability_zones('zone-name' => []) instead [light_black](#{caller.first})[/]")
                          filters = {'zone-name' => [*filters]}
                        end
              Severity: Major
              Found in lib/fog/aws/requests/compute/describe_availability_zones.rb - About 2 hrs to fix

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

                          def end_element(name)
                            super
                            case name
                            when 'stringSetValue'
                              @context.pop
                Severity: Major
                Found in lib/fog/aws/parsers/ecs/container_instance.rb - About 2 hrs to fix

                  Method delete_security_group has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def delete_security_group(name, id = nil)
                            if name == 'default'
                              raise Fog::AWS::Compute::Error.new("InvalidGroup.Reserved => The security group 'default' is reserved")
                            end
                  
                  
                  Severity: Major
                  Found in lib/fog/aws/requests/compute/delete_security_group.rb - About 2 hrs to fix

                    Method create_cluster has 53 lines of code (exceeds 25 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: Major
                    Found in lib/fog/aws/requests/redshift/create_cluster.rb - About 2 hrs to fix

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

                                def end_element(name)
                                  case name
                                  when 'member'
                                    if @in_block_device_mappings
                                      @launch_configuration['BlockDeviceMappings'] << @block_device_mapping
                      Severity: Major
                      Found in lib/fog/aws/parsers/auto_scaling/describe_launch_configurations.rb - About 2 hrs to fix

                        Method describe_snapshots has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def describe_snapshots(filters = {}, options = {})
                                  unless filters.is_a?(Hash)
                                    Fog::Logger.deprecation("describe_snapshots with #{filters.class} param is deprecated, use describe_snapshots('snapshot-id' => []) instead [light_black](#{caller.first})[/]")
                                    filters = {'snapshot-id' => [*filters]}
                                  end
                        Severity: Major
                        Found in lib/fog/aws/requests/compute/describe_snapshots.rb - About 2 hrs to fix

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

                                    def end_element(name)
                                      if @in_association_set
                                        case name
                                        when 'associationSet'
                                          @in_association_set = false
                          Severity: Minor
                          Found in lib/fog/aws/parsers/compute/describe_route_tables.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

                          Severity
                          Category
                          Status
                          Source
                          Language