saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

      if (!selector) {
        selector = $this.attr('href')
        selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
      }
Severity: Minor
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 1 other location - About 35 mins to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 98..101

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

def __virtual__():
    '''
    Check for SoftLayer configurations.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/softlayer_hw.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for aliyun configurations
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/aliyun.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for OpenStack dependencies
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/openstack.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for OpenNebula configs.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/opennebula.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for DigitalOcean configurations
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/digitalocean.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for Azure configurations.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/msazure.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for Pyrax configurations
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/pyrax.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Set up the libcloud functions and check for EC2 configurations
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/ec2.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for ProfitBricks configurations.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/profitbricks.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for 1&1 configurations.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/oneandone.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for SoftLayer configurations.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/softlayer.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Set up the libcloud functions and check for CloudStack configurations.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/cloudstack.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for QingCloud configurations.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/qingcloud.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

def __virtual__():
    '''
    Check for VMware configuration and if required libs are available.
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/vmware.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/proxmox.py on lines 70..80
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63

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

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

def __virtual__():
    '''
    Check for PROXMOX configurations
    '''
    if get_configured_provider() is False:
Severity: Major
Found in salt/cloud/clouds/proxmox.py and 14 other locations - About 30 mins to fix
salt/cloud/clouds/aliyun.py on lines 90..100
salt/cloud/clouds/cloudstack.py on lines 78..88
salt/cloud/clouds/digitalocean.py on lines 68..78
salt/cloud/clouds/ec2.py on lines 186..196
salt/cloud/clouds/msazure.py on lines 79..89
salt/cloud/clouds/oneandone.py on lines 156..166
salt/cloud/clouds/opennebula.py on lines 98..108
salt/cloud/clouds/openstack.py on lines 248..256
salt/cloud/clouds/profitbricks.py on lines 138..148
salt/cloud/clouds/pyrax.py on lines 29..39
salt/cloud/clouds/qingcloud.py on lines 71..81
salt/cloud/clouds/softlayer.py on lines 55..65
salt/cloud/clouds/softlayer_hw.py on lines 53..63
salt/cloud/clouds/vmware.py on lines 173..183

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

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

try:
    #pylint: disable=unused-import
    import boto
    import boto.sns
    #pylint: enable=unused-import
Severity: Major
Found in salt/modules/boto_sns.py and 7 other locations - About 30 mins to fix
salt/modules/boto3_elasticache.py on lines 65..73
salt/modules/boto_cloudfront.py on lines 64..72
salt/modules/boto_kinesis.py on lines 61..67
salt/modules/boto_s3.py on lines 63..71
salt/modules/boto_secgroup.py on lines 61..69
salt/modules/boto_sqs.py on lines 67..75
salt/utils/botomod.py on lines 52..60

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

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

try:
    import boto3
    import botocore
    logging.getLogger('boto3').setLevel(logging.CRITICAL)
    HAS_BOTO = True
Severity: Major
Found in salt/modules/boto_kinesis.py and 7 other locations - About 30 mins to fix
salt/modules/boto3_elasticache.py on lines 65..73
salt/modules/boto_cloudfront.py on lines 64..72
salt/modules/boto_s3.py on lines 63..71
salt/modules/boto_secgroup.py on lines 61..69
salt/modules/boto_sns.py on lines 55..63
salt/modules/boto_sqs.py on lines 67..75
salt/utils/botomod.py on lines 52..60

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

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

        if 'check_error_percent' in failure_criteria_conf:
            teaming.failureCriteria.checkErrorPercent = vim.BoolPolicy()
            teaming.failureCriteria.checkErrorPercent.value = \
                    failure_criteria_conf['check_error_percent']
Severity: Major
Found in salt/modules/vsphere.py and 7 other locations - About 30 mins to fix
salt/modules/vsphere.py on lines 4374..4377
salt/modules/vsphere.py on lines 4378..4381
salt/modules/vsphere.py on lines 4386..4389
salt/modules/vsphere.py on lines 4390..4393
salt/modules/vsphere.py on lines 4394..4397
salt/modules/vsphere.py on lines 4398..4401
salt/modules/vsphere.py on lines 4440..4443

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

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

    if key_filename is not None and not os.path.isfile(key_filename):
        raise SaltCloudConfigError(
            'The defined key_filename \'{0}\' does not exist'.format(
Severity: Major
Found in salt/cloud/clouds/digitalocean.py and 7 other locations - About 30 mins to fix
salt/cloud/clouds/libvirt.py on lines 321..323
salt/cloud/clouds/nova.py on lines 952..954
salt/cloud/clouds/opennebula.py on lines 1125..1127
salt/cloud/clouds/openstack.py on lines 675..677
salt/cloud/clouds/scaleway.py on lines 223..225
salt/utils/cloud.py on lines 414..416
salt/utils/cloud.py on lines 1463..1465

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

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