saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

try:
    # pylint: disable=import-error
    import boto
    import boto.exception
    # pylint: enable=import-error
Severity: Major
Found in salt/utils/botomod.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_sns.py on lines 55..63
salt/modules/boto_sqs.py on lines 67..75

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_duplex' in failure_criteria_conf:
            teaming.failureCriteria.checkDuplex = vim.BoolPolicy()
            teaming.failureCriteria.checkDuplex.value = \
                    failure_criteria_conf['check_duplex']
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 4382..4385
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

try:
    # pylint: disable=unused-import
    import boto3
    import botocore
    # pylint: enable=unused-import
Severity: Major
Found in salt/modules/boto_cloudfront.py and 7 other locations - About 30 mins to fix
salt/modules/boto3_elasticache.py on lines 65..73
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_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

try:
    # pylint: disable=unused-import
    import boto3
    import botocore
    # pylint: enable=unused-import
Severity: Major
Found in salt/modules/boto_sqs.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_sns.py on lines 55..63
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 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/scaleway.py and 7 other locations - About 30 mins to fix
salt/cloud/clouds/digitalocean.py on lines 327..329
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/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

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

        if 'percentage' in failure_criteria_conf:
            teaming.failureCriteria.percentage = vim.IntPolicy()
            teaming.failureCriteria.percentage.value = \
                    failure_criteria_conf['percentage']
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 4382..4385
salt/modules/vsphere.py on lines 4386..4389
salt/modules/vsphere.py on lines 4390..4393
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/utils/cloud.py and 7 other locations - About 30 mins to fix
salt/cloud/clouds/digitalocean.py on lines 327..329
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

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 ssh_key_file \'{0}\' does not exist'.format(
Severity: Major
Found in salt/cloud/clouds/nova.py and 7 other locations - About 30 mins to fix
salt/cloud/clouds/digitalocean.py on lines 327..329
salt/cloud/clouds/libvirt.py on lines 321..323
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

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 ssh_key_file \'{0}\' does not exist'.format(
Severity: Major
Found in salt/cloud/clouds/openstack.py and 7 other locations - About 30 mins to fix
salt/cloud/clouds/digitalocean.py on lines 327..329
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/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

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

try:
    #pylint: disable=unused-import
    import botocore
    import boto3
    #pylint: enable=unused-import
Severity: Major
Found in salt/modules/boto3_elasticache.py and 7 other locations - About 30 mins to fix
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_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

try:
    # pylint: disable=unused-import
    import boto
    import boto.ec2
    # pylint: enable=unused-import
Severity: Major
Found in salt/modules/boto_secgroup.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_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_speed' in failure_criteria_conf:
            teaming.failureCriteria.checkSpeed = vim.StringPolicy()
            teaming.failureCriteria.checkSpeed.value = \
                    failure_criteria_conf['check_speed']
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 4382..4385
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 'full_duplex' in failure_criteria_conf:
            teaming.failureCriteria.fullDuplex = vim.BoolPolicy()
            teaming.failureCriteria.fullDuplex.value = \
                    failure_criteria_conf['full_duplex']
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 4382..4385
salt/modules/vsphere.py on lines 4386..4389
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

try:
    # pylint: disable=unused-import
    import boto3
    # pylint: enable=unused-import
    import botocore
Severity: Major
Found in salt/modules/boto_s3.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_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 key_filename is not None and not os.path.isfile(key_filename):
        raise SaltCloudConfigError(
            'The defined ssh_keyfile \'{0}\' does not exist'.format(
Severity: Major
Found in salt/utils/cloud.py and 7 other locations - About 30 mins to fix
salt/cloud/clouds/digitalocean.py on lines 327..329
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 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

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

        if 'speed' in failure_criteria_conf:
            teaming.failureCriteria.speed = vim.IntPolicy()
            teaming.failureCriteria.speed.value = \
                    failure_criteria_conf['speed']
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 4382..4385
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 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/opennebula.py and 7 other locations - About 30 mins to fix
salt/cloud/clouds/digitalocean.py on lines 327..329
salt/cloud/clouds/libvirt.py on lines 321..323
salt/cloud/clouds/nova.py on lines 952..954
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

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/libvirt.py and 7 other locations - About 30 mins to fix
salt/cloud/clouds/digitalocean.py on lines 327..329
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

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

        if 'check_beacon' in failure_criteria_conf:
            teaming.failureCriteria.checkBeacon = vim.BoolPolicy()
            teaming.failureCriteria.checkBeacon.value = \
                    failure_criteria_conf['check_beacon']
Severity: Major
Found in salt/modules/vsphere.py and 7 other locations - About 30 mins to fix
salt/modules/vsphere.py on lines 4378..4381
salt/modules/vsphere.py on lines 4382..4385
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 'vlan_id' in pg_conf:
        pg_spec.defaultPortConfig.vlan = \
                vim.VmwareDistributedVirtualSwitchVlanIdSpec()
        pg_spec.defaultPortConfig.vlan.vlanId = pg_conf['vlan_id']
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 4382..4385
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

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