saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

def validate_subnet(val):
    try:
        if not salt.utils.network.is_subnet(val):
            raise SaltInvocationError(
                '\'{0}\' is not a valid subnet'.format(val)
Severity: Minor
Found in salt/utils/docker/translate/helpers.py and 1 other location - About 55 mins to fix
salt/utils/docker/translate/helpers.py on lines 130..136

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

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

    if address_family == socket.AF_INET:
        if len(packed_ip) != ctypes.sizeof(addr.ipv4_addr):
            raise socket.error('packed IP wrong length for inet_ntoa')
        ctypes.memmove(addr.ipv4_addr, packed_ip, 4)
Severity: Minor
Found in salt/ext/win_inet_pton.py and 1 other location - About 55 mins to fix
salt/ext/win_inet_pton.py on lines 86..89

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

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

        if isinstance(network_adapter, type(edited_network_adapter)):
            edited_network_adapter = network_adapter
        else:
            log.debug(
                "Changing type of '%s' from '%s' to '%s'",
Severity: Minor
Found in salt/cloud/clouds/vmware.py and 1 other location - About 55 mins to fix
salt/modules/vsphere.py on lines 7671..7675

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

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

            if isinstance(device.backing,
                          vim.vm.device.VirtualCdrom.RemotePassthroughBackingInfo):
                drive['device_type'] = 'client_device'
                drive['client_device'] = {'mode': 'passthrough'}
Severity: Minor
Found in salt/modules/vsphere.py and 1 other location - About 55 mins to fix
salt/modules/vsphere.py on lines 8737..8740

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

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 grains():
    '''
    Get the grains from the proxy device.
    '''
    if not GRAINS_CACHE:
Severity: Minor
Found in salt/proxy/esxi.py and 1 other location - About 55 mins to fix
salt/proxy/fx2.py on lines 261..270

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

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

        params['swapSpace'] = six.text_type(int(all_stats['meminfo']['SwapTotal']['value']) / 1024)
Severity: Minor
Found in salt/states/serverdensity_device.py and 1 other location - About 55 mins to fix
salt/states/serverdensity_device.py on lines 88..88

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

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 list_elbs(region=None, key=None, keyid=None, profile=None):
    '''
    Return names of all load balancers associated with an account

    CLI example:
Severity: Minor
Found in salt/modules/boto_elb.py and 1 other location - About 55 mins to fix
salt/modules/boto_asg.py on lines 797..811

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

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 __virtual__():
    '''
    Only work on NetBSD
    '''
    if __grains__.get('os') == 'NetBSD' and os.path.exists('/etc/rc.subr'):
Severity: Minor
Found in salt/modules/netbsdservice.py and 1 other location - About 55 mins to fix
salt/modules/openbsdrcctl_service.py on lines 23..29

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

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

    for key in ['community']:  # for the moment only onen
        if existing.get(key) != expected.get(key):
            _create_diff(diff,
                         _valid_dict,
                         key,
Severity: Minor
Found in salt/states/netsnmp.py and 1 other location - About 55 mins to fix
salt/states/netsnmp.py on lines 234..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 45.

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

            if ret['result']:
                ret['changes'][name] = 'created'
                ret['comment'] = 'storage pool {0} was created'.format(name)
            elif 'error' in mod_res:
                ret['comment'] = mod_res['error']
Severity: Minor
Found in salt/states/zpool.py and 1 other location - About 55 mins to fix
salt/states/zone.py on lines 466..475

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

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

        ret[stack.stack_name] = {
            'status': stack.stack_status,
            'id': stack.id,
            'name': stack.stack_name,
            'creation': stack.creation_time,
Severity: Minor
Found in salt/modules/heat.py and 1 other location - About 55 mins to fix
salt/utils/openstack/nova.py on lines 913..921

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

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

                    if (e(a)) c || (j = function () {
                        var a = [].slice.call(arguments);
                        k.apply(this, a), l()
                    }), g(a, j, b, 0, h);
doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js on lines 949..952

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

                        }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () {
                            var a = [].slice.call(arguments);
                            k.apply(this, a), l()
                        } : j[n] = function (a) {
doc/_themes/saltstack/static/js/vendor/modernizr-2.6.2-respond-1.1.0.js on lines 939..942

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

  , mouseleave: function (e) {
      this.mousedover = false
      if (!this.focused && this.shown) this.hide()
    }
Severity: Minor
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 1 other location - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2081..2084

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

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

  , blur: function (e) {
      this.focused = false
      if (!this.mousedover && this.shown) this.hide()
    }
Severity: Minor
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 1 other location - About 50 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 2099..2102

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

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

    if __opts__.get('update_cachedir', False) is True:
        __utils__['cloud.delete_minion_cachedir'](name, __active_provider_name__.split(':')[0], __opts__)
Severity: Major
Found in salt/cloud/clouds/vmware.py and 22 other locations - About 50 mins to fix
salt/cloud/clouds/azurearm.py on lines 1528..1532
salt/cloud/clouds/digitalocean.py on lines 868..869
salt/cloud/clouds/ec2.py on lines 3417..3418
salt/cloud/clouds/gce.py on lines 2377..2378
salt/cloud/clouds/gogrid.py on lines 421..422
salt/cloud/clouds/joyent.py on lines 429..430
salt/cloud/clouds/linode.py on lines 758..759
salt/cloud/clouds/lxc.py on lines 415..416
salt/cloud/clouds/msazure.py on lines 947..948
salt/cloud/clouds/nova.py on lines 569..570
salt/cloud/clouds/oneandone.py on lines 918..922
salt/cloud/clouds/opennebula.py on lines 1226..1230
salt/cloud/clouds/openstack.py on lines 816..817
salt/cloud/clouds/parallels.py on lines 561..562
salt/cloud/clouds/profitbricks.py on lines 1023..1027
salt/cloud/clouds/proxmox.py on lines 1194..1196
salt/cloud/clouds/scaleway.py on lines 456..458
salt/cloud/clouds/softlayer.py on lines 637..638
salt/cloud/clouds/softlayer_hw.py on lines 547..548
salt/cloud/clouds/vagrant.py on lines 308..310
salt/cloud/clouds/xen.py on lines 1046..1050
salt/cloud/libcloudfuncs.py on lines 403..404

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

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

    if __opts__.get('update_cachedir', False) is True:
        __utils__['cloud.delete_minion_cachedir'](name, __active_provider_name__.split(':')[0], __opts__)
Severity: Major
Found in salt/cloud/clouds/digitalocean.py and 22 other locations - About 50 mins to fix
salt/cloud/clouds/azurearm.py on lines 1528..1532
salt/cloud/clouds/ec2.py on lines 3417..3418
salt/cloud/clouds/gce.py on lines 2377..2378
salt/cloud/clouds/gogrid.py on lines 421..422
salt/cloud/clouds/joyent.py on lines 429..430
salt/cloud/clouds/linode.py on lines 758..759
salt/cloud/clouds/lxc.py on lines 415..416
salt/cloud/clouds/msazure.py on lines 947..948
salt/cloud/clouds/nova.py on lines 569..570
salt/cloud/clouds/oneandone.py on lines 918..922
salt/cloud/clouds/opennebula.py on lines 1226..1230
salt/cloud/clouds/openstack.py on lines 816..817
salt/cloud/clouds/parallels.py on lines 561..562
salt/cloud/clouds/profitbricks.py on lines 1023..1027
salt/cloud/clouds/proxmox.py on lines 1194..1196
salt/cloud/clouds/scaleway.py on lines 456..458
salt/cloud/clouds/softlayer.py on lines 637..638
salt/cloud/clouds/softlayer_hw.py on lines 547..548
salt/cloud/clouds/vagrant.py on lines 308..310
salt/cloud/clouds/vmware.py on lines 2513..2514
salt/cloud/clouds/xen.py on lines 1046..1050
salt/cloud/libcloudfuncs.py on lines 403..404

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

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

    if __opts__.get('update_cachedir', False) is True:
        __utils__['cloud.delete_minion_cachedir'](name, __active_provider_name__.split(':')[0], __opts__)
Severity: Major
Found in salt/cloud/clouds/joyent.py and 22 other locations - About 50 mins to fix
salt/cloud/clouds/azurearm.py on lines 1528..1532
salt/cloud/clouds/digitalocean.py on lines 868..869
salt/cloud/clouds/ec2.py on lines 3417..3418
salt/cloud/clouds/gce.py on lines 2377..2378
salt/cloud/clouds/gogrid.py on lines 421..422
salt/cloud/clouds/linode.py on lines 758..759
salt/cloud/clouds/lxc.py on lines 415..416
salt/cloud/clouds/msazure.py on lines 947..948
salt/cloud/clouds/nova.py on lines 569..570
salt/cloud/clouds/oneandone.py on lines 918..922
salt/cloud/clouds/opennebula.py on lines 1226..1230
salt/cloud/clouds/openstack.py on lines 816..817
salt/cloud/clouds/parallels.py on lines 561..562
salt/cloud/clouds/profitbricks.py on lines 1023..1027
salt/cloud/clouds/proxmox.py on lines 1194..1196
salt/cloud/clouds/scaleway.py on lines 456..458
salt/cloud/clouds/softlayer.py on lines 637..638
salt/cloud/clouds/softlayer_hw.py on lines 547..548
salt/cloud/clouds/vagrant.py on lines 308..310
salt/cloud/clouds/vmware.py on lines 2513..2514
salt/cloud/clouds/xen.py on lines 1046..1050
salt/cloud/libcloudfuncs.py on lines 403..404

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

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

            if __opts__.get('update_cachedir', False) is True:
                __utils__['cloud.delete_minion_cachedir'](vm_, __active_provider_name__.split(':')[0], __opts__)
Severity: Major
Found in salt/cloud/clouds/lxc.py and 22 other locations - About 50 mins to fix
salt/cloud/clouds/azurearm.py on lines 1528..1532
salt/cloud/clouds/digitalocean.py on lines 868..869
salt/cloud/clouds/ec2.py on lines 3417..3418
salt/cloud/clouds/gce.py on lines 2377..2378
salt/cloud/clouds/gogrid.py on lines 421..422
salt/cloud/clouds/joyent.py on lines 429..430
salt/cloud/clouds/linode.py on lines 758..759
salt/cloud/clouds/msazure.py on lines 947..948
salt/cloud/clouds/nova.py on lines 569..570
salt/cloud/clouds/oneandone.py on lines 918..922
salt/cloud/clouds/opennebula.py on lines 1226..1230
salt/cloud/clouds/openstack.py on lines 816..817
salt/cloud/clouds/parallels.py on lines 561..562
salt/cloud/clouds/profitbricks.py on lines 1023..1027
salt/cloud/clouds/proxmox.py on lines 1194..1196
salt/cloud/clouds/scaleway.py on lines 456..458
salt/cloud/clouds/softlayer.py on lines 637..638
salt/cloud/clouds/softlayer_hw.py on lines 547..548
salt/cloud/clouds/vagrant.py on lines 308..310
salt/cloud/clouds/vmware.py on lines 2513..2514
salt/cloud/clouds/xen.py on lines 1046..1050
salt/cloud/libcloudfuncs.py on lines 403..404

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

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

            if opts.get('update_cachedir', False) is True:
                __utils__['cloud.delete_minion_cachedir'](
                    name, __active_provider_name__.split(':')[0], opts)
Severity: Major
Found in salt/cloud/clouds/vagrant.py and 22 other locations - About 50 mins to fix
salt/cloud/clouds/azurearm.py on lines 1528..1532
salt/cloud/clouds/digitalocean.py on lines 868..869
salt/cloud/clouds/ec2.py on lines 3417..3418
salt/cloud/clouds/gce.py on lines 2377..2378
salt/cloud/clouds/gogrid.py on lines 421..422
salt/cloud/clouds/joyent.py on lines 429..430
salt/cloud/clouds/linode.py on lines 758..759
salt/cloud/clouds/lxc.py on lines 415..416
salt/cloud/clouds/msazure.py on lines 947..948
salt/cloud/clouds/nova.py on lines 569..570
salt/cloud/clouds/oneandone.py on lines 918..922
salt/cloud/clouds/opennebula.py on lines 1226..1230
salt/cloud/clouds/openstack.py on lines 816..817
salt/cloud/clouds/parallels.py on lines 561..562
salt/cloud/clouds/profitbricks.py on lines 1023..1027
salt/cloud/clouds/proxmox.py on lines 1194..1196
salt/cloud/clouds/scaleway.py on lines 456..458
salt/cloud/clouds/softlayer.py on lines 637..638
salt/cloud/clouds/softlayer_hw.py on lines 547..548
salt/cloud/clouds/vmware.py on lines 2513..2514
salt/cloud/clouds/xen.py on lines 1046..1050
salt/cloud/libcloudfuncs.py on lines 403..404

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

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