cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 1,705 of 1,705 total issues

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

    create_managed_type("vim.AuthorizationManager", "AuthorizationManager", "vmodl.ManagedObject", "vim.version.version1", [["privilegeList", "vim.AuthorizationManager.Privilege[]", "vim.version.version1", {:optional => true}, "System.View"], ["roleList", "vim.AuthorizationManager.Role[]", "vim.version.version1", {:optional => true}, "System.View"], ["description", "vim.AuthorizationDescription", "vim.version.version1", {}, "System.View"]], [["addRole", "AddAuthorizationRole", "vim.version.version1", [["name", "string", "vim.version.version1", {}, nil], ["privIds", "string[]", "vim.version.version1", {:optional => true}, nil]], [{}, "int", "int"], "Authorization.ModifyRoles", ["vim.fault.AlreadyExists", "vim.fault.InvalidName"]], ["removeRole", "RemoveAuthorizationRole", "vim.version.version1", [["roleId", "int", "vim.version.version1", {}, nil], ["failIfUsed", "boolean", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Authorization.ModifyRoles", ["vim.fault.NotFound", "vim.fault.RemoveFailed"]], ["updateRole", "UpdateAuthorizationRole", "vim.version.version1", [["roleId", "int", "vim.version.version1", {}, nil], ["newName", "string", "vim.version.version1", {}, nil], ["privIds", "string[]", "vim.version.version1", {:optional => true}, nil]], [{}, "void", "void"], "Authorization.ModifyRoles", ["vim.fault.NotFound", "vim.fault.InvalidName", "vim.fault.AlreadyExists"]], ["mergePermissions", "MergePermissions", "vim.version.version1", [["srcRoleId", "int", "vim.version.version1", {}, nil], ["dstRoleId", "int", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Authorization.ReassignRolePermissions", ["vim.fault.NotFound", "vim.fault.AuthMinimumAdminPermission"]], ["retrieveRolePermissions", "RetrieveRolePermissions", "vim.version.version1", [["roleId", "int", "vim.version.version1", {}, nil]], [{:optional => true}, "vim.AuthorizationManager.Permission[]", "vim.AuthorizationManager.Permission[]"], "System.View", ["vim.fault.NotFound"]], ["retrieveEntityPermissions", "RetrieveEntityPermissions", "vim.version.version1", [["entity", "vim.ManagedEntity", "vim.version.version1", {}, "System.Read"], ["inherited", "boolean", "vim.version.version1", {}, nil]], [{:optional => true}, "vim.AuthorizationManager.Permission[]", "vim.AuthorizationManager.Permission[]"], nil, nil], ["retrieveAllPermissions", "RetrieveAllPermissions", "vim.version.version1", [], [{:optional => true}, "vim.AuthorizationManager.Permission[]", "vim.AuthorizationManager.Permission[]"], "System.View", nil], ["setEntityPermissions", "SetEntityPermissions", "vim.version.version1", [["entity", "vim.ManagedEntity", "vim.version.version1", {}, "Authorization.ModifyPermissions"], ["permission", "vim.AuthorizationManager.Permission[]", "vim.version.version1", {:optional => true}, nil]], [{}, "void", "void"], nil, ["vim.fault.UserNotFound", "vim.fault.NotFound", "vim.fault.AuthMinimumAdminPermission"]], ["resetEntityPermissions", "ResetEntityPermissions", "vim.version.version1", [["entity", "vim.ManagedEntity", "vim.version.version1", {}, "Authorization.ModifyPermissions"], ["permission", "vim.AuthorizationManager.Permission[]", "vim.version.version1", {:optional => true}, nil]], [{}, "void", "void"], nil, ["vim.fault.UserNotFound", "vim.fault.NotFound", "vim.fault.AuthMinimumAdminPermission"]], ["removeEntityPermission", "RemoveEntityPermission", "vim.version.version1", [["entity", "vim.ManagedEntity", "vim.version.version1", {}, "Authorization.ModifyPermissions"], ["user", "string", "vim.version.version1", {}, nil], ["isGroup", "boolean", "vim.version.version1", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.NotFound", "vim.fault.AuthMinimumAdminPermission"]], ["hasPrivilegeOnEntity", "HasPrivilegeOnEntity", "vim.version.version7", [["entity", "vim.ManagedEntity", "vim.version.version7", {}, "System.Read"], ["sessionId", "string", "vim.version.version7", {}, nil], ["privId", "string[]", "vim.version.version7", {:optional => true}, nil]], [{:optional => true}, "boolean[]", "boolean[]"], "System.View", nil]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 30 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 212..212
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 212..212
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1187..1187
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1298..1298
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1339..1339
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1339..1339
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1817..1817
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2233..2233
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2238..2238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2238..2238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2248..2248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2401..2401
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2401..2401
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2714..2714

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

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

    create_managed_type("vim.host.DiagnosticSystem", "HostDiagnosticSystem", "vmodl.ManagedObject", "vim.version.version1", [["activePartition", "vim.host.DiagnosticPartition", "vim.version.version1", {:optional => true}, nil]], [["queryAvailablePartition", "QueryAvailablePartition", "vim.version.version1", [], [{:optional => true}, "vim.host.DiagnosticPartition[]", "vim.host.DiagnosticPartition[]"], "Host.Config.Storage", ["vim.fault.HostConfigFault"]], ["selectActivePartition", "SelectActivePartition", "vim.version.version1", [["partition", "vim.host.ScsiDisk.Partition", "vim.version.version1", {:optional => true}, nil]], [{}, "void", "void"], "Host.Config.Storage", ["vim.fault.NotFound", "vim.fault.HostConfigFault"]], ["queryPartitionCreateOptions", "QueryPartitionCreateOptions", "vim.version.version1", [["storageType", "string", "vim.version.version1", {}, nil], ["diagnosticType", "string", "vim.version.version1", {}, nil]], [{:optional => true}, "vim.host.DiagnosticPartition.CreateOption[]", "vim.host.DiagnosticPartition.CreateOption[]"], "Host.Config.Storage", ["vim.fault.HostConfigFault"]], ["queryPartitionCreateDesc", "QueryPartitionCreateDesc", "vim.version.version1", [["diskUuid", "string", "vim.version.version1", {}, nil], ["diagnosticType", "string", "vim.version.version1", {}, nil]], [{}, "vim.host.DiagnosticPartition.CreateDescription", "vim.host.DiagnosticPartition.CreateDescription"], "Host.Config.Storage", ["vim.fault.NotFound", "vim.fault.HostConfigFault"]], ["createDiagnosticPartition", "CreateDiagnosticPartition", "vim.version.version1", [["spec", "vim.host.DiagnosticPartition.CreateSpec", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Host.Config.Storage", ["vim.fault.NotFound", "vim.fault.HostConfigFault"]]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 30 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 212..212
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 212..212
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1187..1187
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1298..1298
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1339..1339
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1339..1339
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1817..1817
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1817..1817
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2233..2233
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2238..2238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2238..2238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2248..2248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2401..2401
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2401..2401
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672

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

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 find_in_path(command, path=ENV["PATH"])
      path.split(":").each do |dir|
        stemcell_copy = File.join(dir, command)
        return stemcell_copy if File.exist?(stemcell_copy)
      end
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/stemcell_creator.rb and 1 other location - About 15 mins to fix
bosh_aws_cpi/lib/cloud/aws/stemcell_creator.rb on lines 76..81

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

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.ClusterComputeResource", "ClusterComputeResource", "vim.ComputeResource", "vim.version.version1", [["configuration", "vim.cluster.ConfigInfo", "vim.version.version1", {}, nil], ["recommendation", "vim.cluster.Recommendation[]", "vim.version.version2", {:optional => true}, "System.Read"], ["drsRecommendation", "vim.cluster.DrsRecommendation[]", "vim.version.version1", {:optional => true}, nil], ["migrationHistory", "vim.cluster.DrsMigration[]", "vim.version.version1", {:optional => true}, nil], ["actionHistory", "vim.cluster.ActionHistory[]", "vim.version.version2", {:optional => true}, nil], ["drsFault", "vim.cluster.DrsFaults[]", "vim.version.version5", {:optional => true}, "System.Read"]], [["reconfigure", "ReconfigureCluster_Task", "vim.version.version1", [["spec", "vim.cluster.ConfigSpec", "vim.version.version1", {}, nil], ["modify", "boolean", "vim.version.version1", {}, nil]], [{}, "vim.Task", "void"], "Host.Inventory.EditCluster", nil], ["applyRecommendation", "ApplyRecommendation", "vim.version.version1", [["key", "string", "vim.version.version1", {}, nil]], [{}, "void", "void"], nil, nil], ["cancelRecommendation", "CancelRecommendation", "vim.version.version6", [["key", "string", "vim.version.version6", {}, nil]], [{}, "void", "void"], "System.Read", nil], ["recommendHostsForVm", "RecommendHostsForVm", "vim.version.version1", [["vm", "vim.VirtualMachine", "vim.version.version1", {}, nil], ["pool", "vim.ResourcePool", "vim.version.version1", {:optional => true}, nil]], [{:optional => true}, "vim.cluster.HostRecommendation[]", "vim.cluster.HostRecommendation[]"], "System.Read", nil], ["addHost", "AddHost_Task", "vim.version.version1", [["spec", "vim.host.ConnectSpec", "vim.version.version1", {}, nil], ["asConnected", "boolean", "vim.version.version1", {}, nil], ["resourcePool", "vim.ResourcePool", "vim.version.version1", {:optional => true}, nil], ["license", "string", "vim.version.version5", {:optional => true}, nil]], [{}, "vim.Task", "vim.HostSystem"], "Host.Inventory.AddHostToCluster", ["vim.fault.InvalidLogin", "vim.fault.HostConnectFault", "vim.fault.DuplicateName"]], ["moveInto", "MoveInto_Task", "vim.version.version1", [["host", "vim.HostSystem[]", "vim.version.version1", {}, "Host.Inventory.MoveHost"]], [{}, "vim.Task", "void"], "Host.Inventory.EditCluster", ["vim.fault.DuplicateName", "vim.fault.TooManyHosts", "vim.fault.InvalidState"]], ["moveHostInto", "MoveHostInto_Task", "vim.version.version1", [["host", "vim.HostSystem", "vim.version.version1", {}, "Host.Inventory.MoveHost"], ["resourcePool", "vim.ResourcePool", "vim.version.version1", {:optional => true}, nil]], [{}, "vim.Task", "void"], "Host.Inventory.EditCluster", ["vim.fault.TooManyHosts", "vim.fault.InvalidState"]], ["refreshRecommendation", "RefreshRecommendation", "vim.version.version2", [], [{}, "void", "void"], "Host.Inventory.EditCluster", nil], ["retrieveDasAdvancedRuntimeInfo", "RetrieveDasAdvancedRuntimeInfo", "vim.version.version5", [], [{:optional => true}, "vim.cluster.DasAdvancedRuntimeInfo", "vim.cluster.DasAdvancedRuntimeInfo"], "System.Read", nil], ["enterMaintenanceMode", "ClusterEnterMaintenanceMode", "vim.version.version7", [["host", "vim.HostSystem[]", "vim.version.version7", {}, "Host.Config.Maintenance"], ["option", "vim.option.OptionValue[]", "vim.version.version7", {:optional => true}, nil]], [{}, "vim.cluster.EnterMaintenanceResult", "vim.cluster.EnterMaintenanceResult"], "System.View", nil]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2373..2373

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

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

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

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

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

Refactorings

Further Reading

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

    create_managed_type("vim.PolicyManager", "PolicyManager", "vmodl.ManagedObject", "vim.version.policy", nil, [["definePolicy", "PolicyManagerDefinePolicy", "vim.version.policy", [["policySpec", "string", "vim.version.policy", {}, nil], ["policyUrn", "string", "vim.version.policy", {:optional => true}, nil]], [{}, "string", "string"], "System.View", nil], ["editEntities", "PolicyManagerEditEntities", "vim.version.policy", [["urn", "string", "vim.version.policy", {}, nil], ["entityId", "string[]", "vim.version.policy", {}, nil], ["add", "boolean", "vim.version.policy", {}, nil]], [{}, "string", "string"], "System.View", nil], ["deletePolicy", "PolicyManagerDeletePolicy", "vim.version.policy", [["urn", "string", "vim.version.policy", {}, nil]], [{}, "void", "void"], "System.View", ["vim.fault.PolicyUrnInvalid"]], ["setPolicyState", "PolicyManagerSetPolicyState", "vim.version.policy", [["urn", "string", "vim.version.policy", {}, nil], ["state", "string", "vim.version.policy", {}, nil], ["entityId", "string[]", "vim.version.policy", {:optional => true}, nil]], [{}, "string", "string"], "System.View", nil], ["queryPolicy", "PolicyManagerQueryPolicy", "vim.version.policy", [["criteria", "vmodl.KeyAnyValue[]", "vim.version.policy", {:optional => true}, nil]], [{}, "string", "string"], "System.View", ["vim.fault.InvalidKey", "vim.fault.InvalidKeyValue", "vim.fault.InvalidKeyCombination"]]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 3 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 260..260
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 260..260
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1473..1473

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

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

    create_data_type("vim.host.LowLevelProvisioningManager.SnapshotLayoutSpec", "HostLowLevelProvisioningManagerSnapshotLayoutSpec", "vmodl.DynamicData", "vim.version.version7", [["id", "int", "vim.version.version7"], ["srcFilename", "string", "vim.version.version7"], ["dstFilename", "string", "vim.version.version7"], ["disk", "vim.host.LowLevelProvisioningManager.DiskLayoutSpec[]", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 13 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 206..206
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 311..311
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 361..361
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1121..1121
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1157..1157
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1254..1254
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1403..1403
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1432..1432
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1613..1613
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1636..1636
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1688..1688
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2296..2296
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2444..2444

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

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

    create_data_type("vim.vm.customization.GuestInstallManager.UnattendedWindowsInstallSpec", "UnattendedWindowsInstallSpec", "vim.vm.customization.GuestInstallManager.UnattendedInstallSpec", "vim.version.logan", [["adminFullName", "string", "vim.version.logan"], ["adminPassword", "string", "vim.version.logan"], ["productKey", "string", "vim.version.logan"], ["timeZone", "string", "vim.version.logan", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 13 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 206..206
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 311..311
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 361..361
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1121..1121
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1157..1157
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1194..1194
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1254..1254
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1403..1403
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1432..1432
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1613..1613
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1688..1688
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2296..2296
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2444..2444

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

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.DiskPartitionInfo.BlockRange", "HostDiskPartitionBlockRange", "vmodl.DynamicData", "vim.version.version1", [["partition", "int", "vim.version.version1", {:optional => true}], ["type", "string", "vim.version.version1"], ["start", "vim.host.DiskDimensions.Lba", "vim.version.version1"], ["end", "vim.host.DiskDimensions.Lba", "vim.version.version1"]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1653..1653
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1724..1724
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1822..1822
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1829..1829

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

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.vm.customization.GuiUnattended", "CustomizationGuiUnattended", "vmodl.DynamicData", "vim.version.version1", [["password", "vim.vm.customization.Password", "vim.version.version1", {:optional => true}], ["timeZone", "int", "vim.version.version1"], ["autoLogon", "boolean", "vim.version.version1"], ["autoLogonCount", "int", "vim.version.version1"]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1089..1089
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1724..1724
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1822..1822
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1829..1829

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

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

    create_data_type("vim.PerformanceManager.ProviderSummary", "PerfProviderSummary", "vmodl.DynamicData", "vim.version.version1", [["entity", "vmodl.ManagedObject", "vim.version.version1"], ["currentSupported", "boolean", "vim.version.version1"], ["summarySupported", "boolean", "vim.version.version1"], ["refreshRate", "int", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 13 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 206..206
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 361..361
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1121..1121
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1157..1157
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1194..1194
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1254..1254
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1403..1403
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1432..1432
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1613..1613
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1636..1636
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1688..1688
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2296..2296
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2444..2444

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

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

    create_data_type("vim.vApp.VAppImportSpec", "VirtualAppImportSpec", "vim.ImportSpec", "vim.version.version5", [["name", "string", "vim.version.version5"], ["vAppConfigSpec", "vim.vApp.VAppConfigSpec", "vim.version.version5"], ["resourcePoolSpec", "vim.ResourceConfigSpec", "vim.version.version5"], ["child", "vim.ImportSpec[]", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 13 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 206..206
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 311..311
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 361..361
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1121..1121
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1157..1157
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1194..1194
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1254..1254
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1403..1403
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1432..1432
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1613..1613
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1636..1636
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1688..1688
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2444..2444

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

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 authorized?
      @auth ||= Rack::Auth::Basic::Request.new(request.env)
      @auth.provided? &&
        @auth.basic? &&
        @auth.credentials &&
Severity: Minor
Found in bosh-registry/lib/bosh/registry/api_controller.rb and 1 other location - About 15 mins to fix
simple_blobstore_server/lib/simple_blobstore_server.rb on lines 57..60

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

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

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

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

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

Refactorings

Further Reading

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

    create_managed_type("vim.StorageResourceManager", "StorageResourceManager", "vmodl.ManagedObject", "vim.version.version6", nil, [["ConfigureDatastoreIORM", "ConfigureDatastoreIORM_Task", "vim.version.version6", [["datastore", "vim.Datastore", "vim.version.version6", {}, "Datastore.Config"], ["spec", "vim.StorageResourceManager.IORMConfigSpec", "vim.version.version6", {}, nil]], [{}, "vim.Task", "void"], nil, ["vim.fault.IORMNotSupportedHostOnDatastore", "vim.fault.InaccessibleDatastore"]], ["QueryIORMConfigOption", "QueryIORMConfigOption", "vim.version.version6", [["host", "vim.HostSystem", "vim.version.version6", {}, nil]], [{}, "vim.StorageResourceManager.IORMConfigOption", "vim.StorageResourceManager.IORMConfigOption"], "Datastore.Config", nil], ["applyRecommendationToPod", "ApplyStorageDrsRecommendationToPod_Task", "vim.version.version7", [["pod", "vim.StoragePod", "vim.version.version7", {}, nil], ["key", "string", "vim.version.version7", {}, nil]], [{}, "vim.Task", "vim.storageDrs.ApplyRecommendationResult"], "System.View", nil], ["applyRecommendation", "ApplyStorageDrsRecommendation_Task", "vim.version.version7", [["key", "string[]", "vim.version.version7", {}, nil]], [{}, "vim.Task", "vim.storageDrs.ApplyRecommendationResult"], "System.View", nil], ["cancelRecommendation", "CancelStorageDrsRecommendation", "vim.version.version7", [["key", "string[]", "vim.version.version7", {}, nil]], [{}, "void", "void"], "System.View", nil], ["refreshRecommendation", "RefreshStorageDrsRecommendation", "vim.version.version7", [["pod", "vim.StoragePod", "vim.version.version7", {}, nil]], [{}, "void", "void"], "System.View", nil], ["configureStorageDrsForPod", "ConfigureStorageDrsForPod_Task", "vim.version.version7", [["pod", "vim.StoragePod", "vim.version.version7", {}, "StoragePod.Config"], ["spec", "vim.storageDrs.ConfigSpec", "vim.version.version7", {}, nil], ["modify", "boolean", "vim.version.version7", {}, nil]], [{}, "vim.Task", "void"], nil, nil], ["recommendDatastores", "RecommendDatastores", "vim.version.version7", [["storageSpec", "vim.storageDrs.StoragePlacementSpec", "vim.version.version7", {}, nil]], [{}, "vim.storageDrs.StoragePlacementResult", "vim.storageDrs.StoragePlacementResult"], "System.View", nil]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 3 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1488..1488
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1488..1488
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1875..1875

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

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

    create_managed_type("vim.host.ServiceSystem", "HostServiceSystem", "vim.ExtensibleManagedObject", "vim.version.version1", [["serviceInfo", "vim.host.ServiceInfo", "vim.version.version1", {}, nil]], [["updatePolicy", "UpdateServicePolicy", "vim.version.version1", [["id", "string", "vim.version.version1", {}, nil], ["policy", "string", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Host.Config.NetService", ["vim.fault.NotFound", "vim.fault.HostConfigFault"]], ["start", "StartService", "vim.version.version1", [["id", "string", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Host.Config.NetService", ["vim.fault.InvalidState", "vim.fault.NotFound", "vim.fault.HostConfigFault"]], ["stop", "StopService", "vim.version.version1", [["id", "string", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Host.Config.NetService", ["vim.fault.InvalidState", "vim.fault.NotFound", "vim.fault.HostConfigFault"]], ["restart", "RestartService", "vim.version.version1", [["id", "string", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Host.Config.NetService", ["vim.fault.InvalidState", "vim.fault.NotFound", "vim.fault.HostConfigFault"]], ["uninstall", "UninstallService", "vim.version.version1", [["id", "string", "vim.version.version1", {}, nil]], [{}, "void", "void"], "Host.Config.NetService", ["vim.fault.NotFound", "vim.fault.HostConfigFault"]], ["refresh", "RefreshServices", "vim.version.version1", [], [{}, "void", "void"], "Host.Config.NetService", nil]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 30 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 212..212
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 212..212
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1187..1187
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1339..1339
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1339..1339
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1817..1817
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1817..1817
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1854..1854
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2233..2233
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2238..2238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2238..2238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2248..2248
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2401..2401
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2401..2401
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2672..2672
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2714..2714

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

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

    create_data_type("vim.vm.QuestionInfo", "VirtualMachineQuestionInfo", "vmodl.DynamicData", "vim.version.version1", [["id", "string", "vim.version.version1"], ["text", "string", "vim.version.version1"], ["choice", "vim.option.ChoiceOption", "vim.version.version1"], ["message", "vim.vm.Message[]", "vim.version.version2", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 13 other locations - About 15 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 206..206
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 311..311
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 361..361
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1121..1121
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1157..1157
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1194..1194
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1254..1254
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1403..1403
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1432..1432
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1636..1636
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1688..1688
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2296..2296
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2444..2444

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

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 authorized?
        @auth ||=  Rack::Auth::Basic::Request.new(request.env)
        @auth.provided? && @auth.basic? && @auth.credentials && @users.include?(@auth.credentials)
      end
Severity: Minor
Found in simple_blobstore_server/lib/simple_blobstore_server.rb and 1 other location - About 15 mins to fix
bosh-registry/lib/bosh/registry/api_controller.rb on lines 54..60

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

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

        if options[:min] && result < options[:min]
          raise ValidationViolatedMin,
                "`#{property}' value (#{result.inspect}) should be greater than #{options[:min].inspect}"
        end
Severity: Minor
Found in bosh-director/lib/bosh/director/validation_helper.rb and 1 other location - About 15 mins to fix
bosh-director/lib/bosh/director/validation_helper.rb on lines 33..36

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

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

        def upload_remote_stemcell(stemcell_location, options = {})
          options                = options.dup
          payload                = { 'location' => stemcell_location }
          options[:payload]      = JSON.generate(payload)
          options[:content_type] = 'application/json'
Severity: Minor
Found in bosh_cli/lib/cli/client/director.rb and 2 other locations - About 15 mins to fix
bosh_cli/lib/cli/client/director.rb on lines 176..182
bosh_cli/lib/cli/client/director.rb on lines 185..191

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

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 reboot_vm(server_id)
      with_thread_name("reboot_vm(#{server_id})") do
        server = with_compute { @compute.servers.get(server_id) }
        cloud_error("Server `#{server_id}' not found") unless server

Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 15 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 342..347

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

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 get_server_name
        user_data = get_user_data
        unless user_data.has_key?("server") && user_data["server"].has_key?("name")
          raise LoadSettingsError, "Cannot get OpenStack server name from user data #{user_data.inspect}"
        end
Severity: Minor
Found in bosh_agent/lib/bosh_agent/infrastructure/openstack/registry.rb and 1 other location - About 15 mins to fix
bosh_agent/lib/bosh_agent/infrastructure/cloudstack/registry.rb on lines 73..78

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

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