cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

      def update_spec(spec)
        properties = spec.properties

        properties['vcenter'] =
          config.spec_properties['vcenter'] ||
bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/vcloud.rb on lines 23..31

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

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

    def set_vm_metadata(server_id, metadata)
      with_thread_name("set_vm_metadata(#{server_id}, ...)") do
        with_openstack do
          server = @openstack.servers.get(server_id)
          cloud_error("Server `#{server_id}' not found") unless server
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 30 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb on lines 549..556

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

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

    create_data_type("vim.host.VirtualNicManager.NetConfig", "VirtualNicManagerNetConfig", "vmodl.DynamicData", "vim.version.version5", [["nicType", "string", "vim.version.version5"], ["multiSelectAllowed", "boolean", "vim.version.version5"], ["candidateVnic", "vim.host.VirtualNic[]", "vim.version.version5", {:linkable => true, :optional => true}], ["selectedVnic", "vim.host.VirtualNic[]", "vim.version.version5", {:link => true, :optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1261..1261

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

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

        begin
          instance  = openstack.servers.find { |s| s.name == instance_id }
        rescue Excon::Errors::Unauthorized => e
          unless retried
            retried = true
Severity: Minor
Found in bosh-registry/lib/bosh/registry/instance_manager/openstack.rb and 1 other location - About 30 mins to fix
bosh-registry/lib/bosh/registry/instance_manager/cloudstack.rb on lines 51..60

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

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

        templates_to_delete.each do |template|
          track_and_log("#{template.name}/#{template.version}") do
            logger.info("Template #{template.name}/#{template.version} " +
                        "is only used by this release version " +
                        "and will be deleted")
Severity: Minor
Found in bosh-director/lib/bosh/director/jobs/delete_release.rb and 1 other location - About 30 mins to fix
bosh-director/lib/bosh/director/jobs/delete_release.rb on lines 51..56

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

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

        begin
          instance  = cloudstack.servers.find { |s| s.name == instance_id }
        rescue Excon::Errors::Unauthorized => e
          unless retried
            retried = true
Severity: Minor
Found in bosh-registry/lib/bosh/registry/instance_manager/cloudstack.rb and 1 other location - About 30 mins to fix
bosh-registry/lib/bosh/registry/instance_manager/openstack.rb on lines 52..61

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

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

      openstack_params = {
        :provider => 'OpenStack',
        :openstack_auth_url => @openstack_properties['auth_url'],
        :openstack_username => @openstack_properties['username'],
        :openstack_api_key => @openstack_properties['api_key'],
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 30 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 65..73

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

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

    create_data_type("vim.dvs.NetworkResourcePool", "DVSNetworkResourcePool", "vmodl.DynamicData", "vim.version.version6", [["key", "string", "vim.version.version6"], ["name", "string", "vim.version.version6", {:optional => true}], ["description", "string", "vim.version.version6", {:optional => true}], ["configVersion", "string", "vim.version.version6"], ["allocationInfo", "vim.dvs.NetworkResourcePool.AllocationInfo", "vim.version.version6"]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1555..1555

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

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

      glance_params = {
        :provider => 'OpenStack',
        :openstack_auth_url => @openstack_properties['auth_url'],
        :openstack_username => @openstack_properties['username'],
        :openstack_api_key => @openstack_properties['api_key'],
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 30 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 48..56

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

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

    def parse_openstack_response(response, *keys)
      unless response.body.empty?
        begin
          body = JSON.parse(response.body)
          key = keys.detect { |k| body.has_key?(k)}
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/helpers.rb and 1 other location - About 30 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/helpers.rb on lines 48..58

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.host.DatastoreBrowser.FileInfo", "FileInfo", "vmodl.DynamicData", "vim.version.version1", [["path", "string", "vim.version.version1"], ["fileSize", "long", "vim.version.version1", {:optional => true}], ["modification", "vmodl.DateTime", "vim.version.version1", {:optional => true}], ["owner", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.StorageResourceManager.PodStorageDrsEntry", "PodStorageDrsEntry", "vmodl.DynamicData", "vim.version.version7", [["storageDrsConfig", "vim.storageDrs.ConfigInfo", "vim.version.version7"], ["recommendation", "vim.cluster.Recommendation[]", "vim.version.version7", {:optional => true}], ["drsFault", "vim.cluster.DrsFaults[]", "vim.version.version7", {:optional => true}], ["actionHistory", "vim.cluster.ActionHistory[]", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.host.VirtualSwitch.Specification", "HostVirtualSwitchSpec", "vmodl.DynamicData", "vim.version.version1", [["numPorts", "int", "vim.version.version1"], ["bridge", "vim.host.VirtualSwitch.Bridge", "vim.version.version1", {:optional => true}], ["policy", "vim.host.NetworkPolicy", "vim.version.version1", {:optional => true}], ["mtu", "int", "vim.version.version2", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.vm.DeviceRuntimeInfo.VirtualEthernetCardRuntimeState", "VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState", "vim.vm.DeviceRuntimeInfo.DeviceRuntimeState", "vim.version.version6", [["vmDirectPathGen2Active", "boolean", "vim.version.version6"], ["vmDirectPathGen2InactiveReasonVm", "string[]", "vim.version.version6", {:optional => true}], ["vmDirectPathGen2InactiveReasonOther", "string[]", "vim.version.version6", {:optional => true}], ["vmDirectPathGen2InactiveReasonExtended", "string", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.OvfManager.ResourceMap", "OvfResourceMap", "vmodl.DynamicData", "vim.version.version6", [["source", "string", "vim.version.version6"], ["parent", "vim.ResourcePool", "vim.version.version6", {:optional => true}], ["resourceSpec", "vim.ResourceConfigSpec", "vim.version.version6", {:optional => true}], ["datastore", "vim.Datastore", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.dvs.PortConnection", "DistributedVirtualSwitchPortConnection", "vmodl.DynamicData", "vim.version.version5", [["switchUuid", "string", "vim.version.version5"], ["portgroupKey", "string", "vim.version.version5", {:optional => true}], ["portKey", "string", "vim.version.version5", {:optional => true}], ["connectionCookie", "int", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.profile.ProfileMetadata", "ProfileMetadata", "vmodl.DynamicData", "vim.version.version5", [["key", "vmodl.TypeName", "vim.version.version5"], ["profileTypeName", "string", "vim.version.version7", {:optional => true}], ["description", "vim.ExtendedDescription", "vim.version.version5", {:optional => true}], ["sortSpec", "vim.profile.ProfileMetadata.ProfileSortSpec[]", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.HbrManager.ReplicationVmInfo", "HbrManagerReplicationVmInfo", "vmodl.DynamicData", "vim.version.version7", [["state", "string", "vim.version.version7"], ["progressInfo", "vim.HbrManager.ReplicationVmInfo.ProgressInfo", "vim.version.version7", {:optional => true}], ["imageId", "string", "vim.version.version7", {:optional => true}], ["lastError", "vmodl.MethodFault", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.OvfManager.CreateDescriptorResult", "OvfCreateDescriptorResult", "vmodl.DynamicData", "vim.version.version5", [["ovfDescriptor", "string", "vim.version.version5"], ["error", "vmodl.MethodFault[]", "vim.version.version5", {:optional => true}], ["warning", "vmodl.MethodFault[]", "vim.version.version5", {:optional => true}], ["includeImageFiles", "boolean", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1518..1518
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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 15 locations. Consider refactoring.
Open

    create_data_type("vim.vApp.CloneSpec.ResourceMap", "VAppCloneSpecResourceMap", "vmodl.DynamicData", "vim.version.version6", [["source", "vim.ManagedEntity", "vim.version.version6"], ["parent", "vim.ResourcePool", "vim.version.version6", {:optional => true}], ["resourceSpec", "vim.ResourceConfigSpec", "vim.version.version6", {:optional => true}], ["location", "vim.Datastore", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 242..242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 300..300
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 305..305
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 364..364
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 455..455
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 493..493
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 505..505
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1045..1045
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1100..1100
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1150..1150
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1350..1350
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1418..1418
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1567..1567
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2289..2289

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

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