cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

    create_data_type("vim.cluster.DasVmSettings", "ClusterDasVmSettings", "vmodl.DynamicData", "vim.version.version2", [["restartPriority", "string", "vim.version.version2", {:optional => true}], ["isolationResponse", "string", "vim.version.version2", {:optional => true}], ["vmToolsMonitoringSettings", "vim.cluster.VmToolsMonitoringSettings", "vim.version.version5", {:optional => true}], ["vmComponentProtectionSettings", "vim.cluster.VmComponentProtectionSettings", "vim.version.vcp", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 28 other locations - About 35 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 302..302
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 304..304
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 362..362
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 412..412
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 470..470
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 480..480
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 503..503
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 735..735
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 750..750
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 960..960
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1053..1053
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1090..1090
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1155..1155
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1173..1173
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1183..1183
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1220..1220
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1222..1222
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1522..1522
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1574..1574
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1596..1596
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1606..1606
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1632..1632
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1656..1656
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1830..1830
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2215..2215
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2259..2259
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2260..2260
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2295..2295

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

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

    create_data_type("vim.host.IpmiInfo", "HostIpmiInfo", "vmodl.DynamicData", "vim.version.version5", [["bmcIpAddress", "string", "vim.version.version5", {:optional => true}], ["bmcMacAddress", "string", "vim.version.version5", {:optional => true}], ["login", "string", "vim.version.version5", {:optional => true}], ["password", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 28 other locations - About 35 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 302..302
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 304..304
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 362..362
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 412..412
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 437..437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 470..470
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 480..480
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 503..503
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 735..735
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 750..750
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 960..960
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1053..1053
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1090..1090
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1155..1155
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1183..1183
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1220..1220
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1222..1222
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1522..1522
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1574..1574
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1596..1596
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1606..1606
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1632..1632
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1656..1656
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1830..1830
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2215..2215
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2259..2259
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2260..2260
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2295..2295

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

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

    create_data_type("vim.host.LicenseSpec", "HostLicenseSpec", "vmodl.DynamicData", "vim.version.version5", [["source", "vim.LicenseManager.LicenseSource", "vim.version.version5", {:optional => true}], ["editionKey", "string", "vim.version.version5", {:optional => true}], ["disabledFeatureKey", "string[]", "vim.version.version5", {:optional => true}], ["enabledFeatureKey", "string[]", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 28 other locations - About 35 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 302..302
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 304..304
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 362..362
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 412..412
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 437..437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 470..470
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 480..480
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 503..503
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 735..735
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 750..750
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 960..960
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1053..1053
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1090..1090
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1155..1155
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1173..1173
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1220..1220
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1222..1222
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1522..1522
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1574..1574
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1596..1596
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1606..1606
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1632..1632
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1656..1656
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1830..1830
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2215..2215
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2259..2259
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2260..2260
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2295..2295

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

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

    create_data_type("vim.vApp.IPAssignmentInfo", "VAppIPAssignmentInfo", "vmodl.DynamicData", "vim.version.version5", [["supportedAllocationScheme", "string[]", "vim.version.version5", {:optional => true}], ["ipAllocationPolicy", "string", "vim.version.version5", {:optional => true}], ["supportedIpProtocol", "string[]", "vim.version.version5", {:optional => true}], ["ipProtocol", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 28 other locations - About 35 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 302..302
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 304..304
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 362..362
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 412..412
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 437..437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 470..470
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 480..480
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 503..503
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 735..735
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 750..750
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 960..960
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1053..1053
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1090..1090
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1155..1155
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1173..1173
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1183..1183
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1220..1220
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1222..1222
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1574..1574
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1596..1596
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1606..1606
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1632..1632
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1656..1656
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1830..1830
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2215..2215
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2259..2259
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2260..2260
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2295..2295

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

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

    create_data_type("vim.vm.NetworkShaperInfo", "VirtualMachineNetworkShaperInfo", "vmodl.DynamicData", "vim.version.version1", [["enabled", "boolean", "vim.version.version1", {:optional => true}], ["peakBps", "long", "vim.version.version1", {:optional => true}], ["averageBps", "long", "vim.version.version1", {:optional => true}], ["burstSize", "long", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 28 other locations - About 35 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 302..302
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 304..304
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 362..362
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 412..412
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 437..437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 470..470
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 480..480
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 503..503
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 735..735
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 750..750
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 960..960
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1053..1053
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1090..1090
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1155..1155
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1173..1173
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1183..1183
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1220..1220
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1222..1222
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1522..1522
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1574..1574
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1596..1596
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1632..1632
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1656..1656
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1830..1830
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2215..2215
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2259..2259
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2260..2260
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2295..2295

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

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 extract_security_groups(network_spec)
      if network_spec && network_spec["cloud_properties"]
        cloud_properties = network_spec["cloud_properties"]
        if cloud_properties && cloud_properties.has_key?("security_groups")
          unless cloud_properties["security_groups"].is_a?(Array)
bosh_openstack_cpi/lib/cloud/openstack/network_configurator.rb on lines 131..141

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.dvs.DistributedVirtualPortgroupInfo", "DistributedVirtualPortgroupInfo", "vmodl.DynamicData", "vim.version.version5", [["switchName", "string", "vim.version.version5"], ["switchUuid", "string", "vim.version.version5"], ["portgroupName", "string", "vim.version.version5"], ["portgroupKey", "string", "vim.version.version5"], ["portgroupType", "string", "vim.version.version5"], ["uplinkPortgroup", "boolean", "vim.version.version5"], ["portgroup", "vim.dvs.DistributedVirtualPortgroup", "vim.version.version5"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 35 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1024..1024
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1252..1252
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1495..1495
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2356..2356

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.host.AutoStartManager.AutoPowerInfo", "AutoStartPowerInfo", "vmodl.DynamicData", "vim.version.version1", [["key", "vim.VirtualMachine", "vim.version.version1"], ["startOrder", "int", "vim.version.version1"], ["startDelay", "int", "vim.version.version1"], ["waitForHeartbeat", "vim.host.AutoStartManager.AutoPowerInfo.WaitHeartbeatSetting", "vim.version.version1"], ["startAction", "string", "vim.version.version1"], ["stopDelay", "int", "vim.version.version1"], ["stopAction", "string", "vim.version.version1"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 35 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 488..488
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1252..1252
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1495..1495
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2356..2356

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

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 extract_security_groups(network_spec)
      if network_spec && network_spec["cloud_properties"]
        cloud_properties = network_spec["cloud_properties"]
        if cloud_properties && cloud_properties.has_key?("security_groups")
          unless cloud_properties["security_groups"].is_a?(Array)
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/network_configurator.rb and 1 other location - About 35 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/network_configurator.rb on lines 115..125

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

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

        when 'centos'
          template_dir = File.expand_path(File.join(File.dirname(__FILE__), 'platform/centos/templates'))
          Platform::Linux::Adapter.new(Platform::Centos::Disk.new,
                                       Platform::Linux::Logrotate.new(template_dir),
                                       Platform::Linux::Password.new,
Severity: Minor
Found in bosh_agent/lib/bosh_agent/platform.rb and 1 other location - About 35 mins to fix
bosh_agent/lib/bosh_agent/platform.rb on lines 8..13

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

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

        when 'ubuntu'
          template_dir = File.expand_path(File.join(File.dirname(__FILE__), 'platform/ubuntu/templates'))
          Platform::Linux::Adapter.new(Platform::Linux::Disk.new,
                                       Platform::Linux::Logrotate.new(template_dir),
                                       Platform::Linux::Password.new,
Severity: Minor
Found in bosh_agent/lib/bosh_agent/platform.rb and 1 other location - About 35 mins to fix
bosh_agent/lib/bosh_agent/platform.rb on lines 15..20

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

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

      Bosh::Retryable.new(tries: 20, sleep: 20).retryer do
        # CloudStack does not return deleted servers on subsequent calls
        servers = find_any_matching_servers(servers_collection)

        matching_server_names = servers.map(&:name).join(', ')
bosh-dev/lib/bosh/dev/openstack/micro_bosh_deployment_cleaner.rb on lines 22..32

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

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 copy_disk(source_datacenter, source_path, dest_datacenter, dest_path)
      tasks = []
      [".vmdk", "-flat.vmdk"].each do |extension|
        tasks << @service_content.file_manager.copy_file("#{source_path}#{extension}", source_datacenter,
                                                         "#{dest_path}#{extension}", dest_datacenter, false)
Severity: Minor
Found in bosh_vsphere_cpi/lib/cloud/vsphere/client.rb and 1 other location - About 35 mins to fix
bosh_vsphere_cpi/lib/cloud/vsphere/client.rb on lines 199..206

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

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

      Bosh::Retryable.new(tries: 20, sleep: 20).retryer do
        # OpenStack does not return deleted servers on subsequent calls
        servers = find_any_matching_servers(servers_collection)

        matching_server_names = servers.map(&:name).join(', ')
bosh-dev/lib/bosh/dev/cloudstack/micro_bosh_deployment_cleaner.rb on lines 22..32

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

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 move_disk(source_datacenter, source_path, dest_datacenter, dest_path)
      tasks = []
      [".vmdk", "-flat.vmdk"].each do |extension|
        tasks << @service_content.file_manager.move_file("#{source_path}#{extension}", source_datacenter,
                                                         "#{dest_path}#{extension}", dest_datacenter, false)
Severity: Minor
Found in bosh_vsphere_cpi/lib/cloud/vsphere/client.rb and 1 other location - About 35 mins to fix
bosh_vsphere_cpi/lib/cloud/vsphere/client.rb on lines 209..216

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

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

func chanreflect1() {
    ch := make(chan *int, 0)
    crv := reflect.ValueOf(ch)
    crv.Send(reflect.ValueOf(&a))
    print(crv.Interface())             // @types chan *int
go_agent/src/code.google.com/p/go.tools/pointer/testdata/chanreflect.go on lines 11..18

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

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

func chanreflect1() {
    ch := make(chan *int, 0) // @line cr1make
    crv := reflect.ValueOf(ch)
    crv.Send(reflect.ValueOf(&a))
    print(crv.Interface())             // @types chan *int
go_agent/src/code.google.com/p/go.tools/pointer/testdata/chanreflect1.go on lines 14..21

Duplicated Code

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

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

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

Tuning

This issue has a mass of 101.

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

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

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

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

Refactorings

Further Reading

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

func (s *sigarStatsCollector) GetMemStats() (usage Usage, err error) {
    mem, err := s.statsSigar.GetMem()
    if err != nil {
        err = bosherr.WrapError(err, "Getting Sigar Mem")
        return
Severity: Minor
Found in go_agent/src/bosh/platform/stats/sigar_stats_collector.go and 1 other location - About 30 mins to fix
go_agent/src/bosh/platform/stats/sigar_stats_collector.go on lines 79..90

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

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

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

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

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

Refactorings

Further Reading

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

func (s *sigarStatsCollector) GetSwapStats() (usage Usage, err error) {
    swap, err := s.statsSigar.GetSwap()
    if err != nil {
        err = bosherr.WrapError(err, "Getting Sigar Swap")
        return
Severity: Minor
Found in go_agent/src/bosh/platform/stats/sigar_stats_collector.go and 1 other location - About 30 mins to fix
go_agent/src/bosh/platform/stats/sigar_stats_collector.go on lines 63..77

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

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 TranslatorFrom(charset string) (Translator, error) {
    var err error
    var tr Translator
    for _, f := range factories {
        tr, err = f.TranslatorFrom(charset)
Severity: Minor
Found in go_agent/src/code.google.com/p/go-charset/charset/charset.go and 1 other location - About 30 mins to fix
go_agent/src/code.google.com/p/go-charset/charset/charset.go on lines 125..138

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

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