Showing 630 of 1,221 total issues

Method add_permission has 41 lines of code (exceeds 25 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 1 hr to fix

    Method create_hosted_zone has 41 lines of code (exceeds 25 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 1 hr to fix

      Method end_element has 40 lines of code (exceeds 25 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 1 hr to fix

        Method start_element has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  def start_element(name, attrs = [])
                    super
                    case name
                    when 'instanceType'
                      @in_instanceType   = true
        Severity: Minor
        Found in lib/fog/aws/parsers/compute/describe_instance_attribute.rb - About 1 hr to fix

          Method describe_db_security_groups has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def describe_db_security_groups(opts={})
                    response = Excon::Response.new
                    sec_group_set = []
                    if opts.is_a?(String)
                      sec_group_name = opts
          Severity: Minor
          Found in lib/fog/aws/requests/rds/describe_db_security_groups.rb - About 1 hr to fix

            Method create_route has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def create_route(route_table_id, destination_cidr_block, internet_gateway_id=nil, instance_id=nil, network_interface_id=nil)
                      instance_owner_id = nil
                      route_table = self.data[:route_tables].find { |routetable| routetable["routeTableId"].eql? route_table_id }
                      if !route_table.nil? && destination_cidr_block
                        if !internet_gateway_id.nil? || !instance_id.nil? || !network_interface_id.nil?
            Severity: Minor
            Found in lib/fog/aws/requests/compute/create_route.rb - About 1 hr to fix

              Method list_keys has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def list_keys(options={})
                        limit  = options[:limit]
                        marker = options[:marker]
              
                        if limit
              Severity: Minor
              Found in lib/fog/aws/requests/kms/list_keys.rb - About 1 hr to fix

                Method bootstrap has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        def bootstrap(new_attributes = {})
                          spot_request = service.spot_requests.new(new_attributes)
                
                          unless new_attributes[:key_name]
                            # first or create fog_#{credential} keypair
                Severity: Minor
                Found in lib/fog/aws/models/compute/spot_requests.rb - About 1 hr 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 encode_attributes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        def encode_attributes(attributes, replace_attributes = [], expected_attributes = {})
                          encoded_attributes = {}
                          if attributes
                
                            expected_attributes.keys.each_with_index do |exkey, index|
                Severity: Minor
                Found in lib/fog/aws/simpledb.rb - About 1 hr 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 start_element has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                          def start_element(name, attrs = [])
                            super
                            case name
                            when 'description'
                              @in_description = true
                Severity: Minor
                Found in lib/fog/aws/parsers/compute/describe_image_attribute.rb - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
                Open

                          def end_element(name)
                            super
                            case name
                            when 'taskDefinitionArn'
                              @response[@result][@definition][name] = value
                Severity: Minor
                Found in lib/fog/aws/parsers/ecs/task_definition.rb - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
                Open

                          def end_element(name)
                            super
                            case name
                            when 'stringSetValue'
                              @context.pop
                Severity: Minor
                Found in lib/fog/aws/parsers/ecs/container_instance.rb - About 1 hr 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_balancer_policies has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        def describe_load_balancer_policies(lb_name = nil, names = [])
                          if lb_name
                            raise Fog::AWS::ELB::NotFound unless load_balancer = self.data[:load_balancers][lb_name]
                            names = [*names]
                            policies = if names.any?
                Severity: Minor
                Found in lib/fog/aws/requests/elb/describe_load_balancer_policies.rb - About 1 hr 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_stack has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        def update_stack(stack_name, options = {})
                          params = {
                            'StackName' => stack_name,
                          }
                
                
                Severity: Minor
                Found in lib/fog/aws/requests/cloud_formation/update_stack.rb - About 1 hr 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 restore_db_instance_from_db_snapshot has a Cognitive Complexity of 13 (exceeds 5 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: Minor
                Found in lib/fog/aws/requests/rds/restore_db_instance_from_db_snapshot.rb - About 1 hr 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_load_balancer_listeners has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        def create_load_balancer_listeners(lb_name, listeners)
                          load_balancer = data[:load_balancers][lb_name]
                          raise Fog::AWS::ELB::NotFound unless load_balancer
                          response = Excon::Response.new
                
                
                Severity: Minor
                Found in lib/fog/aws/requests/elb/create_load_balancer_listeners.rb - About 1 hr 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_instances has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        def run_instances(image_id, min_count, max_count, options = {})
                          response = Excon::Response.new
                          response.status = 200
                
                          group_set = [ (options['SecurityGroup'] || 'default') ].flatten
                Severity: Minor
                Found in lib/fog/aws/requests/compute/run_instances.rb - About 1 hr 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_network_acl_entry has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        def create_network_acl_entry(network_acl_id, rule_number, protocol, rule_action, cidr_block, egress, options = {})
                          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 }
                Severity: Minor
                Found in lib/fog/aws/requests/compute/create_network_acl_entry.rb - About 1 hr 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_images has a Cognitive Complexity of 13 (exceeds 5 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: Minor
                Found in lib/fog/aws/requests/compute/describe_images.rb - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
                Open

                        def describe_spot_price_history(filters = {})
                          params = {}
                          spot_price_history_set = []
                
                          response = Excon::Response.new
                Severity: Minor
                Found in lib/fog/aws/requests/compute/describe_spot_price_history.rb - About 1 hr 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