Showing 460 of 460 total issues

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

  module Compute
    class VcloudDirector
      class Real
        require 'fog/vcloud_director/generators/compute/create_snapshot'
        def post_create_snapshot(id, options={})
lib/fog/vcloud_director/requests/compute/post_compose_vapp.rb on lines 2..40
lib/fog/vcloud_director/requests/compute/post_recompose_vapp.rb on lines 2..16
lib/fog/vcloud_director/requests/compute/put_config_network_section_vapp.rb on lines 2..21

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 39.

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

          if filter[:id].nil?
            templates.info!(-2,-1,-1)
          elsif filter[:id]
            filter[:id] = filter[:id].to_i if filter[:id].is_a?(String)
            templates.info!(-2, filter[:id], filter[:id])
Severity: Minor
Found in lib/fog/opennebula/requests/compute/template_pool.rb and 1 other location - About 40 mins to fix
lib/fog/opennebula/requests/compute/list_networks.rb on lines 11..16

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 37.

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

          if filter[:id].nil?
            netpool.info!(-2,-1,-1)
          elsif filter[:id]
            filter[:id] = filter[:id].to_i if filter[:id].is_a?(String)
            netpool.info!(-2, filter[:id], filter[:id])
Severity: Minor
Found in lib/fog/opennebula/requests/compute/list_networks.rb and 1 other location - About 40 mins to fix
lib/fog/opennebula/requests/compute/template_pool.rb on lines 36..41

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 37.

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 grid_server_add has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def grid_server_add(image, ip, name, server_ram, options={})
Severity: Minor
Found in lib/fog/go_grid/requests/compute/grid_server_add.rb - About 35 mins to fix

    Method create_instance has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def create_instance(name, image_id, instance_type, location, options)
    Severity: Minor
    Found in lib/fog/ibm/core.rb - About 35 mins to fix

      Method create_instance has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def create_instance(name, image_id, instance_type, location, options={})
      Severity: Minor
      Found in lib/fog/ibm/requests/compute/create_instance.rb - About 35 mins to fix

        Method create_volume has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                def create_volume(name, format, location_id, size, offering_id)
        Severity: Minor
        Found in lib/fog/ibm/core.rb - About 35 mins to fix

          Method create_volume has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def create_volume(name, offering_id, format, location_id, size)
          Severity: Minor
          Found in lib/fog/ibm/requests/storage/create_volume.rb - About 35 mins to fix

            Method create_volume has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def create_volume(name, offering_id, format, location_id, size)
            Severity: Minor
            Found in lib/fog/ibm/requests/storage/create_volume.rb - About 35 mins to fix

              Method post_upload_media has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      def post_upload_media(vdc_id, name, image_type, size, options={})
              Severity: Minor
              Found in lib/fog/vcloud_director/requests/compute/post_upload_media.rb - About 35 mins to fix

                Method create_record has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def create_record(domain_id, name, content, type, options = {})
                Severity: Minor
                Found in lib/fog/rage4/requests/dns/create_record.rb - About 35 mins to fix

                  Method create_instance has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def create_instance(name, image_id, instance_type, location, options={})
                  Severity: Minor
                  Found in lib/fog/ibm/requests/compute/create_instance.rb - About 35 mins to fix

                    Method update_record has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            def update_record(record_id, name, content, type, options = {})
                    Severity: Minor
                    Found in lib/fog/rage4/requests/dns/update_record.rb - About 35 mins to fix

                      Method post_upload_media has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              def post_upload_media(vdc_id, name, image_type, size, options={})
                      Severity: Minor
                      Found in lib/fog/vcloud_director/requests/compute/post_upload_media.rb - About 35 mins to fix

                        Method linode_disk_createfromdistribution has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                def linode_disk_createfromdistribution(linode_id, distro_id, name, size, password)
                        Severity: Minor
                        Found in lib/fog/linode/requests/compute/linode_disk_createfromdistribution.rb - About 35 mins to fix

                          Method add_nic has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  def add_nic(vlan=nil, ip_v4_conf=nil, ip_v6_conf=nil, model='virtio', boot_order=nil)
                          Severity: Minor
                          Found in lib/fog/cloudsigma/models/server.rb - About 35 mins to fix

                            Method mock_update has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    def mock_update(data, obj_or_collection, status, key, &clean_before_update)
                            Severity: Minor
                            Found in lib/fog/cloudsigma/connection.rb - About 35 mins to fix

                              Method create_record has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      def create_record(domain, name, type, data, options = {})
                              Severity: Minor
                              Found in lib/fog/dnsmadeeasy/requests/dns/create_record.rb - About 35 mins to fix

                                Method linode_disk_createfromdistribution has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        def linode_disk_createfromdistribution(linode_id, distro_id, name, size, password)
                                Severity: Minor
                                Found in lib/fog/linode/requests/compute/linode_disk_createfromdistribution.rb - About 35 mins to fix

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

                                          def get_lease_settings_section_vapp(id)
                                  
                                            type = 'application/vnd.vmware.vcloud.leaseSettingsSection+xml'
                                  
                                            unless vapp = data[:vapps][id]
                                  lib/fog/vcloud_director/requests/compute/get_vapp_owner.rb on lines 25..39

                                  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 36.

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language