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

module Bosh::Dev::Openstack
  class RunnerBuilder
    def build(artifacts, net_type)
      env    = ENV
      logger = Logger.new(STDOUT)
Severity: Major
Found in bosh-dev/lib/bosh/dev/openstack/runner_builder.rb and 1 other location - About 1 hr to fix
bosh-dev/lib/bosh/dev/cloudstack/runner_builder.rb on lines 11..36

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

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

    create_data_type("vim.host.SystemResourceSpec", "HostSystemResourceSpec", "vim.ResourceConfigSpec", "vim.version.dev", [["maxFileSize", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}], ["fileDescriptors", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}], ["iNodes", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}], ["sockets", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}], ["afInetSockets", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}], ["afLocalSockets", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}], ["threads", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}], ["semaphores", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}], ["diskBlocks", "vim.host.SystemResourceSpec.ResourceSettings", "vim.version.dev", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1510..1510
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1520..1520
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1526..1526
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2322..2322

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

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

    create_data_type("vim.vApp.IpPool", "IpPool", "vmodl.DynamicData", "vim.version.version5", [["id", "int", "vim.version.version5", {:optional => true}], ["name", "string", "vim.version.version5", {:optional => true}], ["ipv4Config", "vim.vApp.IpPool.IpPoolConfigInfo", "vim.version.version5", {:optional => true}], ["ipv6Config", "vim.vApp.IpPool.IpPoolConfigInfo", "vim.version.version5", {:optional => true}], ["dnsDomain", "string", "vim.version.version5", {:optional => true}], ["dnsSearchPath", "string", "vim.version.version5", {:optional => true}], ["hostPrefix", "string", "vim.version.version5", {:optional => true}], ["httpProxy", "string", "vim.version.version5", {:optional => true}], ["networkAssociation", "vim.vApp.IpPool.Association[]", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1313..1313
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1510..1510
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1520..1520
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2322..2322

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

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 attach_disk(server_id, disk_id)
      with_thread_name("attach_disk(#{server_id}, #{disk_id})") do
        server = with_compute { @compute.servers.get(server_id) }
        cloud_error("Server `#{server_id}' not found") unless server

Severity: Major
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 1 hr to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 474..487

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

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 attach_disk(server_id, disk_id)
      with_thread_name("attach_disk(#{server_id}, #{disk_id})") do
        server = with_openstack { @openstack.servers.get(server_id) }
        cloud_error("Server `#{server_id}' not found") unless server

Severity: Major
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 1 hr to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb on lines 445..458

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

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

    create_data_type("vim.vApp.EntityConfigInfo", "VAppEntityConfigInfo", "vmodl.DynamicData", "vim.version.version5", [["key", "vim.ManagedEntity", "vim.version.version5", {:optional => true}], ["tag", "string", "vim.version.version5", {:optional => true}], ["startOrder", "int", "vim.version.version5", {:optional => true}], ["startDelay", "int", "vim.version.version5", {:optional => true}], ["waitingForGuest", "boolean", "vim.version.version5", {:optional => true}], ["startAction", "string", "vim.version.version5", {:optional => true}], ["stopDelay", "int", "vim.version.version5", {:optional => true}], ["stopAction", "string", "vim.version.version5", {:optional => true}], ["destroyWithParent", "boolean", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1313..1313
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1510..1510
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1526..1526
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2322..2322

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

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

    create_data_type("vim.storageDrs.PodConfigSpec", "StorageDrsPodConfigSpec", "vmodl.DynamicData", "vim.version.version7", [["enabled", "boolean", "vim.version.version7", {:optional => true}], ["ioLoadBalanceEnabled", "boolean", "vim.version.version7", {:optional => true}], ["defaultVmBehavior", "string", "vim.version.version7", {:optional => true}], ["loadBalanceInterval", "int", "vim.version.version7", {:optional => true}], ["defaultIntraVmAffinity", "boolean", "vim.version.version7", {:optional => true}], ["spaceLoadBalanceConfig", "vim.storageDrs.SpaceLoadBalanceConfig", "vim.version.version7", {:optional => true}], ["ioLoadBalanceConfig", "vim.storageDrs.IoLoadBalanceConfig", "vim.version.version7", {:optional => true}], ["rule", "vim.cluster.RuleSpec[]", "vim.version.version7", {:optional => true}], ["option", "vim.storageDrs.OptionSpec[]", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1313..1313
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1520..1520
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1526..1526
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2322..2322

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

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

    create_data_type("vim.vm.Summary.GuestSummary", "VirtualMachineGuestSummary", "vmodl.DynamicData", "vim.version.version1", [["guestId", "string", "vim.version.version1", {:optional => true}], ["guestFullName", "string", "vim.version.version1", {:optional => true}], ["toolsStatus", "vim.vm.GuestInfo.ToolsStatus", "vim.version.version1", {:optional => true}], ["toolsVersionStatus", "string", "vim.version.version5", {:optional => true}], ["toolsVersionStatus2", "string", "vim.version.version7", {:optional => true}], ["toolsRunningStatus", "string", "vim.version.version5", {:optional => true}], ["hostName", "string", "vim.version.version1", {:optional => true}], ["ipAddress", "string", "vim.version.version1", {:optional => true}], ["ipList", "string[]", "vim.version.logan", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1313..1313
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1510..1510
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1520..1520
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1526..1526

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

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 detach_disk(server_id, disk_id)
      with_thread_name("detach_disk(#{server_id}, #{disk_id})") do
        server = with_openstack { @openstack.servers.get(server_id) }
        cloud_error("Server `#{server_id}' not found") unless server

Severity: Major
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 1 hr to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb on lines 469..482

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

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 detach_disk(server_id, disk_id)
      with_thread_name("detach_disk(#{server_id}, #{disk_id})") do
        server = with_compute { @compute.servers.get(server_id) }
        cloud_error("Server `#{server_id}' not found") unless server

Severity: Major
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 1 hr to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 498..511

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

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

    create_data_type("vim.vm.customization.IPSettings", "CustomizationIPSettings", "vmodl.DynamicData", "vim.version.version1", [["ip", "vim.vm.customization.IpGenerator", "vim.version.version1"], ["subnetMask", "string", "vim.version.version1", {:optional => true}], ["gateway", "string[]", "vim.version.version1", {:optional => true}], ["ipV6Spec", "vim.vm.customization.IPSettings.IpV6AddressSpec", "vim.version.version5", {:optional => true}], ["dnsServerList", "string[]", "vim.version.version1", {:optional => true}], ["dnsDomain", "string", "vim.version.version1", {:optional => true}], ["primaryWINS", "string", "vim.version.version1", {:optional => true}], ["secondaryWINS", "string", "vim.version.version1", {:optional => true}], ["netBIOS", "vim.vm.customization.IPSettings.NetBIOSMode", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 298..298
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2257..2257

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

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

    create_data_type("vim.OvfManager.CreateImportSpecParams", "OvfCreateImportSpecParams", "vim.OvfManager.CommonParams", "vim.version.version5", [["entityName", "string", "vim.version.version5"], ["hostSystem", "vim.HostSystem", "vim.version.version5", {:optional => true}], ["networkMapping", "vim.OvfManager.NetworkMapping[]", "vim.version.version5", {:optional => true}], ["ipAllocationPolicy", "string", "vim.version.version5", {:optional => true}], ["ipProtocol", "string", "vim.version.version5", {:optional => true}], ["propertyMapping", "vim.KeyValue[]", "vim.version.version5", {:optional => true}], ["resourceMapping", "vim.OvfManager.ResourceMap[]", "vim.version.version6", {:optional => true}], ["diskProvisioning", "string", "vim.version.version6", {:optional => true}], ["instantiationOst", "vim.OvfConsumer.OstNode", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1638..1638
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2257..2257

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

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

    create_data_type("vim.host.InternetScsiHba.AuthenticationProperties", "HostInternetScsiHbaAuthenticationProperties", "vmodl.DynamicData", "vim.version.version1", [["chapAuthEnabled", "boolean", "vim.version.version1"], ["chapName", "string", "vim.version.version1", {:optional => true}], ["chapSecret", "string", "vim.version.version1", {:optional => true}], ["chapAuthenticationType", "string", "vim.version.version5", {:optional => true}], ["chapInherited", "boolean", "vim.version.version5", {:optional => true}], ["mutualChapName", "string", "vim.version.version5", {:optional => true}], ["mutualChapSecret", "string", "vim.version.version5", {:optional => true}], ["mutualChapAuthenticationType", "string", "vim.version.version5", {:optional => true}], ["mutualChapInherited", "boolean", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 298..298
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1638..1638

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

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

func (s concretePackageApplier) Prepare(pkg models.Package) error {
    s.logger.Debug(logTag, "Preparing package %v", pkg)

    pkgBundle, err := s.packagesBc.Get(pkg)
    if err != nil {
go_agent/src/bosh/agent/applier/jobapplier/rendered_job_applier.go on lines 52..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 163.

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

func (s renderedJobApplier) Prepare(job models.Job) error {
    s.logger.Debug(logTag, "Preparing job %v", job)

    jobBundle, err := s.jobsBc.Get(job)
    if err != nil {
go_agent/src/bosh/agent/applier/packageapplier/concrete_package_applier.go on lines 45..66

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

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

    create_data_type("vim.cluster.ConfigSpecEx", "ClusterConfigSpecEx", "vim.ComputeResource.ConfigSpec", "vim.version.version2", [["dasConfig", "vim.cluster.DasConfigInfo", "vim.version.version2", {:optional => true}], ["dasVmConfigSpec", "vim.cluster.DasVmConfigSpec[]", "vim.version.version2", {:optional => true}], ["drsConfig", "vim.cluster.DrsConfigInfo", "vim.version.version2", {:optional => true}], ["drsVmConfigSpec", "vim.cluster.DrsVmConfigSpec[]", "vim.version.version2", {:optional => true}], ["rulesSpec", "vim.cluster.RuleSpec[]", "vim.version.version2", {:optional => true}], ["dpmConfig", "vim.cluster.DpmConfigInfo", "vim.version.version2", {:optional => true}], ["dpmHostConfigSpec", "vim.cluster.DpmHostConfigSpec[]", "vim.version.version2", {:optional => true}], ["groupSpec", "vim.cluster.GroupSpec[]", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 3 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1533..1533
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1610..1610
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1712..1712

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

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

                  [{ 'host' => env['BOSH_VSPHERE_VCENTER'],
                     'user' => env['BOSH_VSPHERE_VCENTER_USER'],
                     'password' => env['BOSH_VSPHERE_VCENTER_PASSWORD'],
                     'datacenters' =>
                       [{ 'name' => env['BOSH_VSPHERE_VCENTER_DC'],
bosh-dev/lib/bosh/dev/vsphere/micro_bosh_deployment_manifest.rb on lines 53..70

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

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

    create_data_type("vim.vApp.VmConfigSpec", "VmConfigSpec", "vmodl.DynamicData", "vim.version.version5", [["product", "vim.vApp.ProductSpec[]", "vim.version.version5", {:optional => true}], ["property", "vim.vApp.PropertySpec[]", "vim.version.version5", {:optional => true}], ["ipAssignment", "vim.vApp.IPAssignmentInfo", "vim.version.version5", {:optional => true}], ["eula", "string[]", "vim.version.version5", {:optional => true}], ["ovfSection", "vim.vApp.OvfSectionSpec[]", "vim.version.version5", {:optional => true}], ["ovfEnvironmentTransport", "string[]", "vim.version.version5", {:optional => true}], ["installBootRequired", "boolean", "vim.version.version5", {:optional => true}], ["installBootStopDelay", "int", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 3 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1610..1610
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1712..1712
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2417..2417

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

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

    create_data_type("vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo", "VirtualDiskRawDiskMappingVer1BackingInfo", "vim.vm.device.VirtualDevice.FileBackingInfo", "vim.version.version1", [["lunUuid", "string", "vim.version.version1", {:optional => true}], ["deviceName", "string", "vim.version.version1", {:optional => true}], ["compatibilityMode", "string", "vim.version.version1", {:optional => true}], ["diskMode", "string", "vim.version.version1", {:optional => true}], ["uuid", "string", "vim.version.version2", {:optional => true}], ["contentId", "string", "vim.version.version5", {:optional => true}], ["changeId", "string", "vim.version.version5", {:optional => true}], ["parent", "vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 3 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1533..1533
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1610..1610
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2417..2417

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

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

                  { 'host' => env['BOSH_VSPHERE_VCENTER'],
                    'user' => env['BOSH_VSPHERE_VCENTER_USER'],
                    'password' => env['BOSH_VSPHERE_VCENTER_PASSWORD'],
                    'datacenters' =>
                      [{ 'name' => env['BOSH_VSPHERE_VCENTER_DC'],
bosh-dev/lib/bosh/dev/vsphere/micro_bosh_deployment_manifest.rb on lines 31..49

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

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