cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

    create_data_type("vim.fault.CpuIncompatible81EDX", "CpuIncompatible81EDX", "vim.fault.CpuIncompatible", "vim.version.version2", [["nx", "boolean", "vim.version.version2"], ["ffxsr", "boolean", "vim.version.version2"], ["rdtscp", "boolean", "vim.version.version2"], ["lm", "boolean", "vim.version.version2"], ["other", "boolean", "vim.version.version2"], ["otherOnly", "boolean", "vim.version.version2"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 217..217
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1718..1718
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1721..1721
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1833..1833
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1874..1874

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

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

    create_data_type("vim.alarm.AlarmInfo", "AlarmInfo", "vim.alarm.AlarmSpec", "vim.version.version1", [["key", "string", "vim.version.version1"], ["alarm", "vim.alarm.Alarm", "vim.version.version1"], ["entity", "vim.ManagedEntity", "vim.version.version1"], ["lastModifiedTime", "vmodl.DateTime", "vim.version.version1"], ["lastModifiedUser", "string", "vim.version.version1"], ["creationEventId", "int", "vim.version.version1"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 217..217
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1718..1718
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1721..1721
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1833..1833
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2480..2480

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

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

    create_data_type("vim.vm.device.VirtualDiskOption.SparseVer2BackingOption", "VirtualDiskSparseVer2BackingOption", "vim.vm.device.VirtualDeviceOption.FileBackingOption", "vim.version.version1", [["diskMode", "vim.option.ChoiceOption", "vim.version.version1"], ["split", "vim.option.BoolOption", "vim.version.version1"], ["writeThrough", "vim.option.BoolOption", "vim.version.version1"], ["growable", "boolean", "vim.version.version1"], ["hotGrowable", "boolean", "vim.version.version2"], ["uuid", "boolean", "vim.version.version2"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 217..217
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1721..1721
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1833..1833
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1874..1874
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2480..2480

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

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.Snapshot", "VirtualMachineSnapshot", "vim.ExtensibleManagedObject", "vim.version.version1", [["config", "vim.vm.ConfigInfo", "vim.version.version1", {}, nil], ["childSnapshot", "vim.vm.Snapshot[]", "vim.version.version6", {:optional => true}, nil]], [["revert", "RevertToSnapshot_Task", "vim.version.version1", [["host", "vim.HostSystem", "vim.version.version1", {:optional => true}, nil], ["suppressPowerOn", "boolean", "vim.version.version4", {:optional => true}, nil]], [{}, "vim.Task", "void"], "VirtualMachine.State.RevertToSnapshot", ["vim.fault.TaskInProgress", "vim.fault.InsufficientResourcesFault", "vim.fault.InvalidState", "vim.fault.FileFault", "vim.fault.VmConfigFault"]], ["remove", "RemoveSnapshot_Task", "vim.version.version1", [["removeChildren", "boolean", "vim.version.version1", {}, nil], ["consolidate", "boolean", "vim.version.version7", {:optional => true}, nil]], [{}, "vim.Task", "void"], "VirtualMachine.State.RemoveSnapshot", ["vim.fault.TaskInProgress"]], ["rename", "RenameSnapshot", "vim.version.version1", [["name", "string", "vim.version.version1", {:optional => true}, nil], ["description", "string", "vim.version.version1", {:optional => true}, nil]], [{}, "void", "void"], "VirtualMachine.State.RenameSnapshot", ["vim.fault.InvalidName", "vim.fault.TaskInProgress", "vim.fault.InvalidState"]]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1230..1230

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

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

      rescue Excon::Errors::InternalServerError => e
        unless retries >= MAX_RETRIES
          retries += 1
          @logger.debug("OpenStack API Internal Server error, retrying (#{retries})") if @logger
          sleep(DEFAULT_RETRY_TIMEOUT)
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/helpers.rb and 1 other location - About 25 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/helpers.rb on lines 31..39

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

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

      rescue Excon::Errors::InternalServerError => e
        unless retries >= MAX_RETRIES
          retries += 1
          @logger.debug("CloudStack API Internal Server error, retrying (#{retries})") if @logger
          sleep(DEFAULT_RETRY_TIMEOUT)
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/helpers.rb and 1 other location - About 25 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/helpers.rb on lines 44..52

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

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 ensure_same_availability_zone(disks, default)
      zones = disks.map { |disk| disk.zone_name }
      zones << default if default
      zones.uniq!
      cloud_error "can't use multiple availability zones: %s" %
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 25 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 621..627

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

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 ensure_same_availability_zone(disks, default)
      zones = disks.map { |disk| disk.availability_zone }
      zones << default if default
      zones.uniq!
      cloud_error "can't use multiple availability zones: %s" %
Severity: Minor
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 25 mins to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb on lines 598..604

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

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.DatastoreInfo", "VirtualMachineDatastoreInfo", "vim.vm.TargetInfo", "vim.version.version1", [["datastore", "vim.Datastore.Summary", "vim.version.version1"], ["capability", "vim.Datastore.Capability", "vim.version.version1"], ["maxFileSize", "long", "vim.version.version1"], ["mode", "string", "vim.version.version1"], ["vStorageSupport", "string", "vim.version.version7", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1172..1172
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1819..1819
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2378..2378
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2669..2669

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

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.IpSecConfig.IpSecPolicy", "HostIpSecConfigIpSecPolicy", "vmodl.DynamicData", "vim.version.ipv6", [["priority", "int", "vim.version.ipv6"], ["securityAssociationName", "string", "vim.version.ipv6"], ["sourceEndPoint", "vim.host.IpSecConfig.EndPoint", "vim.version.ipv6"], ["destinationEndPoint", "vim.host.IpSecConfig.EndPoint", "vim.version.ipv6"], ["upperLayerProtocol", "string[]", "vim.version.ipv6", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1819..1819
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2378..2378
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2669..2669
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2677..2677

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

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.AuthorizationManager.Role", "AuthorizationRole", "vmodl.DynamicData", "vim.version.version1", [["roleId", "int", "vim.version.version1"], ["system", "boolean", "vim.version.version1"], ["name", "string", "vim.version.version1"], ["info", "vim.Description", "vim.version.version1"], ["privilege", "string[]", "vim.version.version1", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1172..1172
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2378..2378
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2669..2669
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2677..2677

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

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.DiagnosticPartition.CreateSpec", "HostDiagnosticPartitionCreateSpec", "vmodl.DynamicData", "vim.version.version1", [["storageType", "string", "vim.version.version1"], ["diagnosticType", "string", "vim.version.version1"], ["id", "vim.host.ScsiDisk.Partition", "vim.version.version1"], ["partition", "vim.host.DiskPartitionInfo.Specification", "vim.version.version1"], ["active", "boolean", "vim.version.version1", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1172..1172
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1819..1819
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2378..2378
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2677..2677

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

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 get_file(id, file)
        response = @client.get(url(id), {}, @headers) do |block|
          file.write(block)
        end

Severity: Minor
Found in blobstore_client/lib/blobstore_client/dav_blobstore_client.rb and 1 other location - About 25 mins to fix
blobstore_client/lib/blobstore_client/simple_blobstore_client.rb on lines 37..44

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

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_managed_type("vim.profile.ProfileManager", "ProfileManager", "vmodl.ManagedObject", "vim.version.version5", [["profile", "vim.profile.Profile[]", "vim.version.version5", {:optional => true}, nil]], [["createProfile", "CreateProfile", "vim.version.version5", [["createSpec", "vim.profile.Profile.CreateSpec", "vim.version.version5", {}, nil]], [{}, "vim.profile.Profile", "vim.profile.Profile"], "Profile.Create", ["vim.fault.DuplicateName"]], ["queryPolicyMetadata", "QueryPolicyMetadata", "vim.version.version5", [["policyName", "string[]", "vim.version.version5", {:optional => true}, nil], ["profile", "vim.profile.Profile", "vim.version.version7", {:optional => true}, nil]], [{:optional => true}, "vim.profile.PolicyMetadata[]", "vim.profile.PolicyMetadata[]"], "System.View", nil], ["findAssociatedProfile", "FindAssociatedProfile", "vim.version.version5", [["entity", "vim.ManagedEntity", "vim.version.version5", {}, nil]], [{:optional => true}, "vim.profile.Profile[]", "vim.profile.Profile[]"], "System.View", nil]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 224..224
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1392..1392
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1392..1392
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1479..1479

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

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_managed_type("vim.profile.host.ProfileManager", "HostProfileManager", "vim.profile.ProfileManager", "vim.version.version5", nil, [["applyHostConfiguration", "ApplyHostConfig_Task", "vim.version.version5", [["host", "vim.HostSystem", "vim.version.version5", {}, nil], ["configSpec", "vim.host.ConfigSpec", "vim.version.version5", {}, nil], ["userInput", "vim.profile.DeferredPolicyOptionParameter[]", "vim.version.version7", {:optional => true}, nil]], [{}, "vim.Task", "void"], nil, ["vim.fault.InvalidState", "vim.fault.HostConfigFailed"]], ["generateConfigTaskList", "GenerateConfigTaskList", "vim.version.version5", [["configSpec", "vim.host.ConfigSpec", "vim.version.version5", {}, nil], ["host", "vim.HostSystem", "vim.version.version5", {}, nil]], [{}, "vim.profile.host.ProfileManager.ConfigTaskList", "vim.profile.host.ProfileManager.ConfigTaskList"], "System.View", nil], ["queryProfileMetadata", "QueryHostProfileMetadata", "vim.version.version5", [["profileName", "vmodl.TypeName[]", "vim.version.version5", {:optional => true}, nil], ["profile", "vim.profile.Profile", "vim.version.version7", {:optional => true}, nil]], [{:optional => true}, "vim.profile.ProfileMetadata[]", "vim.profile.ProfileMetadata[]"], "System.View", nil], ["queryProfileStructure", "QueryProfileStructure", "vim.version.version7", [["profile", "vim.profile.Profile", "vim.version.version7", {:optional => true}, nil]], [{}, "vim.profile.ProfileStructure", "vim.profile.ProfileStructure"], "System.View", nil], ["createDefaultProfile", "CreateDefaultProfile", "vim.version.version5", [["profileType", "vmodl.TypeName", "vim.version.version5", {}, nil], ["profileTypeName", "string", "vim.version.version7", {:optional => true}, nil], ["profile", "vim.profile.Profile", "vim.version.version7", {:optional => true}, nil]], [{}, "vim.profile.ApplyProfile", "vim.profile.ApplyProfile"], "System.View", nil], ["updateAnswerFile", "UpdateAnswerFile_Task", "vim.version.version7", [["host", "vim.HostSystem", "vim.version.version7", {}, nil], ["configSpec", "vim.profile.host.ProfileManager.AnswerFileCreateSpec", "vim.version.version7", {}, nil]], [{}, "vim.Task", "void"], "Profile.Edit", ["vim.fault.AnswerFileUpdateFailed"]], ["retrieveAnswerFile", "RetrieveAnswerFile", "vim.version.version7", [["host", "vim.HostSystem", "vim.version.version7", {}, nil]], [{:optional => true}, "vim.profile.host.AnswerFile", "vim.profile.host.AnswerFile"], "System.View", nil], ["exportAnswerFile", "ExportAnswerFile_Task", "vim.version.version7", [["host", "vim.HostSystem", "vim.version.version7", {}, nil]], [{}, "vim.Task", "string"], "Profile.Export", nil], ["checkAnswerFileStatus", "CheckAnswerFileStatus_Task", "vim.version.version7", [["host", "vim.HostSystem[]", "vim.version.version7", {}, nil]], [{:optional => true}, "vim.Task", "vim.profile.host.AnswerFileStatusResult[]"], "System.View", nil], ["queryAnswerFileStatus", "QueryAnswerFileStatus", "vim.version.version7", [["host", "vim.HostSystem[]", "vim.version.version7", {}, nil]], [{:optional => true}, "vim.profile.host.AnswerFileStatusResult[]", "vim.profile.host.AnswerFileStatusResult[]"], "System.View", nil]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 224..224
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1392..1392
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1392..1392
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1417..1417

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

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.Datastore.Info", "DatastoreInfo", "vmodl.DynamicData", "vim.version.version1", [["name", "string", "vim.version.version1"], ["url", "string", "vim.version.version1"], ["freeSpace", "long", "vim.version.version1"], ["maxFileSize", "long", "vim.version.version1"], ["timestamp", "vmodl.DateTime", "vim.version.version5", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1172..1172
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1819..1819
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2669..2669
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2677..2677

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

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_managed_type("vim.EnvironmentBrowser", "EnvironmentBrowser", "vmodl.ManagedObject", "vim.version.version1", [["datastoreBrowser", "vim.host.DatastoreBrowser", "vim.version.version1", {:optional => true}, "System.View"]], [["queryConfigOptionDescriptor", "QueryConfigOptionDescriptor", "vim.version.version1", [], [{:optional => true}, "vim.vm.ConfigOptionDescriptor[]", "vim.vm.ConfigOptionDescriptor[]"], "System.View", nil], ["queryConfigOption", "QueryConfigOption", "vim.version.version1", [["key", "string", "vim.version.version1", {:optional => true}, nil], ["host", "vim.HostSystem", "vim.version.version1", {:optional => true}, nil]], [{:optional => true}, "vim.vm.ConfigOption", "vim.vm.ConfigOption"], "System.View", nil], ["queryConfigTarget", "QueryConfigTarget", "vim.version.version1", [["host", "vim.HostSystem", "vim.version.version1", {:optional => true}, nil]], [{:optional => true}, "vim.vm.ConfigTarget", "vim.vm.ConfigTarget"], "System.View", nil], ["queryTargetCapabilities", "QueryTargetCapabilities", "vim.version.version5", [["host", "vim.HostSystem", "vim.version.version5", {:optional => true}, nil]], [{:optional => true}, "vim.host.Capability", "vim.host.Capability"], "System.View", nil]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1392..1392
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1392..1392
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1417..1417
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1479..1479

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

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_managed_type("vim.HttpNfcLease", "HttpNfcLease", "vmodl.ManagedObject", "vim.version.version5", [["initializeProgress", "int", "vim.version.version5", {}, nil], ["info", "vim.HttpNfcLease.Info", "vim.version.version5", {:optional => true}, nil], ["state", "vim.HttpNfcLease.State", "vim.version.version5", {}, nil], ["error", "vmodl.MethodFault", "vim.version.version5", {:optional => true}, nil]], [["getManifest", "HttpNfcLeaseGetManifest", "vim.version.version6", [], [{:optional => true}, "vim.HttpNfcLease.ManifestEntry[]", "vim.HttpNfcLease.ManifestEntry[]"], nil, ["vim.fault.Timedout", "vim.fault.InvalidState"]], ["complete", "HttpNfcLeaseComplete", "vim.version.version5", [], [{}, "void", "void"], nil, ["vim.fault.Timedout", "vim.fault.InvalidState"]], ["abort", "HttpNfcLeaseAbort", "vim.version.version5", [["fault", "vmodl.MethodFault", "vim.version.version5", {:optional => true}, nil]], [{}, "void", "void"], nil, ["vim.fault.Timedout", "vim.fault.InvalidState"]], ["progress", "HttpNfcLeaseProgress", "vim.version.version5", [["percent", "int", "vim.version.version5", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.Timedout"]]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 25 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1848..1848
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2401..2401

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

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

      rescue Excon::Errors::BadRequest => e
        badrequest = parse_api_response(e.response, "badRequest")
        details = badrequest.nil? ? "" : " (#{badrequest["message"]})"
        cloud_error("CloudStack API Bad Request#{details}. Check task debug log for details.", e)
      rescue Excon::Errors::InternalServerError => e
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/helpers.rb and 1 other location - About 25 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/helpers.rb on lines 40..52

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

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

          'network' => {
            'type' => 'manual',
            'cidr' => env['BOSH_VSPHERE_NETWORK_CIDR'],
            'reserved' => env['BOSH_VSPHERE_NETWORK_RESERVED'].split(/[|,]/).map(&:strip),
            'static' => [env['BOSH_VSPHERE_NETWORK_STATIC']],
Severity: Minor
Found in bosh-dev/lib/bosh/dev/vsphere/bat_deployment_manifest.rb and 1 other location - About 25 mins to fix
bosh-dev/lib/bosh/dev/vcloud/bat_deployment_manifest.rb on lines 29..35

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

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