cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

    create_data_type("vim.host.NetworkPolicy.NicFailureCriteria", "HostNicFailureCriteria", "vmodl.DynamicData", "vim.version.version1", [["checkSpeed", "string", "vim.version.version1", {:optional => true}], ["speed", "int", "vim.version.version1", {:optional => true}], ["checkDuplex", "boolean", "vim.version.version1", {:optional => true}], ["fullDuplex", "boolean", "vim.version.version1", {:optional => true}], ["checkErrorPercent", "boolean", "vim.version.version1", {:optional => true}], ["percentage", "int", "vim.version.version1", {:optional => true}], ["checkBeacon", "boolean", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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

    create_data_type("vim.dvs.VmwareDistributedVirtualSwitch.FailureCriteria", "DVSFailureCriteria", "vim.InheritablePolicy", "vim.version.version5", [["checkSpeed", "vim.StringPolicy", "vim.version.version5", {:optional => true}], ["speed", "vim.IntPolicy", "vim.version.version5", {:optional => true}], ["checkDuplex", "vim.BoolPolicy", "vim.version.version5", {:optional => true}], ["fullDuplex", "vim.BoolPolicy", "vim.version.version5", {:optional => true}], ["checkErrorPercent", "vim.BoolPolicy", "vim.version.version5", {:optional => true}], ["percentage", "vim.IntPolicy", "vim.version.version5", {:optional => true}], ["checkBeacon", "vim.BoolPolicy", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307

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

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

    create_data_type("vim.cluster.VmToolsMonitoringSettings", "ClusterVmToolsMonitoringSettings", "vmodl.DynamicData", "vim.version.version5", [["enabled", "boolean", "vim.version.version5", {:optional => true}], ["vmMonitoring", "string", "vim.version.version6", {:optional => true}], ["clusterSettings", "boolean", "vim.version.version5", {:optional => true}], ["failureInterval", "int", "vim.version.version5", {:optional => true}], ["minUpTime", "int", "vim.version.version5", {:optional => true}], ["maxFailures", "int", "vim.version.version5", {:optional => true}], ["maxFailureWindow", "int", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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

    create_data_type("vim.cluster.RuleInfo", "ClusterRuleInfo", "vmodl.DynamicData", "vim.version.version1", [["key", "int", "vim.version.version1", {:optional => true}], ["status", "vim.ManagedEntity.Status", "vim.version.version1", {:optional => true}], ["enabled", "boolean", "vim.version.version1", {:optional => true}], ["name", "string", "vim.version.version1", {:optional => true}], ["mandatory", "boolean", "vim.version.version6", {:optional => true}], ["userCreated", "boolean", "vim.version.version6", {:optional => true}], ["inCompliance", "boolean", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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

    create_data_type("vim.vm.DefaultPowerOpInfo", "VirtualMachineDefaultPowerOpInfo", "vmodl.DynamicData", "vim.version.version1", [["powerOffType", "string", "vim.version.version1", {:optional => true}], ["suspendType", "string", "vim.version.version1", {:optional => true}], ["resetType", "string", "vim.version.version1", {:optional => true}], ["defaultPowerOffType", "string", "vim.version.version1", {:optional => true}], ["defaultSuspendType", "string", "vim.version.version1", {:optional => true}], ["defaultResetType", "string", "vim.version.version1", {:optional => true}], ["standbyAction", "string", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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

    create_data_type("vim.vm.RelocateSpec", "VirtualMachineRelocateSpec", "vmodl.DynamicData", "vim.version.version1", [["datastore", "vim.Datastore", "vim.version.version1", {:optional => true}], ["diskMoveType", "string", "vim.version.version5", {:optional => true}], ["pool", "vim.ResourcePool", "vim.version.version1", {:optional => true}], ["host", "vim.HostSystem", "vim.version.version1", {:optional => true}], ["disk", "vim.vm.RelocateSpec.DiskLocator[]", "vim.version.version1", {:optional => true}], ["transform", "vim.vm.RelocateSpec.Transformation", "vim.version.version1", {:optional => true}], ["files", "vim.vm.FileInfo", "vim.version.dev", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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 'hp'
            raise 'HP options are missing' unless options.has_key?(:hp)
            raise "Invalid HP options, Hash expected, #{options[:hp].class} given" unless options[:hp].is_a?(Hash)
            raise 'HP access key is missing' unless options[:hp].has_key?(:hp_access_key)
            raise 'HP secret key is missing' unless options[:hp].has_key?(:hp_secret_key)
blobstore_client/lib/blobstore_client/swift_blobstore_client.rb on lines 132..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 55.

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

    create_data_type("vim.dvs.PortCriteria", "DistributedVirtualSwitchPortCriteria", "vmodl.DynamicData", "vim.version.version5", [["connected", "boolean", "vim.version.version5", {:optional => true}], ["active", "boolean", "vim.version.version5", {:optional => true}], ["uplinkPort", "boolean", "vim.version.version5", {:optional => true}], ["scope", "vim.ManagedEntity", "vim.version.version5", {:optional => true}], ["portgroupKey", "string[]", "vim.version.version5", {:optional => true}], ["inside", "boolean", "vim.version.version5", {:optional => true}], ["portKey", "string[]", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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

    create_data_type("vim.dvs.ProductSpec", "DistributedVirtualSwitchProductSpec", "vmodl.DynamicData", "vim.version.version5", [["name", "string", "vim.version.version5", {:optional => true}], ["vendor", "string", "vim.version.version5", {:optional => true}], ["version", "string", "vim.version.version5", {:optional => true}], ["build", "string", "vim.version.version5", {:optional => true}], ["forwardingClass", "string", "vim.version.version5", {:optional => true}], ["bundleId", "string", "vim.version.version5", {:optional => true}], ["bundleUrl", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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 delete_snapshot(snapshot_id)
      with_thread_name("delete_snapshot(#{snapshot_id})") do
        @logger.info("Deleting snapshot `#{snapshot_id}'...")
        snapshot = with_openstack { @openstack.snapshots.get(snapshot_id) }
        if snapshot
Severity: Major
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 1 hr to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 450..463

Duplicated Code

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

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

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

Tuning

This issue has a mass of 55.

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

    create_data_type("vim.vApp.IpPool.IpPoolConfigInfo", "IpPoolIpPoolConfigInfo", "vmodl.DynamicData", "vim.version.version5", [["subnetAddress", "string", "vim.version.version5", {:optional => true}], ["netmask", "string", "vim.version.version5", {:optional => true}], ["gateway", "string", "vim.version.version5", {:optional => true}], ["range", "string", "vim.version.version5", {:optional => true}], ["dns", "string[]", "vim.version.version5", {:optional => true}], ["dhcpServerAvailable", "boolean", "vim.version.version5", {:optional => true}], ["ipPoolEnabled", "boolean", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 483..483
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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

    create_data_type("vim.dvs.DistributedVirtualPort.Setting", "DVPortSetting", "vmodl.DynamicData", "vim.version.version5", [["blocked", "vim.BoolPolicy", "vim.version.version5", {:optional => true}], ["vmDirectPathGen2Allowed", "vim.BoolPolicy", "vim.version.version6", {:optional => true}], ["inShapingPolicy", "vim.dvs.DistributedVirtualPort.TrafficShapingPolicy", "vim.version.version5", {:optional => true}], ["outShapingPolicy", "vim.dvs.DistributedVirtualPort.TrafficShapingPolicy", "vim.version.version5", {:optional => true}], ["overlayParameter", "vim.dvs.DistributedVirtualPort.OverlayParameterPolicy", "vim.version.dev", {:optional => true}], ["vendorSpecificConfig", "vim.dvs.DistributedVirtualPort.VendorSpecificConfig", "vim.version.version5", {:optional => true}], ["networkResourcePoolKey", "vim.StringPolicy", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 9 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 474..474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 506..506
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 508..508
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1223..1223
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1527..1527
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1562..1562
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1885..1885
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2307..2307
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2436..2436

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

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 delete_disk(disk_id)
      with_thread_name("delete_disk(#{disk_id})") do
        @logger.info("Deleting volume `#{disk_id}'...")
        volume = with_openstack { @openstack.volumes.get(disk_id) }
        if volume
Severity: Major
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 1 hr to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 556..569

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

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 'openstack'
            raise 'OpenStack options are missing' unless options.has_key?(:openstack)
            raise "Invalid OpenStack options, Hash expected, #{options[:openstack].class} given" unless options[:openstack].is_a?(Hash)
            raise 'OpenStack authorization URL is missing' unless options[:openstack].has_key?(:openstack_auth_url)
            raise 'OpenStack user name is missing' unless options[:openstack].has_key?(:openstack_username)
blobstore_client/lib/blobstore_client/swift_blobstore_client.rb on lines 125..131

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

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 (ms concreteMetadataService) GetInstanceID() (string, error) {
    url := fmt.Sprintf("%s/latest/meta-data/instance-id", ms.metadataHost)
    resp, err := http.Get(url)
    if err != nil {
        return "", bosherr.WrapError(err, "Getting instance id from url")
go_agent/src/bosh/infrastructure/concrete_metadata_service.go on lines 41..56

Duplicated Code

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

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

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

Tuning

This issue has a mass of 144.

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 (ms concreteMetadataService) GetPublicKey() (string, error) {
    url := fmt.Sprintf("%s/latest/meta-data/public-keys/0/openssh-key", ms.metadataHost)
    resp, err := http.Get(url)
    if err != nil {
        return "", bosherr.WrapError(err, "Getting open ssh key")
go_agent/src/bosh/infrastructure/concrete_metadata_service.go on lines 58..73

Duplicated Code

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

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

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

Tuning

This issue has a mass of 144.

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_managed_type("vim.TaskHistoryCollector", "TaskHistoryCollector", "vim.HistoryCollector", "vim.version.version1", [["latestPage", "vim.TaskInfo[]", "vim.version.version1", {:optional => true}, nil]], [["readNext", "ReadNextTasks", "vim.version.version1", [["maxCount", "int", "vim.version.version1", {}, nil]], [{:optional => true}, "vim.TaskInfo[]", "vim.TaskInfo[]"], nil, nil], ["readPrev", "ReadPreviousTasks", "vim.version.version1", [["maxCount", "int", "vim.version.version1", {}, nil]], [{:optional => true}, "vim.TaskInfo[]", "vim.TaskInfo[]"], nil, nil]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 958..958

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

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_managed_type("vim.event.EventHistoryCollector", "EventHistoryCollector", "vim.HistoryCollector", "vim.version.version1", [["latestPage", "vim.event.Event[]", "vim.version.version1", {:optional => true}, nil]], [["readNext", "ReadNextEvents", "vim.version.version1", [["maxCount", "int", "vim.version.version1", {}, nil]], [{:optional => true}, "vim.event.Event[]", "vim.event.Event[]"], nil, nil], ["readPrev", "ReadPreviousEvents", "vim.version.version1", [["maxCount", "int", "vim.version.version1", {}, nil]], [{:optional => true}, "vim.event.Event[]", "vim.event.Event[]"], nil, nil]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 368..368

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

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 ext۰syscall۰Read(fn *ssa.Function, args []value) value {
    // func Read(fd int, p []byte) (n int, err error)
    fd := args[0].(int)
    p := args[1].([]value)
    b := make([]byte, len(p))
go_agent/src/code.google.com/p/go.tools/ssa/interp/external_unix.go on lines 49..59

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

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.PerformanceManager.QuerySpec", "PerfQuerySpec", "vmodl.DynamicData", "vim.version.version1", [["entity", "vmodl.ManagedObject", "vim.version.version1"], ["startTime", "vmodl.DateTime", "vim.version.version1", {:optional => true}], ["endTime", "vmodl.DateTime", "vim.version.version1", {:optional => true}], ["maxSample", "int", "vim.version.version1", {:optional => true}], ["metricId", "vim.PerformanceManager.MetricId[]", "vim.version.version1", {:optional => true}], ["intervalId", "int", "vim.version.version1", {:optional => true}], ["format", "string", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 478..478
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2263..2263

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

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