Showing 630 of 1,218 total issues

Method put_bucket_lifecycle has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def put_bucket_lifecycle(bucket_name, lifecycle)
          builder = Nokogiri::XML::Builder.new do
            LifecycleConfiguration {
              lifecycle['Rules'].each do |rule|
                Rule {
Severity: Major
Found in lib/fog/aws/requests/storage/put_bucket_lifecycle.rb - About 2 hrs to fix

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

              def end_element(name)
                if @in_default_actions
                  case name
                  when 'member'
                    if @in_target_groups
    Severity: Major
    Found in lib/fog/aws/parsers/elbv2/describe_listeners.rb - About 2 hrs to fix

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

                def end_element(name)
                  if @in_description
                    case name
                    when 'value'
                      @response['description'] = value
      Severity: Major
      Found in lib/fog/aws/parsers/compute/describe_image_attribute.rb - About 2 hrs to fix

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

                  def end_element(name)
                    case name
                    when 'member'
                      if @in_policy_names && @in_listeners
                        @listener_description['PolicyNames'] << value
        Severity: Minor
        Found in lib/fog/aws/parsers/elb/describe_load_balancers.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 19 (exceeds 5 allowed). Consider refactoring.
        Open

                  def end_element(name)
                    case name
                    when 'amiLaunchIndex'
                      @instance[name] = value.to_i
                    when 'arn'
        Severity: Minor
        Found in lib/fog/aws/parsers/compute/describe_instances.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_load_balancers has a Cognitive Complexity of 19 (exceeds 5 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: Minor
        Found in lib/fog/aws/requests/elb/describe_load_balancers.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 revoke_db_security_group_ingress has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

                def revoke_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/revoke_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 get_bucket has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

                def get_bucket(bucket_name, options = {})
                  prefix, marker, delimiter, max_keys = \
                    options['prefix'], options['marker'], options['delimiter'], options['max-keys']
                  common_prefixes = []
        
        
        Severity: Minor
        Found in lib/fog/aws/requests/storage/get_bucket.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_spot_instances has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

                def request_spot_instances(image_id, instance_type, spot_price, options = {})
                  response = Excon::Response.new
                  id       = Fog::AWS::Mock.spot_instance_request_id
        
                  if (image_id && instance_type && spot_price)
        Severity: Minor
        Found in lib/fog/aws/requests/compute/request_spot_instances.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_security_groups has 64 lines of code (exceeds 25 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: Major
        Found in lib/fog/aws/requests/compute/describe_security_groups.rb - About 2 hrs to fix

          Class Group has 23 methods (exceeds 20 allowed). Consider refactoring.
          Open

                class Group < Fog::Model
                  identity  :id,                        :aliases => 'AutoScalingGroupName'
                  attribute :arn,                       :aliases => 'AutoScalingGroupARN'
                  attribute :availability_zones,        :aliases => 'AvailabilityZones'
                  attribute :created_at,                :aliases => 'CreatedTime'
          Severity: Minor
          Found in lib/fog/aws/models/auto_scaling/group.rb - About 2 hrs to fix

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

                      def end_element(name)
                        case name
                        when 'amiLaunchIndex'
                          @instance[name] = value.to_i
                        when 'architecture', 'clientToken', 'dnsName', 'hypervisor', 'imageId',
            Severity: Major
            Found in lib/fog/aws/parsers/compute/run_instances.rb - About 2 hrs to fix

              Method create_vpc has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def create_vpc(cidrBlock, options = {})
                        Excon::Response.new.tap do |response|
                          if cidrBlock
                            response.status = 200
                            vpc_id = Fog::AWS::Mock.vpc_id
              Severity: Major
              Found in lib/fog/aws/requests/compute/create_vpc.rb - About 2 hrs to fix

                Method create_function has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def create_function(params={})
                          response = Excon::Response.new
                
                          runtime = params.delete('Runtime') || 'nodejs'
                          if !%w(nodejs java8).include?(runtime)
                Severity: Major
                Found in lib/fog/aws/requests/lambda/create_function.rb - About 2 hrs to fix

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

                            def end_element(name)
                              if @in_tag_set
                                case name
                                when 'item'
                                  @nic['tagSet'][@tag['key']] = @tag['value']
                  Severity: Major
                  Found in lib/fog/aws/parsers/compute/network_interface_parser.rb - About 2 hrs to fix

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

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

                      Method create_network_interface has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              def create_network_interface(subnetId, options = {})
                                response = Excon::Response.new
                                if subnetId
                                  subnet = self.data[:subnets].find{ |s| s['subnetId'] == subnetId }
                                  if subnet.nil?
                      Severity: Major
                      Found in lib/fog/aws/requests/compute/create_network_interface.rb - About 2 hrs to fix

                        Method run_task has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def run_task(params={})
                                  response = Excon::Response.new
                                  response.status = 200
                        
                                  unless task_def_id = params.delete('taskDefinition')
                        Severity: Major
                        Found in lib/fog/aws/requests/ecs/run_task.rb - About 2 hrs to fix

                          Method save has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def save(options = {})
                                    requires :body, :directory, :key
                                    if options != {}
                                      Fog::Logger.deprecation("options param is deprecated, use acl= instead [light_black](#{caller.first})[/]")
                                    end
                          Severity: Minor
                          Found in lib/fog/aws/models/storage/file.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 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                                    def end_element(name)
                                      if @in_outputs
                                        case name
                                        when 'OutputKey', 'OutputValue', 'Description'
                                          @output[name] = value
                          Severity: Minor
                          Found in lib/fog/aws/parsers/cloud_formation/describe_stacks.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