Showing 630 of 1,221 total issues

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

    Method restore_from_cluster_snapshot has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def restore_from_cluster_snapshot(options = {})
              cluster_identifier           = options[:cluster_identifier]
              snapshot_identifier          = options[:snapshot_identifier]
              snapshot_cluster_identifier  = options[:snapshot_cluster_identifier]
              port                         = options[:port]
    Severity: Minor
    Found in lib/fog/aws/requests/redshift/restore_from_cluster_snapshot.rb - About 1 hr to fix

      Method post_streaming_distribution has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def post_streaming_distribution(options = {})
                if self.data[:streaming_distributions].values.any? { |d| (d['CNAME'] & (options['CNAME']||[])).empty? }
                  Fog::AWS::CDN::Mock.error(:invalid_argument, 'CNAME is already in use')
                end
      
      
      Severity: Minor
      Found in lib/fog/aws/requests/cdn/post_streaming_distribution.rb - About 1 hr to fix

        Method send_message has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def send_message(queue_url, message)
                  Excon::Response.new.tap do |response|
                    if (queue = data[:queues][queue_url])
                      response.status = 200
        
        
        Severity: Minor
        Found in lib/fog/aws/requests/sqs/send_message.rb - About 1 hr to fix

          Method get_attributes has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def get_attributes(domain_name, item_name, options = {})
                    if options.is_a?(Array)
                      Fog::Logger.deprecation("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
                      options['AttributeName'] ||= options if options.is_a?(Array)
                    end
          Severity: Minor
          Found in lib/fog/aws/requests/simpledb/get_attributes.rb - About 1 hr to fix

            Method register_task_definition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def register_task_definition(params={})
                      response = Excon::Response.new
                      response.status = 200
            
                      family_error = 'ClientException => Family can not be blank.'
            Severity: Minor
            Found in lib/fog/aws/requests/ecs/register_task_definition.rb - About 1 hr to fix

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

                Method create_network_acl_entry has 28 lines of code (exceeds 25 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

                  Method create_route_table has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def create_route_table(vpc_id)
                            response = Excon::Response.new
                            vpc = self.data[:vpcs].find { |vpc| vpc["vpcId"].eql? vpc_id }
                            unless vpc.nil?
                              response.status = 200
                  Severity: Minor
                  Found in lib/fog/aws/requests/compute/create_route_table.rb - About 1 hr to fix

                    Method initialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            def initialize(options={})
                              require_mime_types
                    
                              @use_iam_profile = options[:use_iam_profile]
                              @instrumentor       = options[:instrumentor]
                    Severity: Minor
                    Found in lib/fog/aws/storage.rb - About 1 hr to fix

                      Method list_hosted_zones has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              def list_hosted_zones(options = {})
                                maxitems = [options[:max_items]||100,100].min
                      
                                if options[:marker].nil?
                                  start = 0
                      Severity: Minor
                      Found in lib/fog/aws/requests/dns/list_hosted_zones.rb - About 1 hr to fix

                        Method signed_params_v4 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def self.signed_params_v4(params, headers, options={})
                              date = Fog::Time.now
                        
                              params = params.merge('Version' => options[:version])
                        
                        
                        Severity: Minor
                        Found in lib/fog/aws.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 multipart_save has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def multipart_save
                                  # Initiate the upload
                                  res = service.initiate_multipart_upload vault.id, multipart_chunk_size, 'description' => description
                                  upload_id = res.headers["x-amz-multipart-upload-id"]
                        
                        
                        Severity: Minor
                        Found in lib/fog/aws/models/glacier/archive.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 digest_for_part has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def digest_for_part(body)
                                  part_stack = []
                                  part_temp = nil
                                  body_size = body.bytesize
                                  prepare_body_for_slice(body) {|body, slice|
                        Severity: Minor
                        Found in lib/fog/aws/glacier.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 _request has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def _request(body, headers, idempotent, parser)
                                  @connection.request({
                                    :body       => body,
                                    :expects    => 200,
                                    :headers    => headers,
                        Severity: Minor
                        Found in lib/fog/aws/rds.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 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                                  def end_element(name)
                                    super
                                    case name
                                    when 'containerOverrides'
                                      @task['overrides'] ||= {}
                        Severity: Minor
                        Found in lib/fog/aws/parsers/ecs/task.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 10 (exceeds 5 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

                        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_multiple_objects has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def delete_multiple_objects(bucket_name, object_names, options = {})
                                  headers = options.dup
                                  headers.delete(:quiet)
                                  response = Excon::Response.new
                                  if bucket = self.data[:buckets][bucket_name]
                        Severity: Minor
                        Found in lib/fog/aws/requests/storage/delete_multiple_objects.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 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def create_load_balancer(name, options = {})
                                  response = Excon::Response.new
                                  response.status = 200
                        
                                  raise Fog::AWS::ELBV2::IdentifierTaken if self.data[:load_balancers_v2].key? name
                        Severity: Minor
                        Found in lib/fog/aws/requests/elbv2/create_load_balancer.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 list_roles has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def list_roles(options={})
                                  limit  = options['MaxItems']
                                  marker = options['Marker']
                        
                                  if limit
                        Severity: Minor
                        Found in lib/fog/aws/requests/iam/list_roles.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