cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

    create_managed_type("vim.ExtensionManager", "ExtensionManager", "vmodl.ManagedObject", "vim.version.version2", [["extensionList", "vim.Extension[]", "vim.version.version2", {:optional => true}, "System.View"]], [["unregisterExtension", "UnregisterExtension", "vim.version.version2", [["extensionKey", "string", "vim.version.version2", {}, nil]], [{}, "void", "void"], "Extension.Unregister", ["vim.fault.NotFound"]], ["findExtension", "FindExtension", "vim.version.version2", [["extensionKey", "string", "vim.version.version2", {}, nil]], [{:optional => true}, "vim.Extension", "vim.Extension"], "System.View", nil], ["registerExtension", "RegisterExtension", "vim.version.version2", [["extension", "vim.Extension", "vim.version.version2", {}, nil]], [{}, "void", "void"], "Extension.Register", nil], ["updateExtension", "UpdateExtension", "vim.version.version2", [["extension", "vim.Extension", "vim.version.version2", {}, nil]], [{}, "void", "void"], "Extension.Update", ["vim.fault.NotFound"]], ["getPublicKey", "GetPublicKey", "vim.version.version2", [], [{}, "string", "string"], "System.View", nil], ["setPublicKey", "SetPublicKey", "vim.version.version2", [["extensionKey", "string", "vim.version.version2", {}, nil], ["publicKey", "string", "vim.version.version2", {}, nil]], [{}, "void", "void"], "Extension.Update", nil], ["setCertificate", "SetExtensionCertificate", "vim.version.version5", [["extensionKey", "string", "vim.version.version5", {}, nil], ["certificatePem", "string", "vim.version.version5", {:optional => true}, nil]], [{}, "void", "void"], "Extension.Update", ["vim.fault.NotFound", "vim.fault.NoClientCertificate"]], ["queryManagedBy", "QueryManagedBy", "vim.version.version7", [["extensionKey", "string", "vim.version.version7", {}, nil]], [{:optional => true}, "vim.ManagedEntity[]", "vim.ManagedEntity[]"], "System.View", nil]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 20 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 283..283
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 347..347
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1817..1817
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2238..2238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2269..2269
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2402..2402

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

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_managed_type("vim.HostSystem", "HostSystem", "vim.ManagedEntity", "vim.version.version1", [["runtime", "vim.host.RuntimeInfo", "vim.version.version1", {}, nil], ["summary", "vim.host.Summary", "vim.version.version1", {}, nil], ["hardware", "vim.host.HardwareInfo", "vim.version.version1", {:optional => true}, nil], ["capability", "vim.host.Capability", "vim.version.version1", {:optional => true}, nil], ["licensableResource", "vim.LicenseManager.LicensableResourceInfo", "vim.version.version7", {}, nil], ["configManager", "vim.host.ConfigManager", "vim.version.version1", {}, nil], ["config", "vim.host.ConfigInfo", "vim.version.version1", {:optional => true}, nil], ["vm", "vim.VirtualMachine[]", "vim.version.version1", {:optional => true}, nil], ["datastore", "vim.Datastore[]", "vim.version.version1", {:optional => true}, "System.View"], ["network", "vim.Network[]", "vim.version.version1", {:optional => true}, "System.View"], ["datastoreBrowser", "vim.host.DatastoreBrowser", "vim.version.version1", {}, "System.View"], ["systemResources", "vim.host.SystemResourceInfo", "vim.version.version1", {:optional => true}, nil]], [["queryConnectionInfo", "QueryHostConnectionInfo", "vim.version.version1", [], [{}, "vim.host.ConnectInfo", "vim.host.ConnectInfo"], "System.Read", nil], ["updateSystemResources", "UpdateSystemResources", "vim.version.version1", [["resourceInfo", "vim.host.SystemResourceInfo", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Host.Config.Resources", nil], ["querySystemResourceUsage", "QuerySystemResourceUsage", "vim.version.dev", [], [{}, "vim.host.SystemResourceUsage", "vim.host.SystemResourceUsage"], "System.Read", nil], ["reconnect", "ReconnectHost_Task", "vim.version.version1", [["cnxSpec", "vim.host.ConnectSpec", "vim.version.version1", {:optional => true}, nil], ["reconnectSpec", "vim.HostSystem.ReconnectSpec", "vim.version.version7", {:optional => true}, nil]], [{}, "vim.Task", "void"], "Host.Config.Connection", ["vim.fault.InvalidLogin", "vim.fault.InvalidState", "vim.fault.InvalidName", "vim.fault.HostConnectFault"]], ["disconnect", "DisconnectHost_Task", "vim.version.version1", [], [{}, "vim.Task", "void"], "Host.Config.Connection", nil], ["enterMaintenanceMode", "EnterMaintenanceMode_Task", "vim.version.version1", [["timeout", "int", "vim.version.version1", {}, nil], ["evacuatePoweredOffVms", "boolean", "vim.version.version2", {:optional => true}, nil]], [{}, "vim.Task", "void"], "Host.Config.Maintenance", ["vim.fault.InvalidState", "vim.fault.Timedout"]], ["exitMaintenanceMode", "ExitMaintenanceMode_Task", "vim.version.version1", [["timeout", "int", "vim.version.version1", {}, nil]], [{}, "vim.Task", "void"], "Host.Config.Maintenance", ["vim.fault.InvalidState", "vim.fault.Timedout"]], ["reboot", "RebootHost_Task", "vim.version.version1", [["force", "boolean", "vim.version.version1", {}, nil]], [{}, "vim.Task", "void"], "Host.Config.Maintenance", ["vim.fault.InvalidState"]], ["shutdown", "ShutdownHost_Task", "vim.version.version1", [["force", "boolean", "vim.version.version1", {}, nil]], [{}, "vim.Task", "void"], "Host.Config.Maintenance", ["vim.fault.InvalidState"]], ["enterStandbyMode", "PowerDownHostToStandBy_Task", "vim.version.version2", [["timeoutSec", "int", "vim.version.version2", {}, nil], ["evacuatePoweredOffVms", "boolean", "vim.version.version2", {:optional => true}, nil]], [{}, "vim.Task", "void"], "Host.Config.Maintenance", ["vim.fault.HostPowerOpFailed", "vim.fault.InvalidState", "vmodl.fault.NotSupported", "vim.fault.Timedout", "vmodl.fault.RequestCanceled"]], ["exitStandbyMode", "PowerUpHostFromStandBy_Task", "vim.version.version2", [["timeoutSec", "int", "vim.version.version2", {}, nil]], [{}, "vim.Task", "void"], "Host.Config.Maintenance", ["vim.fault.HostPowerOpFailed", "vim.fault.InvalidState", "vmodl.fault.NotSupported", "vim.fault.Timedout"]], ["queryOverhead", "QueryMemoryOverhead", "vim.version.version1", [["memorySize", "long", "vim.version.version1", {}, nil], ["videoRamSize", "int", "vim.version.version1", {:optional => true}, nil], ["numVcpus", "int", "vim.version.version1", {}, nil]], [{}, "long", "long"], "System.Read", nil], ["queryOverheadEx", "QueryMemoryOverheadEx", "vim.version.version2", [["vmConfigInfo", "vim.vm.ConfigInfo", "vim.version.version2", {}, nil]], [{}, "long", "long"], "System.Read", nil], ["reconfigureDAS", "ReconfigureHostForDAS_Task", "vim.version.version1", [], [{}, "vim.Task", "void"], "Host.Config.Connection", ["vim.fault.DasConfigFault"]], ["updateFlags", "UpdateFlags", "vim.version.version2", [["flagInfo", "vim.host.FlagInfo", "vim.version.version2", {}, nil]], [{}, "void", "void"], "Host.Config.Settings", nil], ["enterLockdownMode", "EnterLockdownMode", "vim.version.version6", [], [{}, "void", "void"], "Host.Config.Settings", ["vim.fault.HostConfigFault"]], ["exitLockdownMode", "ExitLockdownMode", "vim.version.version6", [], [{}, "void", "void"], "Host.Config.Settings", ["vim.fault.HostConfigFault"]], ["acquireCimServicesTicket", "AcquireCimServicesTicket", "vim.version.version2", [], [{}, "vim.HostServiceTicket", "vim.HostServiceTicket"], "Host.Cim.CimInteraction", nil], ["updateIpmi", "UpdateIpmi", "vim.version.version5", [["ipmiInfo", "vim.host.IpmiInfo", "vim.version.version5", {}, nil]], [{}, "void", "void"], "Host.Config.Settings", ["vim.fault.InvalidIpmiLoginInfo", "vim.fault.InvalidIpmiMacAddress"]], ["retrieveHardwareUptime", "RetrieveHardwareUptime", "vim.version.version6", [], [{}, "long", "long"], "System.Read", nil]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 14 other locations - About 20 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 239..239
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 283..283
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 347..347
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1817..1817
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2238..2238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2269..2269

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

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_managed_type("vim.dvs.DistributedVirtualSwitchManager", "DistributedVirtualSwitchManager", "vmodl.ManagedObject", "vim.version.version5", nil, [["querySupportedSwitchSpec", "QueryAvailableDvsSpec", "vim.version.version5", [], [{:optional => true}, "vim.dvs.ProductSpec[]", "vim.dvs.ProductSpec[]"], "System.View", nil], ["queryCompatibleHostForNewDvs", "QueryCompatibleHostForNewDvs", "vim.version.version5", [["container", "vim.ManagedEntity", "vim.version.version5", {}, nil], ["recursive", "boolean", "vim.version.version5", {}, nil], ["switchProductSpec", "vim.dvs.ProductSpec", "vim.version.version5", {:optional => true}, nil]], [{:optional => true}, "vim.HostSystem[]", "vim.HostSystem[]"], "System.View", nil], ["queryCompatibleHostForExistingDvs", "QueryCompatibleHostForExistingDvs", "vim.version.version5", [["container", "vim.ManagedEntity", "vim.version.version5", {}, nil], ["recursive", "boolean", "vim.version.version5", {}, nil], ["dvs", "vim.DistributedVirtualSwitch", "vim.version.version5", {}, nil]], [{:optional => true}, "vim.HostSystem[]", "vim.HostSystem[]"], "System.View", nil], ["queryCompatibleHostSpec", "QueryDvsCompatibleHostSpec", "vim.version.version5", [["switchProductSpec", "vim.dvs.ProductSpec", "vim.version.version5", {:optional => true}, nil]], [{:optional => true}, "vim.dvs.HostProductSpec[]", "vim.dvs.HostProductSpec[]"], "System.View", nil], ["queryFeatureCapability", "QueryDvsFeatureCapability", "vim.version.version6", [["switchProductSpec", "vim.dvs.ProductSpec", "vim.version.version6", {:optional => true}, nil]], [{:optional => true}, "vim.DistributedVirtualSwitch.FeatureCapability", "vim.DistributedVirtualSwitch.FeatureCapability"], "System.View", nil], ["querySwitchByUuid", "QueryDvsByUuid", "vim.version.version5", [["uuid", "string", "vim.version.version5", {}, nil]], [{:optional => true}, "vim.DistributedVirtualSwitch", "vim.DistributedVirtualSwitch"], "System.View", ["vim.fault.NotFound"]], ["queryDvsConfigTarget", "QueryDvsConfigTarget", "vim.version.version5", [["host", "vim.HostSystem", "vim.version.version5", {:optional => true}, nil], ["dvs", "vim.DistributedVirtualSwitch", "vim.version.version5", {:optional => true}, nil]], [{}, "vim.dvs.DistributedVirtualSwitchManager.DvsConfigTarget", "vim.dvs.DistributedVirtualSwitchManager.DvsConfigTarget"], "System.View", nil], ["checkCompatibility", "QueryDvsCheckCompatibility", "vim.version.version6", [["hostContainer", "vim.dvs.DistributedVirtualSwitchManager.HostContainer", "vim.version.version6", {}, nil], ["dvsProductSpec", "vim.dvs.DistributedVirtualSwitchManager.DvsProductSpec", "vim.version.version6", {:optional => true}, nil], ["hostFilterSpec", "vim.dvs.DistributedVirtualSwitchManager.HostDvsFilterSpec[]", "vim.version.version6", {:optional => true}, nil]], [{:optional => true}, "vim.dvs.DistributedVirtualSwitchManager.CompatibilityResult[]", "vim.dvs.DistributedVirtualSwitchManager.CompatibilityResult[]"], "System.View", nil], ["rectifyHost", "RectifyDvsOnHost_Task", "vim.version.version7", [["hosts", "vim.HostSystem[]", "vim.version.version7", {}, nil]], [{}, "vim.Task", "void"], "System.Read", ["vim.fault.DvsFault"]]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 20 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1392..1392
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1392..1392

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

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 select_availability_zone(volumes, resource_pool_az)
      if volumes && !volumes.empty?
        disks = volumes.map { |vid| with_openstack { @openstack.volumes.get(vid) } }
        ensure_same_availability_zone(disks, resource_pool_az)
        disks.first.availability_zone
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 20 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb on lines 580..587

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

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 find_ebs_device(sd_name)
      xvd_name = sd_name.gsub(/^\/dev\/sd/, "/dev/xvd")

      DEVICE_POLL_TIMEOUT.times do
        if File.blockdev?(sd_name)
Severity: Minor
Found in bosh_aws_cpi/lib/cloud/aws/cloud.rb and 1 other location - About 20 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb on lines 626..639

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

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 find_volume_device(sd_name)
      # need also xvd?
      vd_name = sd_name.gsub(/^\/dev\/sd/, "/dev/vd")

      DEVICE_POLL_TIMEOUT.times do
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 20 mins to fix
bosh_aws_cpi/lib/cloud/aws/cloud.rb on lines 451..463

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

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 write_dhcp_conf
      template = ERB.new(load_erb("dhclient_conf.erb"), 0, '%<>-')
      result = template.result(binding)
      updated = Bosh::Agent::Util::update_file(result, '/etc/dhcp/dhclient.conf')
      if updated
Severity: Minor
Found in bosh_agent/lib/bosh_agent/platform/centos/network.rb and 1 other location - About 20 mins to fix
bosh_agent/lib/bosh_agent/platform/ubuntu/network.rb on lines 11..17

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

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 write_network_interfaces
      template = ERB.new(load_erb('interfaces.erb'), 0, '%<>-')
      result = template.result(binding)
      network_updated = Bosh::Agent::Util::update_file(result, '/etc/network/interfaces')
      if network_updated
Severity: Minor
Found in bosh_agent/lib/bosh_agent/platform/ubuntu/network.rb and 1 other location - About 20 mins to fix
bosh_agent/lib/bosh_agent/platform/centos/network.rb on lines 23..29

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

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 select_availability_zone(volumes, resource_pool_az)
      if volumes && !volumes.empty?
        disks = volumes.map { |vid| with_compute { @compute.volumes.get(vid) } }
        ensure_same_availability_zone(disks, resource_pool_az)
        disks.first.zone_name
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 20 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 603..610

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

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

    create_data_type("vim.profile.host.VirtualSwitchProfile", "VirtualSwitchProfile", "vim.profile.ApplyProfile", "vim.version.version5", [["key", "string", "vim.version.version5"], ["name", "string", "vim.version.version5"], ["link", "vim.profile.host.VirtualSwitchProfile.LinkProfile", "vim.version.version5"], ["numPorts", "vim.profile.host.VirtualSwitchProfile.NumPortsProfile", "vim.version.version5"], ["networkPolicy", "vim.profile.host.NetworkPolicyProfile", "vim.version.version5"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 231..231
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 445..445
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1097..1097
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1193..1193
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1242..1242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1303..1303
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1330..1330
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2196..2196

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

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

    create_data_type("vim.cluster.DrsRecommendation", "ClusterDrsRecommendation", "vmodl.DynamicData", "vim.version.version1", [["key", "string", "vim.version.version1"], ["rating", "int", "vim.version.version1"], ["reason", "string", "vim.version.version1"], ["reasonText", "string", "vim.version.version1"], ["migrationList", "vim.cluster.DrsMigration[]", "vim.version.version1"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 231..231
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1097..1097
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1193..1193
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1242..1242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1303..1303
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1330..1330
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1459..1459
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2196..2196

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

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

    create_data_type("vim.host.UnresolvedVmfsVolume", "HostUnresolvedVmfsVolume", "vmodl.DynamicData", "vim.version.version5", [["extent", "vim.host.UnresolvedVmfsExtent[]", "vim.version.version5"], ["vmfsLabel", "string", "vim.version.version5"], ["vmfsUuid", "string", "vim.version.version5"], ["totalBlocks", "int", "vim.version.version5"], ["resolveStatus", "vim.host.UnresolvedVmfsVolume.ResolveStatus", "vim.version.version5"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 231..231
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 445..445
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1097..1097
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1193..1193
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1242..1242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1303..1303
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1459..1459
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2196..2196

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

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

    create_data_type("vim.host.SnmpSystem.AgentLimits", "HostSnmpSystemAgentLimits", "vmodl.DynamicData", "vim.version.version2", [["maxReadOnlyCommunities", "int", "vim.version.version2"], ["maxTrapDestinations", "int", "vim.version.version2"], ["maxCommunityLength", "int", "vim.version.version2"], ["maxBufferSize", "int", "vim.version.version2"], ["capability", "vim.host.SnmpSystem.AgentLimits.Capability", "vim.version.version5"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 231..231
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 445..445
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1097..1097
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1193..1193
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1242..1242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1330..1330
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1459..1459
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2196..2196

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

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

    create_data_type("vim.host.FcoeConfig", "FcoeConfig", "vmodl.DynamicData", "vim.version.version7", [["priorityClass", "int", "vim.version.version7"], ["sourceMac", "string", "vim.version.version7"], ["vlanRange", "vim.host.FcoeConfig.VlanRange[]", "vim.version.version7"], ["capabilities", "vim.host.FcoeConfig.FcoeCapabilities", "vim.version.version7"], ["fcoeActive", "boolean", "vim.version.version7"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 231..231
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 445..445
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1193..1193
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1242..1242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1303..1303
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1330..1330
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1459..1459
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2196..2196

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

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

    create_data_type("vim.host.LowLevelProvisioningManager.DiskLayoutSpec", "HostLowLevelProvisioningManagerDiskLayoutSpec", "vmodl.DynamicData", "vim.version.version7", [["controllerType", "vmodl.TypeName", "vim.version.version7"], ["busNumber", "int", "vim.version.version7"], ["unitNumber", "int", "vim.version.version7"], ["srcFilename", "string", "vim.version.version7"], ["dstFilename", "string", "vim.version.version7"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 231..231
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 445..445
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1097..1097
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1242..1242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1303..1303
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1330..1330
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1459..1459
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2196..2196

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

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

    create_data_type("vim.fault.VAppPropertyFault", "VAppPropertyFault", "vim.fault.VmConfigFault", "vim.version.version5", [["id", "string", "vim.version.version5"], ["category", "string", "vim.version.version5"], ["label", "string", "vim.version.version5"], ["type", "string", "vim.version.version5"], ["value", "string", "vim.version.version5"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 231..231
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 445..445
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1097..1097
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1193..1193
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1242..1242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1303..1303
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1330..1330
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1459..1459
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486

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

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

    create_data_type("vim.host.PciPassthruInfo", "HostPciPassthruInfo", "vmodl.DynamicData", "vim.version.version5", [["id", "string", "vim.version.version5"], ["dependentDevice", "string", "vim.version.version5"], ["passthruEnabled", "boolean", "vim.version.version5"], ["passthruCapable", "boolean", "vim.version.version5"], ["passthruActive", "boolean", "vim.version.version5"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 231..231
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 445..445
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1097..1097
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1193..1193
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1303..1303
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1330..1330
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1459..1459
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2196..2196

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

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

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

    def initialize_registry
      registry_properties = @options.fetch('registry')
      registry_endpoint   = registry_properties.fetch('endpoint')
      registry_user       = registry_properties.fetch('user')
      registry_password   = registry_properties.fetch('password')
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 15 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 918..926

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

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

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

    def initialize_registry
      registry_properties = @options.fetch('registry')
      registry_endpoint   = registry_properties.fetch('endpoint')
      registry_user       = registry_properties.fetch('user')
      registry_password   = registry_properties.fetch('password')
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 15 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb on lines 874..882

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

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

    create_data_type("vim.Extension.ClientInfo", "ExtensionClientInfo", "vmodl.DynamicData", "vim.version.version2", [["version", "string", "vim.version.version2"], ["description", "vim.Description", "vim.version.version2"], ["company", "string", "vim.version.version2"], ["type", "string", "vim.version.version2"], ["url", "string", "vim.version.version2"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 11 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 445..445
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1097..1097
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1193..1193
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1213..1213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1242..1242
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1303..1303
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1330..1330
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1459..1459
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1462..1462
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1486..1486
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2196..2196

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

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