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 TranslatorTo(charset string) (Translator, error) {
    var err error
    var tr Translator
    for _, f := range factories {
        tr, err = f.TranslatorTo(charset)
Severity: Minor
Found in go_agent/src/code.google.com/p/go-charset/charset/charset.go and 1 other location - About 30 mins to fix
go_agent/src/code.google.com/p/go-charset/charset/charset.go on lines 108..121

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

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 validate_options(cloud_config)
        unless cloud_config.has_key?("cloudstack") &&
            cloud_config["cloudstack"].is_a?(Hash) &&
            cloud_config["cloudstack"]["endpoint"] &&
            cloud_config["cloudstack"]["api_key"] &&
Severity: Minor
Found in bosh-registry/lib/bosh/registry/instance_manager/cloudstack.rb and 1 other location - About 30 mins to fix
bosh-registry/lib/bosh/registry/instance_manager/aws.rb on lines 27..34

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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.vm.guest.ProcessManager", "GuestProcessManager", "vmodl.ManagedObject", "vim.version.version7", nil, [["startProgram", "StartProgramInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Execute"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["spec", "vim.vm.guest.ProcessManager.ProgramSpec", "vim.version.version7", {}, nil]], [{}, "long", "long"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress", "vim.fault.FileFault"]], ["listProcesses", "ListProcessesInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Query"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["pids", "long[]", "vim.version.version7", {:optional => true}, nil]], [{:optional => true}, "vim.vm.guest.ProcessManager.ProcessInfo[]", "vim.vm.guest.ProcessManager.ProcessInfo[]"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress"]], ["terminateProcess", "TerminateProcessInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Execute"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["pid", "long", "vim.version.version7", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress"]], ["readEnvironmentVariable", "ReadEnvironmentVariableInGuest", "vim.version.version7", [["vm", "vim.VirtualMachine", "vim.version.version7", {}, "VirtualMachine.GuestOperations.Query"], ["auth", "vim.vm.guest.GuestAuthentication", "vim.version.version7", {}, nil], ["names", "string[]", "vim.version.version7", {:optional => true}, nil]], [{:optional => true}, "string[]", "string[]"], nil, ["vim.fault.GuestOperationsFault", "vim.fault.InvalidState", "vim.fault.TaskInProgress"]]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1800..1800
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1800..1800

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.scheduler.ScheduledTaskSpec", "ScheduledTaskSpec", "vmodl.DynamicData", "vim.version.version1", [["name", "string", "vim.version.version1"], ["description", "string", "vim.version.version1"], ["enabled", "boolean", "vim.version.version1"], ["scheduler", "vim.scheduler.TaskScheduler", "vim.version.version1"], ["action", "vim.action.Action", "vim.version.version1"], ["notification", "string", "vim.version.version1", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 230..230

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.Extension.ServerInfo", "ExtensionServerInfo", "vmodl.DynamicData", "vim.version.version2", [["url", "string", "vim.version.version2"], ["description", "vim.Description", "vim.version.version2"], ["company", "string", "vim.version.version2"], ["type", "string", "vim.version.version2"], ["adminEmail", "string[]", "vim.version.version2"], ["serverThumbprint", "string", "vim.version.version6", {:optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1501..1501

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

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 validate_options(cloud_config)
        unless cloud_config.has_key?("aws") &&
            cloud_config["aws"].is_a?(Hash) &&
            cloud_config["aws"]["access_key_id"] &&
            cloud_config["aws"]["secret_access_key"] &&
Severity: Minor
Found in bosh-registry/lib/bosh/registry/instance_manager/aws.rb and 1 other location - About 30 mins to fix
bosh-registry/lib/bosh/registry/instance_manager/cloudstack.rb on lines 36..43

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

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.HbrManager.ReplicationVmInfo.ProgressInfo", "ReplicationVmProgressInfo", "vmodl.DynamicData", "vim.version.version7", [["progress", "int", "vim.version.version7"], ["bytesTransferred", "long", "vim.version.version7"], ["bytesToTransfer", "long", "vim.version.version7"], ["checksumTotalBytes", "long", "vim.version.version7", {:optional => true}], ["checksumComparedBytes", "long", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 213..213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 398..398
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1359..1359
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1835..1835

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

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.net.DnsConfigInfo", "NetDnsConfigInfo", "vmodl.DynamicData", "vim.version.version6", [["dhcp", "boolean", "vim.version.version6"], ["hostName", "string", "vim.version.version6"], ["domainName", "string", "vim.version.version6"], ["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 4 other locations - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 213..213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 244..244
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 398..398
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1835..1835

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

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.ResourcePool.Summary", "ResourcePoolSummary", "vmodl.DynamicData", "vim.version.version1", [["name", "string", "vim.version.version1"], ["config", "vim.ResourceConfigSpec", "vim.version.version1"], ["runtime", "vim.ResourcePool.RuntimeInfo", "vim.version.version1"], ["quickStats", "vim.ResourcePool.Summary.QuickStats", "vim.version.version5", {:optional => true}], ["configuredMemoryMB", "int", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 213..213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 244..244
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 398..398
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1359..1359

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

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 object_exists?(id)
        response = @client.head(url(id), header: @headers)
        if response.status == 200
          true
        elsif response.status == 404
blobstore_client/lib/blobstore_client/dav_blobstore_client.rb on lines 60..68

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

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.CustomizationSpecInfo", "CustomizationSpecInfo", "vmodl.DynamicData", "vim.version.version1", [["name", "string", "vim.version.version1"], ["description", "string", "vim.version.version1"], ["type", "string", "vim.version.version1"], ["changeVersion", "string", "vim.version.version1", {:optional => true}], ["lastUpdateTime", "vmodl.DateTime", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 244..244
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 398..398
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1359..1359
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1835..1835

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

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

        packages_to_delete.each do |package|
          track_and_log("#{package.name}/#{package.version}") do
            logger.info("Package #{package.name}/#{package.version} " +
                        "is only used by this release version " +
                        "and will be deleted")
Severity: Minor
Found in bosh-director/lib/bosh/director/jobs/delete_release.rb and 1 other location - About 30 mins to fix
bosh-director/lib/bosh/director/jobs/delete_release.rb on lines 67..72

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

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 object_exists?(id)
        response = @client.head(url(id), header: @headers)
        if response.status == 200
          true
        elsif response.status == 404
Severity: Minor
Found in blobstore_client/lib/blobstore_client/dav_blobstore_client.rb and 1 other location - About 30 mins to fix
blobstore_client/lib/blobstore_client/simple_blobstore_client.rb on lines 56..64

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

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.alarm.StateAlarmExpression", "StateAlarmExpression", "vim.alarm.AlarmExpression", "vim.version.version1", [["operator", "vim.alarm.StateAlarmExpression.StateOperator", "vim.version.version1"], ["type", "vmodl.TypeName", "vim.version.version1"], ["statePath", "vmodl.PropertyPath", "vim.version.version1"], ["yellow", "string", "vim.version.version1", {:optional => true}], ["red", "string", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 4 other locations - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 213..213
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 244..244
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1359..1359
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1835..1835

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

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 update_spec(spec)
        properties = spec.properties

        properties['vcd'] =
          config.spec_properties['vcd'] ||
bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/vsphere.rb on lines 25..33

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.vm.ConfigOptionDescriptor", "VirtualMachineConfigOptionDescriptor", "vmodl.DynamicData", "vim.version.version1", [["key", "string", "vim.version.version1"], ["description", "string", "vim.version.version1", {:optional => true}], ["host", "vim.HostSystem[]", "vim.version.version1", {:optional => true}], ["createSupported", "boolean", "vim.version.version4"], ["defaultConfigOption", "boolean", "vim.version.version4"]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 500..500

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

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.LicenseAssignmentManager", "LicenseAssignmentManager", "vmodl.ManagedObject", "vim.version.version5", nil, [["updateAssignedLicense", "UpdateAssignedLicense", "vim.version.version5", [["entity", "string", "vim.version.version5", {}, nil], ["licenseKey", "string", "vim.version.version5", {}, nil], ["entityDisplayName", "string", "vim.version.version5", {:optional => true}, nil]], [{}, "vim.LicenseManager.LicenseInfo", "vim.LicenseManager.LicenseInfo"], "Global.Licenses", ["vim.fault.LicenseEntityNotFound"]], ["removeAssignedLicense", "RemoveAssignedLicense", "vim.version.version5", [["entityId", "string", "vim.version.version5", {}, nil]], [{}, "void", "void"], "Global.Licenses", ["vim.fault.LicenseEntityNotFound"]], ["queryAssignedLicenses", "QueryAssignedLicenses", "vim.version.version5", [["entityId", "string", "vim.version.version5", {:optional => true}, nil]], [{}, "vim.LicenseAssignmentManager.LicenseAssignment[]", "vim.LicenseAssignmentManager.LicenseAssignment[]"], "System.View", nil]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2325..2325

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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 set_vm_metadata(server_id, metadata)
      with_thread_name("set_vm_metadata(#{server_id}, ...)") do
        with_compute do
          server = @compute.servers.get(server_id)
          cloud_error("Server `#{server_id}' not found") unless server
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 30 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 580..587

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.host.PlugStoreTopology.Plugin", "HostPlugStoreTopologyPlugin", "vmodl.DynamicData", "vim.version.version5", [["key", "string", "vim.version.version5"], ["name", "string", "vim.version.version5"], ["device", "vim.host.PlugStoreTopology.Device[]", "vim.version.version5", {:link => true, :optional => true}], ["claimedPath", "vim.host.PlugStoreTopology.Path[]", "vim.version.version5", {:link => true, :optional => true}]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 30 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1342..1342

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

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 parse_api_response(response, *keys)
      unless response.body.empty?
        begin
          body = JSON.parse(response.body)
          key = keys.detect { |k| body.has_key?(k)}
Severity: Minor
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/helpers.rb and 1 other location - About 30 mins to fix
bosh_openstack_cpi/lib/cloud/openstack/helpers.rb on lines 61..71

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

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