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 ssh_properties(properties)
        ssh_user = properties['openstack']['ssh_user']
        ssh_port = properties['openstack']['ssh_port'] || 22
        ssh_wait = properties['openstack']['ssh_wait'] || 60

bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/aws.rb on lines 97..110
bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/cloudstack.rb on lines 94..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 52.

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

      def ssh_properties(properties)
        ssh_user = properties['cloudstack']['ssh_user']
        ssh_port = properties['cloudstack']['ssh_port'] || 22
        ssh_wait = properties['cloudstack']['ssh_wait'] || 60

bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/aws.rb on lines 97..110
bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/openstack.rb on lines 94..107

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

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۰syscall۰ReadDirent(fn *ssa.Function, args []value) value {
    // func ReadDirent(fd int, buf []byte) (n int, err error)
    fd := args[0].(int)
    p := args[1].([]value)
    b := make([]byte, len(p))
go_agent/src/code.google.com/p/go.tools/ssa/interp/external_unix.go on lines 101..111

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.dvs.DistributedVirtualPort.ConfigSpec", "DVPortConfigSpec", "vmodl.DynamicData", "vim.version.version5", [["operation", "string", "vim.version.version5"], ["key", "string", "vim.version.version5", {:optional => true}], ["name", "string", "vim.version.version5", {:optional => true}], ["scope", "vim.ManagedEntity[]", "vim.version.version5", {:optional => true}], ["description", "string", "vim.version.version5", {:optional => true}], ["setting", "vim.dvs.DistributedVirtualPort.Setting", "vim.version.version5", {:optional => true}], ["configVersion", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 317..317
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 2263..2263

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

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

      def ssh_properties(properties)
        ssh_user = properties['aws']['ssh_user']
        ssh_port = properties['aws']['ssh_port'] || 22
        ssh_wait = properties['aws']['ssh_wait'] || 60

bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/cloudstack.rb on lines 94..106
bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/openstack.rb on lines 94..107

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

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

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

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

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

Refactorings

Further Reading

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

    create_data_type("vim.host.InternetScsiHba.SendTarget", "HostInternetScsiHbaSendTarget", "vmodl.DynamicData", "vim.version.version1", [["address", "string", "vim.version.version1"], ["port", "int", "vim.version.version1", {:optional => true}], ["authenticationProperties", "vim.host.InternetScsiHba.AuthenticationProperties", "vim.version.version5", {:optional => true}], ["digestProperties", "vim.host.InternetScsiHba.DigestProperties", "vim.version.version5", {:optional => true}], ["supportedAdvancedOptions", "vim.option.OptionDef[]", "vim.version.version5", {:optional => true}], ["advancedOptions", "vim.host.InternetScsiHba.ParamValue[]", "vim.version.version5", {:optional => true}], ["parent", "string", "vim.version.version5", {:optional => true}]])
Severity: Major
Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb and 2 other locations - About 1 hr to fix
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 317..317
bosh_vsphere_cpi/lib/ruby_vim_sdk/server_objects.rb on lines 478..478

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

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 *Const) Int64() int64 {
    switch x := c.Value; x.Kind() {
    case exact.Int:
        if i, ok := exact.Int64Val(x); ok {
            return i
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/ssa/const.go and 1 other location - About 1 hr to fix
go_agent/src/code.google.com/p/go.tools/ssa/const.go on lines 128..140

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

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 *Const) Uint64() uint64 {
    switch x := c.Value; x.Kind() {
    case exact.Int:
        if u, ok := exact.Uint64Val(x); ok {
            return u
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/ssa/const.go and 1 other location - About 1 hr to fix
go_agent/src/code.google.com/p/go.tools/ssa/const.go on lines 111..123

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

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

  module YamlHelper

    def load_yaml_file(path, expected_type = Hash)
      unless File.exists?(path)
        raise(ConfigError, "Cannot find file `#{path}'")
Severity: Major
Found in bosh-registry/lib/bosh/registry/yaml_helper.rb and 1 other location - About 1 hr to fix
bosh-monitor/lib/bosh/monitor/yaml_helper.rb on lines 2..15

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

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.cluster.Recommendation", "ClusterRecommendation", "vmodl.DynamicData", "vim.version.version2", [["key", "string", "vim.version.version2"], ["type", "string", "vim.version.version2"], ["time", "vmodl.DateTime", "vim.version.version2"], ["rating", "int", "vim.version.version2"], ["reason", "string", "vim.version.version2"], ["reasonText", "string", "vim.version.version2"], ["prerequisite", "string[]", "vim.version.version2", {:optional => true}], ["action", "vim.cluster.Action[]", "vim.version.version2", {:optional => true}], ["target", "vmodl.ManagedObject", "vim.version.version2", {: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 312..312

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

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.PerformanceManager.CounterInfo", "PerfCounterInfo", "vmodl.DynamicData", "vim.version.version1", [["key", "int", "vim.version.version1"], ["nameInfo", "vim.ElementDescription", "vim.version.version1"], ["groupInfo", "vim.ElementDescription", "vim.version.version1"], ["unitInfo", "vim.ElementDescription", "vim.version.version1"], ["rollupType", "vim.PerformanceManager.CounterInfo.RollupType", "vim.version.version1"], ["statsType", "vim.PerformanceManager.CounterInfo.StatsType", "vim.version.version1"], ["level", "int", "vim.version.version2", {:optional => true}], ["perDeviceLevel", "int", "vim.version.version6", {:optional => true}], ["associatedCounterId", "int[]", "vim.version.version1", {: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 467..467

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

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

  module YamlHelper

    def load_yaml_file(path, expected_type = Hash)
      raise(ConfigError, "Cannot find file `#{path}'") unless File.exists?(path)
      yaml = Psych.load_file(path)
Severity: Major
Found in bosh-monitor/lib/bosh/monitor/yaml_helper.rb and 1 other location - About 1 hr to fix
bosh-registry/lib/bosh/registry/yaml_helper.rb on lines 4..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 51.

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

      stemcell_copy = find_in_path("stemcell-copy")

      if stemcell_copy
        logger.debug("copying stemcell using stemcell-copy script")
        # note that is is a potentially dangerous operation, but as the
Severity: Major
Found in bosh_aws_cpi/lib/cloud/aws/stemcell_creator.rb and 1 other location - About 1 hr to fix
bosh_cloudstack_cpi/lib/cloud/cloudstack/stemcell_creator.rb on lines 58..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 50.

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

      stemcell_copy = find_in_path("stemcell-copy-cloudstack")
      if stemcell_copy
        logger.debug("copying stemcell using stemcell-copy-cloudstack script")
        # note that is is a potentially dangerous operation, but as the
        # stemcell-copy script sets PATH to a sane value this is safe
bosh_aws_cpi/lib/cloud/aws/stemcell_creator.rb on lines 54..69

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

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

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

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

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

Refactorings

Further Reading

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

func (m monitJobSupervisor) Unmonitor() error {
    services, err := m.client.ServicesInGroup("vcap")
    if err != nil {
        return bosherr.WrapError(err, "Getting vcap services")
    }
Severity: Major
Found in go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go and 2 other locations - About 1 hr to fix
go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go on lines 112..127
go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go on lines 129..144

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

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

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

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

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

Refactorings

Further Reading

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

func (m monitJobSupervisor) Start() error {
    services, err := m.client.ServicesInGroup("vcap")
    if err != nil {
        return bosherr.WrapError(err, "Getting vcap services")
    }
Severity: Major
Found in go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go and 2 other locations - About 1 hr to fix
go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go on lines 129..144
go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go on lines 146..161

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

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

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

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

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

Refactorings

Further Reading

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

func (m monitJobSupervisor) Stop() error {
    services, err := m.client.ServicesInGroup("vcap")
    if err != nil {
        return bosherr.WrapError(err, "Getting vcap services")
    }
Severity: Major
Found in go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go and 2 other locations - About 1 hr to fix
go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go on lines 112..127
go_agent/src/bosh/jobsupervisor/monit_job_supervisor.go on lines 146..161

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

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

      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/cloudstack.rb on lines 8..24
bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/openstack.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 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/openstack.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 2 locations. Consider refactoring.
Open

    create_managed_type("vim.FileManager", "FileManager", "vmodl.ManagedObject", "vim.version.version2", nil, [["moveFile", "MoveDatastoreFile_Task", "vim.version.version2", [["sourceName", "string", "vim.version.version2", {}, nil], ["sourceDatacenter", "vim.Datacenter", "vim.version.version2", {:optional => true}, "System.View"], ["destinationName", "string", "vim.version.version2", {}, nil], ["destinationDatacenter", "vim.Datacenter", "vim.version.version2", {:optional => true}, "System.View"], ["force", "boolean", "vim.version.version2", {:optional => true}, nil]], [{}, "vim.Task", "void"], nil, ["vim.fault.InvalidDatastore", "vim.fault.FileFault"]], ["copyFile", "CopyDatastoreFile_Task", "vim.version.version2", [["sourceName", "string", "vim.version.version2", {}, nil], ["sourceDatacenter", "vim.Datacenter", "vim.version.version2", {:optional => true}, "System.View"], ["destinationName", "string", "vim.version.version2", {}, nil], ["destinationDatacenter", "vim.Datacenter", "vim.version.version2", {:optional => true}, "System.View"], ["force", "boolean", "vim.version.version2", {:optional => true}, nil]], [{}, "vim.Task", "void"], nil, ["vim.fault.InvalidDatastore", "vim.fault.FileFault"]], ["deleteFile", "DeleteDatastoreFile_Task", "vim.version.version2", [["name", "string", "vim.version.version2", {}, nil], ["datacenter", "vim.Datacenter", "vim.version.version2", {:optional => true}, "System.View"]], [{}, "vim.Task", "void"], nil, ["vim.fault.InvalidDatastore", "vim.fault.FileFault"]], ["makeDirectory", "MakeDirectory", "vim.version.version2", [["name", "string", "vim.version.version2", {}, nil], ["datacenter", "vim.Datacenter", "vim.version.version2", {:optional => true}, "System.View"], ["createParentDirectories", "boolean", "vim.version.version2", {:optional => true}, nil]], [{}, "void", "void"], nil, ["vim.fault.InvalidDatastore", "vim.fault.FileFault"]], ["changeOwner", "ChangeOwner", "vim.version.version5", [["name", "string", "vim.version.version5", {}, nil], ["datacenter", "vim.Datacenter", "vim.version.version5", {:optional => true}, "System.View"], ["owner", "string", "vim.version.version5", {}, nil]], [{}, "void", "void"], nil, ["vim.fault.InvalidDatastore", "vim.fault.FileFault", "vim.fault.UserNotFound"]]])
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 240..240

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

Severity
Category
Status
Source
Language