cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

    create_data_type("vim.DistributedVirtualSwitch.Capability", "DVSCapability", "vmodl.DynamicData", "vim.version.version5", [["dvsOperationSupported", "boolean", "vim.version.version5", {:optional => true}], ["dvPortGroupOperationSupported", "boolean", "vim.version.version5", {:optional => true}], ["dvPortOperationSupported", "boolean", "vim.version.version5", {:optional => true}], ["compatibleHostComponentProductInfo", "vim.dvs.HostProductSpec[]", "vim.version.version5", {:optional => true}], ["featuresSupported", "vim.DistributedVirtualSwitch.FeatureCapability", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.dvs.VmwareDistributedVirtualSwitch.ConfigSpec", "VMwareDVSConfigSpec", "vim.DistributedVirtualSwitch.ConfigSpec", "vim.version.version5", [["pvlanConfigSpec", "vim.dvs.VmwareDistributedVirtualSwitch.PvlanConfigSpec[]", "vim.version.version5", {:optional => true}], ["vspanConfigSpec", "vim.dvs.VmwareDistributedVirtualSwitch.VspanConfigSpec[]", "vim.version.version7", {:optional => true}], ["maxMtu", "int", "vim.version.version5", {:optional => true}], ["linkDiscoveryProtocolConfig", "vim.host.LinkDiscoveryProtocolConfig", "vim.version.version5", {:optional => true}], ["ipfixConfig", "vim.dvs.VmwareDistributedVirtualSwitch.IpfixConfig", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389

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

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

    create_data_type("vim.vm.device.VirtualVideoCard", "VirtualMachineVideoCard", "vim.vm.device.VirtualDevice", "vim.version.version1", [["videoRamSizeInKB", "long", "vim.version.version1", {:optional => true}], ["numDisplays", "int", "vim.version.version4", {:optional => true}], ["useAutoDetect", "boolean", "vim.version.version4", {:optional => true}], ["enable3DSupport", "boolean", "vim.version.version4", {:optional => true}], ["enableMPTSupport", "boolean", "vim.version.logan", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.host.Summary.QuickStats", "HostListSummaryQuickStats", "vmodl.DynamicData", "vim.version.version1", [["overallCpuUsage", "int", "vim.version.version1", {:optional => true}], ["overallMemoryUsage", "int", "vim.version.version1", {:optional => true}], ["distributedCpuFairness", "int", "vim.version.version1", {:optional => true}], ["distributedMemoryFairness", "int", "vim.version.version1", {:optional => true}], ["uptime", "int", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

func ext۰syscall۰Fstat(fn *ssa.Function, args []value) value {
    // func Fstat(fd int, stat *Stat_t) (err error)
    fd := args[0].(int)
    stat := (*args[1].(*value)).(structure)

go_agent/src/code.google.com/p/go.tools/ssa/interp/external_unix.go on lines 66..75
go_agent/src/code.google.com/p/go.tools/ssa/interp/external_unix.go on lines 113..122

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

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

    create_data_type("vim.host.DatastoreBrowser.SearchSpec", "HostDatastoreBrowserSearchSpec", "vmodl.DynamicData", "vim.version.version1", [["query", "vim.host.DatastoreBrowser.Query[]", "vim.version.version1", {:optional => true}], ["details", "vim.host.DatastoreBrowser.FileInfo.Details", "vim.version.version1", {:optional => true}], ["searchCaseInsensitive", "boolean", "vim.version.version1", {:optional => true}], ["matchPattern", "string[]", "vim.version.version1", {:optional => true}], ["sortFoldersFirst", "boolean", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.vm.BootOptions", "VirtualMachineBootOptions", "vmodl.DynamicData", "vim.version.version2", [["bootDelay", "long", "vim.version.version2", {:optional => true}], ["enterBIOSSetup", "boolean", "vim.version.version2", {:optional => true}], ["bootRetryEnabled", "boolean", "vim.version.version6", {:optional => true}], ["bootRetryDelay", "long", "vim.version.version6", {:optional => true}], ["bootOrder", "vim.vm.BootOptions.BootableDevice[]", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.vm.FileLayout", "VirtualMachineFileLayout", "vmodl.DynamicData", "vim.version.version1", [["configFile", "string[]", "vim.version.version1", {:optional => true}], ["logFile", "string[]", "vim.version.version1", {:optional => true}], ["disk", "vim.vm.FileLayout.DiskLayout[]", "vim.version.version1", {:optional => true}], ["snapshot", "vim.vm.FileLayout.SnapshotLayout[]", "vim.version.version1", {:optional => true}], ["swapFile", "string", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

func ext۰syscall۰Stat(fn *ssa.Function, args []value) value {
    // func Stat(name string, stat *Stat_t) (err error)
    name := args[0].(string)
    stat := (*args[1].(*value)).(structure)

go_agent/src/code.google.com/p/go.tools/ssa/interp/external_unix.go on lines 38..47
go_agent/src/code.google.com/p/go.tools/ssa/interp/external_unix.go on lines 66..75

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

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

    create_data_type("vim.ResourceAllocationInfo", "ResourceAllocationInfo", "vmodl.DynamicData", "vim.version.version1", [["reservation", "long", "vim.version.version1", {:optional => true}], ["expandableReservation", "boolean", "vim.version.version1", {:optional => true}], ["limit", "long", "vim.version.version1", {:optional => true}], ["shares", "vim.SharesInfo", "vim.version.version1", {:optional => true}], ["overheadLimit", "long", "vim.version.version2", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.host.ActiveDirectorySpec.Specification", "HostActiveDirectorySpec", "vmodl.DynamicData", "vim.version.version6", [["domainName", "string", "vim.version.version6", {:optional => true}], ["userName", "string", "vim.version.version6", {:optional => true}], ["password", "string", "vim.version.version6", {:optional => true}], ["camServer", "string", "vim.version.version7", {:optional => true}], ["thumbprint", "string", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.host.AutoStartManager.SystemDefaults", "AutoStartDefaults", "vmodl.DynamicData", "vim.version.version1", [["enabled", "boolean", "vim.version.version1", {:optional => true}], ["startDelay", "int", "vim.version.version1", {:optional => true}], ["stopDelay", "int", "vim.version.version1", {:optional => true}], ["waitForHeartbeat", "boolean", "vim.version.version1", {:optional => true}], ["stopAction", "string", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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 (a *analysis) store(dst, src nodeid, offset uint32, sizeof uint32) {
    if src == 0 {
        return // store of non-pointerlike value
    }
    if src == 0 && dst == 0 {
Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/pointer/gen.go and 1 other location - About 45 mins to fix
go_agent/src/code.google.com/p/go.tools/pointer/gen.go on lines 306..321

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

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

                case asmInterface:
                    addVar(name, asmVar{
                        name: name + "_itable",
                        kind: asmKind(arch.ptrSize),
                        typ:  "interface itable",
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go and 2 other locations - About 45 mins to fix
go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go on lines 320..334
go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go on lines 375..389

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

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

                case asmString:
                    addVar(name, asmVar{
                        name: name + "_base",
                        kind: asmKind(arch.ptrSize),
                        typ:  "string base",
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go and 2 other locations - About 45 mins to fix
go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go on lines 320..334
go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go on lines 336..350

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

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

                case asmEmptyInterface:
                    addVar(name, asmVar{
                        name: name + "_type",
                        kind: asmKind(arch.ptrSize),
                        typ:  "interface type",
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go and 2 other locations - About 45 mins to fix
go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go on lines 336..350
go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go on lines 375..389

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.dvs.DistributedVirtualPortgroup.PortgroupPolicy", "DVPortgroupPolicy", "vmodl.DynamicData", "vim.version.version5", [["blockOverrideAllowed", "boolean", "vim.version.version5"], ["shapingOverrideAllowed", "boolean", "vim.version.version5"], ["vendorConfigOverrideAllowed", "boolean", "vim.version.version5"], ["livePortMovingAllowed", "boolean", "vim.version.version5"], ["portConfigResetAtDisconnect", "boolean", "vim.version.version5"], ["overlayParameterOverrideAllowed", "boolean", "vim.version.dev", {:optional => true}], ["networkResourcePoolOverrideAllowed", "boolean", "vim.version.version7", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1814..1814

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.vm.guest.ProcessManager.ProcessInfo", "GuestProcessInfo", "vmodl.DynamicData", "vim.version.version7", [["name", "string", "vim.version.version7"], ["pid", "long", "vim.version.version7"], ["owner", "string", "vim.version.version7"], ["cmdLine", "string", "vim.version.version7"], ["startTime", "vmodl.DateTime", "vim.version.version7"], ["endTime", "vmodl.DateTime", "vim.version.version7", {:optional => true}], ["exitCode", "int", "vim.version.version7", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1890..1890

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

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.GuestInstallManager.UnattendedRedHatInstallSpec", "UnattendedRedHatInstallSpec", "vim.vm.customization.GuestInstallManager.UnattendedInstallSpec", "vim.version.logan", [["rootPassword", "vim.vm.customization.Password", "vim.version.logan"], ["userName", "string", "vim.version.logan"], ["userPassword", "string", "vim.version.logan"], ["productKey", "string", "vim.version.logan", {:optional => true}], ["timeZone", "string", "vim.version.logan", {:optional => true}], ["hwClockUTC", "boolean", "vim.version.logan", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 209..209
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1054..1054

Duplicated Code

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

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

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

Tuning

This issue has a mass of 39.

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

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

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

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

Refactorings

Further Reading

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

    create_managed_type("vim.vm.guest.FileManager", "GuestFileManager", "vmodl.ManagedObject", "vim.version.version7", nil, [["makeDirectory", "MakeDirectoryInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["directoryPath", "string", "vim.version.version7", {}, nil], ["createParentDirectories", "boolean", "vim.version.version7", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["deleteFile", "DeleteFileInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["filePath", "string", "vim.version.version7", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["deleteDirectory", "DeleteDirectoryInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["directoryPath", "string", "vim.version.version7", {}, nil], ["recursive", "boolean", "vim.version.version7", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["moveDirectory", "MoveDirectoryInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["srcDirectoryPath", "string", "vim.version.version7", {}, nil], ["dstDirectoryPath", "string", "vim.version.version7", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["moveFile", "MoveFileInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["srcFilePath", "string", "vim.version.version7", {}, nil], ["dstFilePath", "string", "vim.version.version7", {}, nil], ["overwrite", "boolean", "vim.version.version7", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["createTemporaryFile", "CreateTemporaryFileInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["prefix", "string", "vim.version.version7", {}, nil], ["suffix", "string", "vim.version.version7", {}, nil], ["directoryPath", "string", "vim.version.version7", {:optional => true}, nil]], [{}, "string", "string"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["createTemporaryDirectory", "CreateTemporaryDirectoryInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["prefix", "string", "vim.version.version7", {}, nil], ["suffix", "string", "vim.version.version7", {}, nil], ["directoryPath", "string", "vim.version.version7", {:optional => true}, nil]], [{}, "string", "string"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["listFiles", "ListFilesInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Query"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["filePath", "string", "vim.version.version7", {}, nil], ["index", "int", "vim.version.version7", {:optional => true}, nil], ["maxResults", "int", "vim.version.version7", {:optional => true}, nil], ["matchPattern", "string", "vim.version.version7", {:optional => true}, nil]], [{}, "vim.vm.guest.FileManager.ListFileInfo", "vim.vm.guest.FileManager.ListFileInfo"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["changeFileAttributes", "ChangeFileAttributesInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["guestFilePath", "string", "vim.version.version7", {}, nil], ["fileAttributes", "vim.vm.guest.FileManager.FileAttributes", "vim.version.version7", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["initiateFileTransferFromGuest", "InitiateFileTransferFromGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Query"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["guestFilePath", "string", "vim.version.version7", {}, nil]], [{}, "vim.vm.guest.FileManager.FileTransferInformation", "vim.vm.guest.FileManager.FileTransferInformation"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["initiateFileTransferToGuest", "InitiateFileTransferToGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Modify"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["guestFilePath", "string", "vim.version.version7", {}, nil], ["fileAttributes", "vim.vm.guest.FileManager.FileAttributes", "vim.version.version7", {}, nil], ["fileSize", "long", "vim.version.version7", {}, nil], ["overwrite", "boolean", "vim.version.version7", {}, nil]], [{}, "string", "string"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 3 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1800..1800
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1800..1800
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1800..1800

Duplicated Code

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

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

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

Tuning

This issue has a mass of 39.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language