Showing 1,218 of 1,218 total issues

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

          def end_element(name)
            super
            case name
            when 'taskDefinitionArn'
              @response[@result][@definition][name] = value
Severity: Major
Found in lib/fog/aws/parsers/ecs/task_definition.rb - About 2 hrs to fix

    Method get_bucket_object_versions has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def get_bucket_object_versions(bucket_name, options = {})
              delimiter, key_marker, max_keys, prefix, version_id_marker = \
                options['delimiter'], options['key-marker'], options['max-keys'],options['prefix'],options['version-id-marker']
    
              unless bucket_name
    Severity: Major
    Found in lib/fog/aws/requests/storage/get_bucket_object_versions.rb - About 2 hrs to fix

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

        Method change_resource_record_sets has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def change_resource_record_sets(zone_id, change_batch, options = {})
                  response = Excon::Response.new
                  errors   = []
        
        
        
        Severity: Major
        Found in lib/fog/aws/requests/dns/change_resource_record_sets.rb - About 2 hrs to fix

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

                    def end_element(name)
                      if @in_default_actions
                        case name
                        when 'member'
                          if @in_target_groups
          Severity: Minor
          Found in lib/fog/aws/parsers/elbv2/describe_listeners.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 create_cluster has a Cognitive Complexity of 21 (exceeds 5 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: Minor
          Found in lib/fog/aws/requests/redshift/create_cluster.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 21 (exceeds 5 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 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 run_instances has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

                  def run_instances(image_id, min_count, max_count, options = {})
                    if block_device_mapping = options.delete('BlockDeviceMapping')
                      block_device_mapping.each_with_index do |mapping, index|
                        for key, value in mapping
                          options.merge!({ format("BlockDeviceMapping.%d.#{key}", index) => value })
          Severity: Minor
          Found in lib/fog/aws/requests/compute/run_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 signature_v2 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

                  def signature_v2(params, expires)
                    headers = params[:headers] || {}
          
                    string_to_sign =
          <<-DATA
          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

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

            module AWS
              class IAM
                class Real
                  require 'fog/aws/parsers/iam/basic'
          
          
          Severity: Major
          Found in lib/fog/aws/requests/iam/attach_group_policy.rb and 3 other locations - About 2 hrs to fix
          lib/fog/aws/requests/iam/attach_user_policy.rb on lines 2..53
          lib/fog/aws/requests/iam/detach_group_policy.rb on lines 2..53
          lib/fog/aws/requests/iam/detach_user_policy.rb on lines 2..53

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 104.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

            module AWS
              class IAM
                class Real
                  require 'fog/aws/parsers/iam/basic'
          
          
          Severity: Major
          Found in lib/fog/aws/requests/iam/detach_user_policy.rb and 3 other locations - About 2 hrs to fix
          lib/fog/aws/requests/iam/attach_group_policy.rb on lines 2..53
          lib/fog/aws/requests/iam/attach_user_policy.rb on lines 2..53
          lib/fog/aws/requests/iam/detach_group_policy.rb on lines 2..53

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 104.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

            module AWS
              class IAM
                class Real
                  require 'fog/aws/parsers/iam/basic'
          
          
          Severity: Major
          Found in lib/fog/aws/requests/iam/detach_group_policy.rb and 3 other locations - About 2 hrs to fix
          lib/fog/aws/requests/iam/attach_group_policy.rb on lines 2..53
          lib/fog/aws/requests/iam/attach_user_policy.rb on lines 2..53
          lib/fog/aws/requests/iam/detach_user_policy.rb on lines 2..53

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 104.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

            module AWS
              class IAM
                class Real
                  require 'fog/aws/parsers/iam/basic'
          
          
          Severity: Major
          Found in lib/fog/aws/requests/iam/attach_user_policy.rb and 3 other locations - About 2 hrs to fix
          lib/fog/aws/requests/iam/attach_group_policy.rb on lines 2..53
          lib/fog/aws/requests/iam/detach_group_policy.rb on lines 2..53
          lib/fog/aws/requests/iam/detach_user_policy.rb on lines 2..53

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 104.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method start_task has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def start_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/start_task.rb - About 2 hrs to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              module AWS
                class AutoScaling
                  class Real
                    require 'fog/aws/parsers/auto_scaling/basic'
            
            
            Severity: Major
            Found in lib/fog/aws/requests/auto_scaling/detach_load_balancers.rb and 1 other location - About 2 hrs to fix
            lib/fog/aws/requests/auto_scaling/attach_load_balancers.rb on lines 2..53

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 101.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              module AWS
                class AutoScaling
                  class Real
                    require 'fog/aws/parsers/auto_scaling/basic'
            
            
            Severity: Major
            Found in lib/fog/aws/requests/auto_scaling/attach_load_balancers.rb and 1 other location - About 2 hrs to fix
            lib/fog/aws/requests/auto_scaling/detach_load_balancers.rb on lines 2..57

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 101.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method create_service has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def create_service(params={})
                      response = Excon::Response.new
                      response.status = 200
            
                      e = Fog::AWS::ECS::Error
            Severity: Major
            Found in lib/fog/aws/requests/ecs/create_service.rb - About 2 hrs to fix

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

                        def end_element(name)
                          case name
                          when 'DeleteMarker'
                            @response['Versions'] << {'DeleteMarker' => @delete_marker }
                            @delete_marker = { 'Owner' => {} }
              Severity: Minor
              Found in lib/fog/aws/parsers/storage/get_bucket_object_versions.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 20 (exceeds 5 allowed). Consider refactoring.
              Open

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

                        def end_element(name)
                          if @in_tag_set
                            case name
                            when 'item'
                              @subnet['tagSet'][@tag['key']] = @tag['value']
              Severity: Minor
              Found in lib/fog/aws/parsers/compute/describe_subnets.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