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.cluster.DasConfigInfo", "ClusterDasConfigInfo", "vmodl.DynamicData", "vim.version.version1", [["enabled", "boolean", "vim.version.version1", {:optional => true}], ["vmMonitoring", "string", "vim.version.version5", {:optional => true}], ["hostMonitoring", "string", "vim.version.version5", {:optional => true}], ["vmComponentProtecting", "string", "vim.version.vcp", {:optional => true}], ["failoverLevel", "int", "vim.version.version1", {:optional => true}], ["admissionControlPolicy", "vim.cluster.DasAdmissionControlPolicy", "vim.version.version5", {:optional => true}], ["admissionControlEnabled", "boolean", "vim.version.version1", {:optional => true}], ["defaultVmSettings", "vim.cluster.DasVmSettings", "vim.version.version2", {:optional => true}], ["option", "vim.option.OptionValue[]", "vim.version.version1", {:optional => true}], ["heartbeatDatastore", "vim.Datastore[]", "vim.version.version7", {:optional => true}], ["hBDatastoreCandidatePolicy", "string", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 2 hrs to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 953..953
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1176..1176
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1437..1437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1450..1450
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1892..1892

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

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.profile.host.HostApplyProfile", "HostApplyProfile", "vim.profile.ApplyProfile", "vim.version.version5", [["memory", "vim.profile.host.HostMemoryProfile", "vim.version.version5", {:optional => true}], ["storage", "vim.profile.host.StorageProfile", "vim.version.version5", {:optional => true}], ["network", "vim.profile.host.NetworkProfile", "vim.version.version5", {:optional => true}], ["datetime", "vim.profile.host.DateTimeProfile", "vim.version.version5", {:optional => true}], ["firewall", "vim.profile.host.FirewallProfile", "vim.version.version5", {:optional => true}], ["security", "vim.profile.host.SecurityProfile", "vim.version.version5", {:optional => true}], ["service", "vim.profile.host.ServiceProfile[]", "vim.version.version5", {:optional => true}], ["option", "vim.profile.host.OptionProfile[]", "vim.version.version5", {:optional => true}], ["userAccount", "vim.profile.host.UserProfile[]", "vim.version.version5", {:optional => true}], ["usergroupAccount", "vim.profile.host.UserGroupProfile[]", "vim.version.version5", {:optional => true}], ["authentication", "vim.profile.host.AuthenticationProfile", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 2 hrs to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 422..422
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 953..953
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1176..1176
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1450..1450
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1892..1892

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

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.host.IscsiManager.IscsiPortInfo", "IscsiPortInfo", "vmodl.DynamicData", "vim.version.version7", [["vnicDevice", "string", "vim.version.version7", {:optional => true}], ["vnic", "vim.host.VirtualNic", "vim.version.version7", {:optional => true}], ["pnicDevice", "string", "vim.version.version7", {:optional => true}], ["pnic", "vim.host.PhysicalNic", "vim.version.version7", {:optional => true}], ["switchName", "string", "vim.version.version7", {:optional => true}], ["switchUuid", "string", "vim.version.version7", {:optional => true}], ["portgroupName", "string", "vim.version.version7", {:optional => true}], ["portgroupKey", "string", "vim.version.version7", {:optional => true}], ["portKey", "string", "vim.version.version7", {:optional => true}], ["complianceStatus", "vim.host.IscsiManager.IscsiStatus", "vim.version.version7", {:optional => true}], ["pathStatus", "string", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 2 hrs to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 422..422
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 953..953
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1437..1437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1450..1450
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1892..1892

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

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.vApp.PropertyInfo", "VAppPropertyInfo", "vmodl.DynamicData", "vim.version.version5", [["key", "int", "vim.version.version5"], ["classId", "string", "vim.version.version5", {:optional => true}], ["instanceId", "string", "vim.version.version5", {:optional => true}], ["id", "string", "vim.version.version5", {:optional => true}], ["category", "string", "vim.version.version5", {:optional => true}], ["label", "string", "vim.version.version5", {:optional => true}], ["type", "string", "vim.version.version5", {:optional => true}], ["userConfigurable", "boolean", "vim.version.version5", {:optional => true}], ["defaultValue", "string", "vim.version.version5", {:optional => true}], ["value", "string", "vim.version.version5", {:optional => true}], ["description", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 2 hrs to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1708..1708

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

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.device.VirtualDisk.FlatVer2BackingInfo", "VirtualDiskFlatVer2BackingInfo", "vim.vm.device.VirtualDevice.FileBackingInfo", "vim.version.version1", [["diskMode", "string", "vim.version.version1"], ["split", "boolean", "vim.version.version1", {:optional => true}], ["writeThrough", "boolean", "vim.version.version1", {:optional => true}], ["thinProvisioned", "boolean", "vim.version.version1", {:optional => true}], ["eagerlyScrub", "boolean", "vim.version.version5", {:optional => true}], ["uuid", "string", "vim.version.version2", {:optional => true}], ["contentId", "string", "vim.version.version5", {:optional => true}], ["changeId", "string", "vim.version.version5", {:optional => true}], ["parent", "vim.vm.device.VirtualDisk.FlatVer2BackingInfo", "vim.version.version5", {:optional => true}], ["deltaDiskFormat", "string", "vim.version.version7", {:optional => true}], ["digestEnabled", "boolean", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 2 hrs to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1531..1531

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

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

    case token.SHL:
        y := asUint64(y)
        switch x.(type) {
        case int:
            return x.(int) << y
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/ops.go and 1 other location - About 2 hrs to fix
go_agent/src/code.google.com/p/go.tools/ssa/interp/ops.go on lines 607..632

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

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 (net centosNetManager) detectMacAddresses() (map[string]string, error) {
    addresses := map[string]string{}

    filePaths, err := net.fs.Glob("/sys/class/net/*")
    if err != nil {
Severity: Major
Found in go_agent/src/bosh/platform/net/centos_net_manager.go and 1 other location - About 2 hrs to fix
go_agent/src/bosh/platform/net/ubuntu_net_manager.go on lines 222..244

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

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 (net ubuntuNetManager) detectMacAddresses() (map[string]string, error) {
    addresses := map[string]string{}

    filePaths, err := net.fs.Glob("/sys/class/net/*")
    if err != nil {
Severity: Major
Found in go_agent/src/bosh/platform/net/ubuntu_net_manager.go and 1 other location - About 2 hrs to fix
go_agent/src/bosh/platform/net/centos_net_manager.go on lines 205..227

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

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

    case token.SHR:
        y := asUint64(y)
        switch x.(type) {
        case int:
            return x.(int) >> y
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/ops.go and 1 other location - About 2 hrs to fix
go_agent/src/code.google.com/p/go.tools/ssa/interp/ops.go on lines 580..605

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

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_settings
        @registry_endpoint ||= get_registry_endpoint
        url = "#{@registry_endpoint}/instances/#{get_server_name}/settings"
        raw_response = get_uri(url)

bosh_agent/lib/bosh_agent/infrastructure/cloudstack/registry.rb on lines 41..61

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

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_settings
        @registry_endpoint ||= get_registry_endpoint
        url = "#{@registry_endpoint}/instances/#{get_server_name}/settings"
        raw_response = get_uri(url)

bosh_agent/lib/bosh_agent/infrastructure/openstack/registry.rb on lines 42..62

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

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.TaskFilterSpec", "TaskFilterSpec", "vmodl.DynamicData", "vim.version.version1", [["entity", "vim.TaskFilterSpec.ByEntity", "vim.version.version1", {:optional => true}], ["time", "vim.TaskFilterSpec.ByTime", "vim.version.version1", {:optional => true}], ["userName", "vim.TaskFilterSpec.ByUsername", "vim.version.version1", {:optional => true}], ["state", "vim.TaskInfo.State[]", "vim.version.version1", {:optional => true}], ["alarm", "vim.alarm.Alarm", "vim.version.version1", {:optional => true}], ["scheduledTask", "vim.scheduler.ScheduledTask", "vim.version.version1", {:optional => true}], ["eventChainId", "int[]", "vim.version.version5", {:optional => true}], ["tag", "string[]", "vim.version.version5", {:optional => true}], ["parentTaskKey", "string[]", "vim.version.version5", {:optional => true}], ["rootTaskKey", "string[]", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1621..1621

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

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 (net ubuntuNetManager) writeResolvConf(networks boshsettings.Networks) error {
    buffer := bytes.NewBuffer([]byte{})
    t := template.Must(template.New("resolv-conf").Parse(ubuntuResolvConfTemplate))

    dnsServers := net.getDNSServers(networks)
Severity: Major
Found in go_agent/src/bosh/platform/net/ubuntu_net_manager.go and 1 other location - About 1 hr to fix
go_agent/src/bosh/platform/net/centos_net_manager.go on lines 182..199

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

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.ToolsConfigInfo", "ToolsConfigInfo", "vmodl.DynamicData", "vim.version.version1", [["toolsVersion", "int", "vim.version.version1", {:optional => true}], ["afterPowerOn", "boolean", "vim.version.version1", {:optional => true}], ["afterResume", "boolean", "vim.version.version1", {:optional => true}], ["beforeGuestStandby", "boolean", "vim.version.version1", {:optional => true}], ["beforeGuestShutdown", "boolean", "vim.version.version1", {:optional => true}], ["beforeGuestReboot", "boolean", "vim.version.version1", {:optional => true}], ["toolsUpgradePolicy", "string", "vim.version.version2", {:optional => true}], ["pendingCustomization", "string", "vim.version.version2", {:optional => true}], ["syncTimeWithHost", "boolean", "vim.version.version2", {:optional => true}], ["lastInstallInfo", "vim.vm.ToolsConfigInfo.ToolsLastInstallInfo", "vim.version.version7", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1838..1838

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

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 (net centosNetManager) writeResolvConf(networks boshsettings.Networks) error {
    buffer := bytes.NewBuffer([]byte{})
    t := template.Must(template.New("resolv-conf").Parse(centosResolvConfTemplate))

    dnsServers := net.getDNSServers(networks)
Severity: Major
Found in go_agent/src/bosh/platform/net/centos_net_manager.go and 1 other location - About 1 hr to fix
go_agent/src/bosh/platform/net/ubuntu_net_manager.go on lines 199..216

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

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 ext۰reflect۰rtype۰MethodByName(a *analysis, cgn *cgnode) {
    // If we have access to the callsite,
    // and the argument is a string constant,
    // return only that method.
    var name string
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/pointer/reflect.go and 1 other location - About 1 hr to fix
go_agent/src/code.google.com/p/go.tools/pointer/reflect.go on lines 1389..1406

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

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 ext۰reflect۰rtype۰FieldByName(a *analysis, cgn *cgnode) {
    // If we have access to the callsite,
    // and the argument is a string constant,
    // return only that field.
    var name string
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/pointer/reflect.go and 1 other location - About 1 hr to fix
go_agent/src/code.google.com/p/go.tools/pointer/reflect.go on lines 1599..1616

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

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 lookup_registry_endpoint(user_data)
        registry_endpoint = user_data["registry"]["endpoint"]

        # If user data doesn't contain dns info, there is noting we can do, so just return the endpoint
        return registry_endpoint if user_data["dns"].nil? || user_data["dns"]["nameserver"].nil?
bosh_agent/lib/bosh_agent/infrastructure/cloudstack/registry.rb on lines 100..115

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

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 lookup_registry_endpoint(user_data)
        registry_endpoint = user_data["registry"]["endpoint"]

        # If user data doesn't contain dns info, there is noting we can do, so just return the endpoint
        return registry_endpoint if user_data["dns"].nil? || user_data["dns"]["nameserver"].nil?
bosh_agent/lib/bosh_agent/infrastructure/openstack/registry.rb on lines 95..110

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

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::Openstack
  class RunnerBuilder
    def build(artifacts, net_type)
      env    = ENV
      logger = Logger.new(STDOUT)
Severity: Major
Found in bosh-dev/lib/bosh/dev/openstack/runner_builder.rb and 1 other location - About 1 hr to fix
bosh-dev/lib/bosh/dev/cloudstack/runner_builder.rb on lines 11..36

Duplicated Code

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

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

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

Tuning

This issue has a mass of 70.

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