cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 548 of 1,705 total issues

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

      def initialize(instance_manager, config, logger)
        @instance_manager = instance_manager
        @logger = logger
        @config = config
        properties = config.cloud_options['properties']
bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/aws.rb on lines 8..25
bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/cloudstack.rb on lines 8..24

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

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.OvfManager.ValidateHostResult", "OvfValidateHostResult", "vmodl.DynamicData", "vim.version.version5", [["downloadSize", "long", "vim.version.version5", {:optional => true}], ["flatDeploymentSize", "long", "vim.version.version5", {:optional => true}], ["sparseDeploymentSize", "long", "vim.version.version5", {:optional => true}], ["error", "vmodl.MethodFault[]", "vim.version.version5", {:optional => true}], ["warning", "vmodl.MethodFault[]", "vim.version.version5", {:optional => true}], ["supportedDiskProvisioning", "string[]", "vim.version.version6", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1063..1063
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1225..1225
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1336..1336
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2437..2437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2443..2443

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

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 unpack_image(tmp_dir, image_path)
      result = Bosh::Exec.sh("tar -C #{tmp_dir} -xzf #{image_path} 2>&1", :on_error => :return)
      if result.failed?
        @logger.error("Extracting stemcell root image failed in dir #{tmp_dir}, " +
                      "tar returned #{result.exit_status}, output: #{result.output}")
Severity: Major
Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb and 1 other location - About 1 hr to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb on lines 836..845

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

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.DatastoreBrowser.VmDiskInfo", "VmDiskFileInfo", "vim.host.DatastoreBrowser.FileInfo", "vim.version.version1", [["diskType", "vmodl.TypeName", "vim.version.version1", {:optional => true}], ["capacityKb", "long", "vim.version.version1", {:optional => true}], ["hardwareVersion", "int", "vim.version.version1", {:optional => true}], ["controllerType", "vmodl.TypeName", "vim.version.version2", {:optional => true}], ["diskExtents", "string[]", "vim.version.version2", {:optional => true}], ["thin", "boolean", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 294..294
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1225..1225
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1336..1336
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2437..2437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2443..2443

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

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.dvs.VmwareDistributedVirtualSwitch.UplinkPortTeamingPolicy", "VmwareUplinkPortTeamingPolicy", "vim.InheritablePolicy", "vim.version.version5", [["policy", "vim.StringPolicy", "vim.version.version5", {:optional => true}], ["reversePolicy", "vim.BoolPolicy", "vim.version.version5", {:optional => true}], ["notifySwitches", "vim.BoolPolicy", "vim.version.version5", {:optional => true}], ["rollingOrder", "vim.BoolPolicy", "vim.version.version5", {:optional => true}], ["failureCriteria", "vim.dvs.VmwareDistributedVirtualSwitch.FailureCriteria", "vim.version.version5", {:optional => true}], ["uplinkPortOrder", "vim.dvs.VmwareDistributedVirtualSwitch.UplinkPortOrderPolicy", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 294..294
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1063..1063
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1225..1225
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1336..1336
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2443..2443

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

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 unpack_image(tmp_dir, image_path)
      result = Bosh::Exec.sh("tar -C #{tmp_dir} -xzf #{image_path} 2>&1", :on_error => :return)
      if result.failed?
        @logger.error("Extracting stemcell root image failed in dir #{tmp_dir}, " +
                      "tar returned #{result.exit_status}, output: #{result.output}")
Severity: Major
Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb and 1 other location - About 1 hr to fix
bosh_openstack_cpi/lib/cloud/openstack/cloud.rb on lines 880..889

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

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.NetworkPolicy.NicTeamingPolicy", "HostNicTeamingPolicy", "vmodl.DynamicData", "vim.version.version1", [["policy", "string", "vim.version.version1", {:optional => true}], ["reversePolicy", "boolean", "vim.version.version1", {:optional => true}], ["notifySwitches", "boolean", "vim.version.version1", {:optional => true}], ["rollingOrder", "boolean", "vim.version.version1", {:optional => true}], ["failureCriteria", "vim.host.NetworkPolicy.NicFailureCriteria", "vim.version.version1", {:optional => true}], ["nicOrder", "vim.host.NetworkPolicy.NicOrderPolicy", "vim.version.version1", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 294..294
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1063..1063
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1336..1336
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2437..2437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2443..2443

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

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.VirtualNic.Specification", "HostVirtualNicSpec", "vmodl.DynamicData", "vim.version.version1", [["ip", "vim.host.IpConfig", "vim.version.version1", {:optional => true}], ["mac", "string", "vim.version.version1", {:optional => true}], ["distributedVirtualPort", "vim.dvs.PortConnection", "vim.version.version5", {:optional => true}], ["portgroup", "string", "vim.version.version5", {:optional => true}], ["mtu", "int", "vim.version.version5", {:optional => true}], ["tsoEnabled", "boolean", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 294..294
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1063..1063
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1225..1225
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2437..2437
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2443..2443

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

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.dvs.VmwareDistributedVirtualSwitch.VmwarePortConfigPolicy", "VMwareDVSPortSetting", "vim.dvs.DistributedVirtualPort.Setting", "vim.version.version5", [["vlan", "vim.dvs.VmwareDistributedVirtualSwitch.VlanSpec", "vim.version.version5", {:optional => true}], ["qosTag", "vim.IntPolicy", "vim.version.version5", {:optional => true}], ["uplinkTeamingPolicy", "vim.dvs.VmwareDistributedVirtualSwitch.UplinkPortTeamingPolicy", "vim.version.version5", {:optional => true}], ["securityPolicy", "vim.dvs.VmwareDistributedVirtualSwitch.SecurityPolicy", "vim.version.version5", {:optional => true}], ["ipfixEnabled", "vim.BoolPolicy", "vim.version.version7", {:optional => true}], ["txUplink", "vim.BoolPolicy", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 5 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 294..294
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1063..1063
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1225..1225
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 1336..1336
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2437..2437

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

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 Complex64:
            if rounded == nil {
                return fitsFloat32(exact.Real(x)) && fitsFloat32(exact.Imag(x))
            }
            re := roundFloat32(exact.Real(x))
Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/go/types/expr.go and 1 other location - About 1 hr to fix
go_agent/src/code.google.com/p/go.tools/go/types/expr.go on lines 306..315

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

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 Complex128:
            if rounded == nil {
                return fitsFloat64(exact.Real(x)) && fitsFloat64(exact.Imag(x))
            }
            re := roundFloat64(exact.Real(x))
Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/go/types/expr.go and 1 other location - About 1 hr to fix
go_agent/src/code.google.com/p/go.tools/go/types/expr.go on lines 296..305

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

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 (c httpClient) StopService(serviceName string) error {
    response, err := c.makeRequest(c.monitURL(serviceName), "POST", "action=stop")
    if err != nil {
        return bosherr.WrapError(err, "Sending stop request to monit")
    }
Severity: Minor
Found in go_agent/src/bosh/jobsupervisor/monit/http_client.go and 1 other location - About 1 hr to fix
go_agent/src/bosh/jobsupervisor/monit/http_client.go on lines 92..106

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

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 (c httpClient) UnmonitorService(serviceName string) error {
    response, err := c.makeRequest(c.monitURL(serviceName), "POST", "action=unmonitor")
    if err != nil {
        return bosherr.WrapError(err, "Sending unmonitor request to monit")
    }
Severity: Minor
Found in go_agent/src/bosh/jobsupervisor/monit/http_client.go and 1 other location - About 1 hr to fix
go_agent/src/bosh/jobsupervisor/monit/http_client.go on lines 76..90

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

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

package applyspec

import models "bosh/agent/applier/models"

type JobTemplateSpec struct {
Severity: Minor
Found in go_agent/src/bosh/agent/applier/applyspec/job_template_spec.go and 1 other location - About 55 mins to fix
go_agent/src/bosh/agent/applier/applyspec/package_spec.go on lines 1..21

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

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 (c *reflectSliceOfConstraint) solve(a *analysis, _ *node, delta nodeset) {
    changed := false
    for tObj := range delta {
        T := a.rtypeTaggedValue(tObj)

Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/pointer/reflect.go and 1 other location - About 55 mins to fix
go_agent/src/code.google.com/p/go.tools/pointer/reflect.go on lines 1125..1137

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

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

package applyspec

import models "bosh/agent/applier/models"

type PackageSpec struct {
Severity: Minor
Found in go_agent/src/bosh/agent/applier/applyspec/package_spec.go and 1 other location - About 55 mins to fix
go_agent/src/bosh/agent/applier/applyspec/job_template_spec.go on lines 1..21

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

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 (c *reflectPtrToConstraint) solve(a *analysis, _ *node, delta nodeset) {
    changed := false
    for tObj := range delta {
        T := a.rtypeTaggedValue(tObj)

Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/pointer/reflect.go and 1 other location - About 55 mins to fix
go_agent/src/code.google.com/p/go.tools/pointer/reflect.go on lines 1166..1178

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

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 create_packages(packages)
        if packages.empty?
          @packages_unchanged = true
          return
        end
Severity: Minor
Found in bosh-director/lib/bosh/director/jobs/update_release.rb and 1 other location - About 55 mins to fix
bosh-director/lib/bosh/director/jobs/update_release.rb on lines 353..365

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

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.alarm.AlarmDescription", "AlarmDescription", "vmodl.DynamicData", "vim.version.version1", [["expr", "vim.TypeDescription[]", "vim.version.version1"], ["stateOperator", "vim.ElementDescription[]", "vim.version.version1"], ["metricOperator", "vim.ElementDescription[]", "vim.version.version1"], ["hostSystemConnectionState", "vim.ElementDescription[]", "vim.version.version1"], ["virtualMachinePowerState", "vim.ElementDescription[]", "vim.version.version1"], ["datastoreConnectionState", "vim.ElementDescription[]", "vim.version.version5"], ["hostSystemPowerState", "vim.ElementDescription[]", "vim.version.version5"], ["virtualMachineGuestHeartbeatStatus", "vim.ElementDescription[]", "vim.version.version5"], ["entityStatus", "vim.ElementDescription[]", "vim.version.version1"], ["action", "vim.TypeDescription[]", "vim.version.version1"]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 55 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2351..2351

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

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.VirtualPCIControllerOption", "VirtualPCIControllerOption", "vim.vm.device.VirtualControllerOption", "vim.version.version1", [["numSCSIControllers", "vim.option.IntOption", "vim.version.version1"], ["numEthernetCards", "vim.option.IntOption", "vim.version.version1"], ["numVideoCards", "vim.option.IntOption", "vim.version.version1"], ["numSoundCards", "vim.option.IntOption", "vim.version.version1"], ["numVmiRoms", "vim.option.IntOption", "vim.version.version2"], ["numVmciDevices", "vim.option.IntOption", "vim.version.version4"], ["numPCIPassthroughDevices", "vim.option.IntOption", "vim.version.version4"], ["numSasSCSIControllers", "vim.option.IntOption", "vim.version.version4"], ["numVmxnet3EthernetCards", "vim.option.IntOption", "vim.version.version4"], ["numParaVirtualSCSIControllers", "vim.option.IntOption", "vim.version.version4"]])
Severity: Minor
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 1 other location - About 55 mins to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 394..394

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

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