Showing 630 of 1,221 total issues

Method list_policies has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def list_policies(options={})
          limit  = options['MaxItems']
          marker = options['Marker']

          if limit
Severity: Minor
Found in lib/fog/aws/requests/iam/list_policies.rb - About 1 hr to fix

    Method _request has 37 lines of code (exceeds 25 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/elb.rb - About 1 hr to fix

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

                def end_element(name)
                  case @context[1 .. -1].join('.')
                    # tagSet
      
                    when 'vpcSet.item.tagSet.item'
      Severity: Minor
      Found in lib/fog/aws/parsers/compute/describe_vpcs.rb - About 1 hr to fix

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

                  def end_element(name)
                    if @instance_profile
                      case name
                      when 'Arn', 'Path'
                        if @role
        Severity: Minor
        Found in lib/fog/aws/parsers/iam/base_instance_profile.rb - About 1 hr to fix

          Method create_change_set has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def create_change_set(stack_name, options = {})
                    params = {
                      'StackName' => stack_name,
                    }
          
          
          Severity: Minor
          Found in lib/fog/aws/requests/cloud_formation/create_change_set.rb - About 1 hr to fix

            Method describe_load_balancers has 36 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: Minor
            Found in lib/fog/aws/requests/elbv2/describe_load_balancers.rb - About 1 hr to fix

              Method replace_route has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def replace_route(route_table_id, destination_cidr_block, options = {})
                        options['instanceOwnerId'] ||= nil
                        options['DestinationCidrBlock'] ||= destination_cidr_block
              
                        route_table = self.data[:route_tables].find { |routetable| routetable["routeTableId"].eql? route_table_id }
              Severity: Minor
              Found in lib/fog/aws/requests/compute/replace_route.rb - About 1 hr to fix

                Method get_function has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def get_function(params={})
                          response = Excon::Response.new
                          response.status = 200
                          response.body = ''
                
                
                Severity: Minor
                Found in lib/fog/aws/requests/lambda/get_function.rb - About 1 hr to fix

                  Method run_instance_options has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def run_instance_options
                            raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
                            requires :image_id
                  
                            options = {
                  Severity: Minor
                  Found in lib/fog/aws/models/compute/server.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 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def end_element(name)
                              case name
                              when 'member'
                                if @in_capabilities
                                  @response['Capabilities'] << value
                  Severity: Minor
                  Found in lib/fog/aws/parsers/cloud_formation/get_template_summary.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 12 (exceeds 5 allowed). Consider refactoring.
                  Open

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

                          def multipart_save(options)
                            # Initiate the upload
                            res = service.initiate_multipart_upload(directory.key, key, options)
                            upload_id = res.body["UploadId"]
                  
                  
                  Severity: Minor
                  Found in lib/fog/aws/models/storage/file.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 save_many has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def save_many(template, min_servers = 1, max_servers = nil)
                            max_servers ||= min_servers
                            data = service.run_instances(template.image_id, min_servers, max_servers, template.run_instance_options)
                            # For some reason, AWS sometimes returns empty results alongside the real ones.  Thus the select
                            data.body['instancesSet'].select { |instance_set| instance_set['instanceId'] }.map do |instance_set|
                  Severity: Minor
                  Found in lib/fog/aws/models/compute/servers.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 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def _request(body, headers, idempotent, parser, retries = 0)
                  
                            max_retries = 10
                  
                            begin
                  Severity: Minor
                  Found in lib/fog/aws/compute.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 store_mock_object has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def store_mock_object(bucket, object_name, body, options)
                            object = {
                              :body             => body,
                              'Content-Type'    => options['Content-Type'],
                              'ETag'            => OpenSSL::Digest::MD5.hexdigest(body),
                  Severity: Minor
                  Found in lib/fog/aws/requests/storage/shared_mock_methods.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 12 (exceeds 5 allowed). Consider refactoring.
                  Open

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

                          def create_stack(stack_name, options = {})
                            params = {
                              'StackName' => stack_name,
                            }
                  
                  
                  Severity: Minor
                  Found in lib/fog/aws/requests/cloud_formation/create_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 describe_load_balancers has a Cognitive Complexity of 12 (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/elbv2/describe_load_balancers.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_attached_group_policies has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def list_attached_group_policies(group_name, options={})
                            unless self.data[:groups].key?(group_name)
                              raise Fog::AWS::IAM::NotFound.new("The group with name #{group_name} cannot be found.")
                            end
                  
                  
                  Severity: Minor
                  Found in lib/fog/aws/requests/iam/list_attached_group_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 modify_network_interface_attribute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def modify_network_interface_attribute(network_interface_id, attribute, value)
                            response = Excon::Response.new
                            if self.data[:network_interfaces][network_interface_id]
                              nic = self.data[:network_interfaces][network_interface_id]
                  
                  
                  Severity: Minor
                  Found in lib/fog/aws/requests/compute/modify_network_interface_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

                  Severity
                  Category
                  Status
                  Source
                  Language