cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

    create_managed_type("vim.ServiceInstance", "ServiceInstance", "vmodl.ManagedObject", "vim.version.version1", [["serverClock", "vmodl.DateTime", "vim.version.version1", {}, "System.View"], ["capability", "vim.Capability", "vim.version.version1", {}, "System.View"], ["content", "vim.ServiceInstanceContent", "vim.version.version1", {}, "System.Anonymous"]], [["currentTime", "CurrentTime", "vim.version.version1", [], [{}, "vmodl.DateTime", "vmodl.DateTime"], "System.View", nil], ["retrieveContent", "RetrieveServiceContent", "vim.version.version1", [], [{}, "vim.ServiceInstanceContent", "vim.ServiceInstanceContent"], "System.Anonymous", nil], ["validateMigration", "ValidateMigration", "vim.version.version1", [["vm", "vim.VirtualMachine[]", "vim.version.version1", {}, nil], ["state", "vim.VirtualMachine.PowerState", "vim.version.version1", {:optional => true}, nil], ["testType", "string[]", "vim.version.version1", {:optional => true}, nil], ["pool", "vim.ResourcePool", "vim.version.version1", {:optional => true}, nil], ["host", "vim.HostSystem", "vim.version.version1", {:optional => true}, nil]], [{:optional => true}, "vim.event.Event[]", "vim.event.Event[]"], "System.View", ["vim.fault.InvalidState"]], ["queryVMotionCompatibility", "QueryVMotionCompatibility", "vim.version.version1", [["vm", "vim.VirtualMachine", "vim.version.version1", {}, nil], ["host", "vim.HostSystem[]", "vim.version.version1", {}, nil], ["compatibility", "string[]", "vim.version.version1", {:optional => true}, nil]], [{:optional => true}, "vim.ServiceInstance.HostVMotionCompatibility[]", "vim.ServiceInstance.HostVMotionCompatibility[]"], "Resource.QueryVMotion", nil], ["retrieveProductComponents", "RetrieveProductComponents", "vim.version.version2", [], [{:optional => true}, "vim.ServiceInstance.ProductComponentInfo[]", "vim.ServiceInstance.ProductComponentInfo[]"], "System.Anonymous", nil]])
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 2325..2325

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

    create_data_type("vim.CustomFieldsManager.FieldDef", "CustomFieldDef", "vmodl.DynamicData", "vim.version.version1", [["key", "int", "vim.version.version1"], ["name", "string", "vim.version.version1"], ["type", "vmodl.TypeName", "vim.version.version1"], ["managedObjectType", "vmodl.TypeName", "vim.version.version2", {:optional => true}], ["fieldDefPrivileges", "vim.PrivilegePolicyDef", "vim.version.version2", {:optional => true}], ["fieldInstancePrivileges", "vim.PrivilegePolicyDef", "vim.version.version2", {: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 1054..1054
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1637..1637

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

    create_managed_type("vim.vm.check.ProvisioningChecker", "VirtualMachineProvisioningChecker", "vmodl.ManagedObject", "vim.version.version5", nil, [["queryVMotionCompatibilityEx", "QueryVMotionCompatibilityEx_Task", "vim.version.version5", [["vm", "vim.VirtualMachine[]", "vim.version.version5", {}, nil], ["host", "vim.HostSystem[]", "vim.version.version5", {}, nil]], [{}, "vim.Task", "vim.vm.check.Result[]"], "System.View", nil], ["checkMigrate", "CheckMigrate_Task", "vim.version.version5", [["vm", "vim.VirtualMachine", "vim.version.version5", {}, nil], ["host", "vim.HostSystem", "vim.version.version5", {:optional => true}, nil], ["pool", "vim.ResourcePool", "vim.version.version5", {:optional => true}, nil], ["state", "vim.VirtualMachine.PowerState", "vim.version.version5", {:optional => true}, nil], ["testType", "string[]", "vim.version.version5", {:optional => true}, nil]], [{}, "vim.Task", "vim.vm.check.Result[]"], "System.View", ["vim.fault.InvalidState"]], ["checkRelocate", "CheckRelocate_Task", "vim.version.version5", [["vm", "vim.VirtualMachine", "vim.version.version5", {}, nil], ["spec", "vim.vm.RelocateSpec", "vim.version.version5", {}, nil], ["testType", "string[]", "vim.version.version5", {:optional => true}, nil]], [{}, "vim.Task", "vim.vm.check.Result[]"], "System.View", ["vim.fault.InvalidState"]]])
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 2407..2407

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

    create_data_type("vim.host.DatastoreBrowser.VmDiskQuery.Details", "VmDiskFileQueryFlags", "vmodl.DynamicData", "vim.version.version1", [["diskType", "boolean", "vim.version.version1"], ["capacityKb", "boolean", "vim.version.version1"], ["hardwareVersion", "boolean", "vim.version.version1"], ["controllerType", "boolean", "vim.version.version2", {:optional => true}], ["diskExtents", "boolean", "vim.version.version2", {:optional => true}], ["thin", "boolean", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 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 1637..1637

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

    create_data_type("vim.profile.ApplyProfile", "ApplyProfile", "vmodl.DynamicData", "vim.version.version5", [["enabled", "boolean", "vim.version.version5"], ["policy", "vim.profile.Policy[]", "vim.version.version5", {:optional => true}], ["profileTypeName", "string", "vim.version.version7", {:optional => true}], ["profileVersion", "string", "vim.version.version7", {:optional => true}], ["property", "vim.profile.ApplyProfileProperty[]", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 7 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 435..435
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 502..502
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 904..904
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1248..1248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1434..1434
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1707..1707
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1781..1781

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

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

    create_data_type("vim.dvs.NetworkResourcePool.ConfigSpec", "DVSNetworkResourcePoolConfigSpec", "vmodl.DynamicData", "vim.version.version6", [["key", "string", "vim.version.version6"], ["configVersion", "string", "vim.version.version6", {:optional => true}], ["allocationInfo", "vim.dvs.NetworkResourcePool.AllocationInfo", "vim.version.version6", {:optional => true}], ["name", "string", "vim.version.version7", {:optional => true}], ["description", "string", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 7 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 435..435
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 904..904
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1248..1248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1388..1388
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1434..1434
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1707..1707
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1781..1781

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

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

    create_data_type("vim.vm.device.VirtualDisk.FlatVer1BackingInfo", "VirtualDiskFlatVer1BackingInfo", "vim.vm.device.VirtualDevice.FileBackingInfo", "vim.version.version1", [["diskMode", "string", "vim.version.version1"], ["split", "boolean", "vim.version.version1", {:optional => true}], ["writeThrough", "boolean", "vim.version.version1", {:optional => true}], ["contentId", "string", "vim.version.version5", {:optional => true}], ["parent", "vim.vm.device.VirtualDisk.FlatVer1BackingInfo", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 7 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 435..435
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 502..502
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 904..904
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1248..1248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1388..1388
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1434..1434
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1781..1781

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

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

    create_data_type("vim.profile.host.ExecuteResult", "ProfileExecuteResult", "vmodl.DynamicData", "vim.version.version5", [["status", "string", "vim.version.version5"], ["configSpec", "vim.host.ConfigSpec", "vim.version.version5", {:optional => true}], ["inapplicablePath", "vmodl.PropertyPath[]", "vim.version.version5", {:optional => true}], ["requireInput", "vim.profile.DeferredPolicyOptionParameter[]", "vim.version.version5", {:optional => true}], ["error", "vim.profile.host.ExecuteResult.ExecuteError[]", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 7 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 435..435
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 502..502
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 904..904
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1248..1248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1388..1388
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1707..1707
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1781..1781

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

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

    create_data_type("vim.vm.device.VirtualUSB", "VirtualUSB", "vim.vm.device.VirtualDevice", "vim.version.version1", [["connected", "boolean", "vim.version.version2"], ["vendor", "int", "vim.version.version6", {:optional => true}], ["product", "int", "vim.version.version6", {:optional => true}], ["family", "string[]", "vim.version.version6", {:optional => true}], ["speed", "string[]", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 7 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 435..435
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 502..502
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 904..904
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1248..1248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1388..1388
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1434..1434
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1707..1707

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

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 parse_user_data(raw_user_data)
        begin
          user_data = Yajl::Parser.parse(raw_user_data)
        rescue Yajl::ParseError => e
          raise LoadSettingsError, "Cannot parse user data #{raw_user_data.inspect}: #{e.message}"
Severity: Minor
Found in bosh_agent/lib/bosh_agent/infrastructure/cloudstack/registry.rb and 1 other location - About 40 mins to fix
bosh_agent/lib/bosh_agent/infrastructure/openstack/registry.rb on lines 179..190

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

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

  class Network
    include Helpers

    ##
    # Creates a new network
Severity: Major
Found in bosh_aws_cpi/lib/cloud/aws/network.rb and 2 other locations - About 40 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/network.rb on lines 7..34
bosh_openstack_cpi/lib/cloud/openstack/network.rb on lines 7..34

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

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

    create_data_type("vim.cluster.DasVmConfigInfo", "ClusterDasVmConfigInfo", "vmodl.DynamicData", "vim.version.version1", [["key", "vim.VirtualMachine", "vim.version.version1"], ["restartPriority", "vim.cluster.DasVmConfigInfo.Priority", "vim.version.version1", {:optional => true}], ["powerOffOnIsolation", "boolean", "vim.version.version1", {:optional => true}], ["dasSettings", "vim.cluster.DasVmSettings", "vim.version.version2", {:optional => true}], ["goldenSnapshot", "vim.vm.Snapshot", "vim.version.logan", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 7 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 502..502
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 904..904
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1248..1248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1388..1388
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1434..1434
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1707..1707
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1781..1781

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

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

    create_data_type("vim.event.DvsHostStatusUpdated", "DvsHostStatusUpdated", "vim.event.DvsEvent", "vim.version.version6", [["hostMember", "vim.event.HostEventArgument", "vim.version.version6"], ["oldStatus", "string", "vim.version.version6", {:optional => true}], ["newStatus", "string", "vim.version.version6", {:optional => true}], ["oldStatusDetail", "string", "vim.version.version6", {:optional => true}], ["newStatusDetail", "string", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 7 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 435..435
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 502..502
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1248..1248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1388..1388
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1434..1434
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1707..1707
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1781..1781

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

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.alarm.EventAlarmExpression", "EventAlarmExpression", "vim.alarm.AlarmExpression", "vim.version.version2", [["comparisons", "vim.alarm.EventAlarmExpression.Comparison[]", "vim.version.version5", {:optional => true}], ["eventType", "vmodl.TypeName", "vim.version.version2"], ["eventTypeId", "string", "vim.version.version2", {:optional => true}], ["objectType", "vmodl.TypeName", "vim.version.version5", {:optional => true}], ["status", "vim.ManagedEntity.Status", "vim.version.version5", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1394..1394

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

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 user_data(server_name, network_spec, public_key = nil)
      data = {}

      data["registry"] = { "endpoint" => @registry.endpoint }
      data["server"] = { "name" => server_name }
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 40 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 645..656

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.host.DhcpService.Specification", "HostDhcpServiceSpec", "vmodl.DynamicData", "vim.version.version2", [["virtualSwitch", "string", "vim.version.version2"], ["defaultLeaseDuration", "int", "vim.version.version2"], ["leaseBeginIp", "string", "vim.version.version2"], ["leaseEndIp", "string", "vim.version.version2"], ["maxLeaseDuration", "int", "vim.version.version2"], ["unlimitedLease", "boolean", "vim.version.version2"], ["ipSubnetAddr", "string", "vim.version.version2"], ["ipSubnetMask", "string", "vim.version.version2"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 3 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 353..353
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2277..2277
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2479..2479

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.host.UnresolvedVmfsExtent", "HostUnresolvedVmfsExtent", "vmodl.DynamicData", "vim.version.version5", [["device", "vim.host.ScsiDisk.Partition", "vim.version.version5"], ["devicePath", "string", "vim.version.version5"], ["vmfsUuid", "string", "vim.version.version5"], ["isHeadExtent", "boolean", "vim.version.version5"], ["ordinal", "int", "vim.version.version5"], ["startBlock", "int", "vim.version.version5"], ["endBlock", "int", "vim.version.version5"], ["reason", "string", "vim.version.version5"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 3 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 353..353
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1078..1078
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2479..2479

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

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

  class Network
    include Helpers

    ##
    # Creates a new network
Severity: Major
Found in bosh_openstack_cpi/lib/cloud/openstack/network.rb and 2 other locations - About 40 mins to fix
bosh_aws_cpi/lib/cloud/aws/network.rb on lines 6..33
bosh_cloudstack_cpi/lib/cloud/cloudstack/network.rb on lines 7..34

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

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.profile.host.HostProfile.CompleteConfigSpec", "HostProfileCompleteConfigSpec", "vim.profile.host.HostProfile.ConfigSpec", "vim.version.version5", [["applyProfile", "vim.profile.host.HostApplyProfile", "vim.version.version5", {:optional => true}], ["customComplyProfile", "vim.profile.ComplianceProfile", "vim.version.version5", {:optional => true}], ["disabledExpressionListChanged", "boolean", "vim.version.version5"], ["disabledExpressionList", "string[]", "vim.version.version5", {:optional => true}], ["validatorHost", "vim.HostSystem", "vim.version.version7", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2433..2433

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

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

    create_data_type("vim.host.PhysicalNic.NetworkHint", "PhysicalNicHintInfo", "vmodl.DynamicData", "vim.version.version1", [["device", "string", "vim.version.version1"], ["subnet", "vim.host.PhysicalNic.NetworkHint.IpNetwork[]", "vim.version.version1", {:optional => true}], ["network", "vim.host.PhysicalNic.NetworkHint.NamedNetwork[]", "vim.version.version1", {:optional => true}], ["connectedSwitchPort", "vim.host.PhysicalNic.CdpInfo", "vim.version.version2", {:optional => true}], ["lldpInfo", "vim.host.PhysicalNic.LldpInfo", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 7 other locations - About 40 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 435..435
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 502..502
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 904..904
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1388..1388
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1434..1434
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1707..1707
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1781..1781

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

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