cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

func chanOfRecv() {
    // MakeChan(<-chan) is a no-op.
    t := reflect.ChanOf(reflect.RecvDir, reflect.TypeOf(&a))
    print(reflect.Zero(t).Interface())                      // @types <-chan *int
    print(reflect.MakeChan(t, 0).Interface().(<-chan *int)) // @pointsto
go_agent/src/code.google.com/p/go.tools/pointer/testdata/chanreflect.go on lines 47..53

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.vm.device.VirtualDiskOption.FlatVer2BackingOption", "VirtualDiskFlatVer2BackingOption", "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"], ["thinProvisioned", "vim.option.BoolOption", "vim.version.version5"], ["eagerlyScrub", "vim.option.BoolOption", "vim.version.version5"], ["deltaDiskFormat", "vim.option.ChoiceOption", "vim.version.version7"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 50 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 274..274
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2368..2368

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

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

module Bosh::Dev::VSphere
  # Requires folder structure:
  #   ...repo/<env-name>/<deployment-name>/manifest.yml
  class DeploymentAccount
    attr_reader :bosh_user, :bosh_password
Severity: Minor
Found in bosh-dev/lib/bosh/dev/vsphere/deployment_account.rb and 1 other location - About 50 mins to fix
bosh-dev/lib/bosh/dev/vcloud/deployment_account.rb on lines 3..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 42.

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 use_existing_jobs(jobs)
        return if jobs.empty?

        single_step_stage("Processing #{jobs.size} existing job#{"s" if jobs.size > 1}") do
          jobs.each do |template, _|
Severity: Minor
Found in bosh-director/lib/bosh/director/jobs/update_release.rb and 1 other location - About 50 mins to fix
bosh-director/lib/bosh/director/jobs/update_release.rb on lines 261..268

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.ComputeResource.Summary", "ComputeResourceSummary", "vmodl.DynamicData", "vim.version.version1", [["totalCpu", "int", "vim.version.version1"], ["totalMemory", "long", "vim.version.version1"], ["numCpuCores", "short", "vim.version.version1"], ["numCpuThreads", "short", "vim.version.version1"], ["effectiveCpu", "int", "vim.version.version1"], ["effectiveMemory", "long", "vim.version.version1"], ["numHosts", "int", "vim.version.version1"], ["numEffectiveHosts", "int", "vim.version.version1"], ["overallStatus", "vim.ManagedEntity.Status", "vim.version.version1"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 50 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 274..274
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1720..1720

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

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

module Bosh::Dev::VCloud
  # Requires folder structure:
  #   ...repo/<env-name>/<deployment-name>/manifest.yml
  class DeploymentAccount
    attr_reader :bosh_user, :bosh_password
Severity: Minor
Found in bosh-dev/lib/bosh/dev/vcloud/deployment_account.rb and 1 other location - About 50 mins to fix
bosh-dev/lib/bosh/dev/vsphere/deployment_account.rb on lines 3..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 42.

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.LicenseManager.DiagnosticInfo", "LicenseDiagnostics", "vmodl.DynamicData", "vim.version.version2", [["sourceLastChanged", "vmodl.DateTime", "vim.version.version2"], ["sourceLost", "string", "vim.version.version2"], ["sourceLatency", "float", "vim.version.version2"], ["licenseRequests", "string", "vim.version.version2"], ["licenseRequestFailures", "string", "vim.version.version2"], ["licenseFeatureUnknowns", "string", "vim.version.version2"], ["opState", "vim.LicenseManager.LicenseState", "vim.version.version2"], ["lastStatusUpdate", "vmodl.DateTime", "vim.version.version2"], ["opFailureMessage", "string", "vim.version.version2"]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 50 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1720..1720
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2368..2368

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

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 use_existing_packages(packages)
        return if packages.empty?

        single_step_stage("Processing #{packages.size} existing package#{"s" if packages.size > 1}") do
          packages.each do |package, _|
Severity: Minor
Found in bosh-director/lib/bosh/director/jobs/update_release.rb and 1 other location - About 50 mins to fix
bosh-director/lib/bosh/director/jobs/update_release.rb on lines 461..468

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

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

func ext۰syscall۰Lstat(fn *ssa.Function, args []value) value {
    // func Lstat(name string, stat *Stat_t) (err error)
    name := args[0].(string)
    stat := (*args[1].(*value)).(structure)

go_agent/src/code.google.com/p/go.tools/ssa/interp/external_unix.go on lines 38..47
go_agent/src/code.google.com/p/go.tools/ssa/interp/external_unix.go on lines 113..122

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

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

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

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

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

Refactorings

Further Reading

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

func (a *analysis) load(dst, src nodeid, offset, sizeof uint32) {
    if dst == 0 {
        return // load of non-pointerlike value
    }
    if src == 0 && dst == 0 {
Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/pointer/gen.go and 1 other location - About 45 mins to fix
go_agent/src/code.google.com/p/go.tools/pointer/gen.go on lines 327..342

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

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

    create_data_type("vim.cluster.DrsConfigInfo", "ClusterDrsConfigInfo", "vmodl.DynamicData", "vim.version.version1", [["enabled", "boolean", "vim.version.version1", {:optional => true}], ["enableVmBehaviorOverrides", "boolean", "vim.version.version5", {:optional => true}], ["defaultVmBehavior", "vim.cluster.DrsConfigInfo.DrsBehavior", "vim.version.version1", {:optional => true}], ["vmotionRate", "int", "vim.version.version1", {:optional => true}], ["option", "vim.option.OptionValue[]", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.host.PatchManager.PatchManagerOperationSpec", "HostPatchManagerPatchManagerOperationSpec", "vmodl.DynamicData", "vim.version.version5", [["proxy", "string", "vim.version.version5", {:optional => true}], ["port", "int", "vim.version.version5", {:optional => true}], ["userName", "string", "vim.version.version5", {:optional => true}], ["password", "string", "vim.version.version5", {:optional => true}], ["cmdOption", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.vApp.OvfSectionInfo", "VAppOvfSectionInfo", "vmodl.DynamicData", "vim.version.version5", [["key", "int", "vim.version.version5", {:optional => true}], ["namespace", "string", "vim.version.version5", {:optional => true}], ["type", "string", "vim.version.version5", {:optional => true}], ["atEnvelopeLevel", "boolean", "vim.version.version5", {:optional => true}], ["contents", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.net.DnsConfigSpec", "NetDnsConfigSpec", "vmodl.DynamicData", "vim.version.version6", [["dhcp", "boolean", "vim.version.version6", {:optional => true}], ["hostName", "string", "vim.version.version6", {:optional => true}], ["domainName", "string", "vim.version.version6", {:optional => true}], ["ipAddress", "string[]", "vim.version.version6", {:optional => true}], ["searchDomain", "string[]", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.profile.host.HostProfile.ConfigInfo", "HostProfileConfigInfo", "vim.profile.Profile.ConfigInfo", "vim.version.version5", [["applyProfile", "vim.profile.host.HostApplyProfile", "vim.version.version5", {:optional => true}], ["defaultComplyProfile", "vim.profile.ComplianceProfile", "vim.version.version5", {:optional => true}], ["defaultComplyLocator", "vim.profile.ComplianceLocator[]", "vim.version.version5", {:optional => true}], ["customComplyProfile", "vim.profile.ComplianceProfile", "vim.version.version5", {:optional => true}], ["disabledExpressionList", "string[]", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.vm.device.VirtualVideoCardOption", "VirtualVideoCardOption", "vim.vm.device.VirtualDeviceOption", "vim.version.version1", [["videoRamSizeInKB", "vim.option.LongOption", "vim.version.version1", {:optional => true}], ["numDisplays", "vim.option.IntOption", "vim.version.version4", {:optional => true}], ["useAutoDetect", "vim.option.BoolOption", "vim.version.version4", {:optional => true}], ["support3D", "vim.option.BoolOption", "vim.version.version4", {:optional => true}], ["supportMPT", "vim.option.BoolOption", "vim.version.logan", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.VirtualApp.Summary", "VirtualAppSummary", "vim.ResourcePool.Summary", "vim.version.version5", [["product", "vim.vApp.ProductInfo", "vim.version.version5", {:optional => true}], ["vAppState", "vim.VirtualApp.VAppState", "vim.version.version5", {:optional => true}], ["suspended", "boolean", "vim.version.version6", {:optional => true}], ["installBootRequired", "boolean", "vim.version.version5", {:optional => true}], ["instanceUuid", "string", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.cluster.ConfigSpec", "ClusterConfigSpec", "vmodl.DynamicData", "vim.version.version1", [["dasConfig", "vim.cluster.DasConfigInfo", "vim.version.version1", {:optional => true}], ["dasVmConfigSpec", "vim.cluster.DasVmConfigSpec[]", "vim.version.version1", {:optional => true}], ["drsConfig", "vim.cluster.DrsConfigInfo", "vim.version.version1", {:optional => true}], ["drsVmConfigSpec", "vim.cluster.DrsVmConfigSpec[]", "vim.version.version1", {:optional => true}], ["rulesSpec", "vim.cluster.RuleSpec[]", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.host.SnmpSystem.SnmpConfigSpec", "HostSnmpConfigSpec", "vmodl.DynamicData", "vim.version.version2", [["enabled", "boolean", "vim.version.version2", {:optional => true}], ["port", "int", "vim.version.version2", {:optional => true}], ["readOnlyCommunities", "string[]", "vim.version.version2", {:optional => true}], ["trapTargets", "vim.host.SnmpSystem.SnmpConfigSpec.Destination[]", "vim.version.version2", {:optional => true}], ["option", "vim.KeyValue[]", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1515..1515
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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

    create_data_type("vim.storageDrs.VmConfigInfo", "StorageDrsVmConfigInfo", "vmodl.DynamicData", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {:optional => true}], ["enabled", "boolean", "vim.version.version7", {:optional => true}], ["behavior", "string", "vim.version.version7", {:optional => true}], ["intraVmAffinity", "boolean", "vim.version.version7", {:optional => true}], ["intraVmAntiAffinity", "vim.storageDrs.VirtualDiskAntiAffinityRuleSpec", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 19 other locations - About 45 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 335..335
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 409..409
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 415..415
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1016..1016
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1023..1023
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1070..1070
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1238..1238
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1301..1301
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1360..1360
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1474..1474
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1529..1529
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1541..1541
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1575..1575
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1793..1793
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1794..1794
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1846..1846
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2275..2275
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2389..2389
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2434..2434

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

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