saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

    try:
        response = bigip_session.put(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/pool/{name}'.format(name=name),
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 6 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 541..547
salt/modules/bigip.py on lines 912..918
salt/modules/bigip.py on lines 1068..1074
salt/modules/bigip.py on lines 1787..1793
salt/modules/bigip.py on lines 1907..1913
salt/modules/bigip.py on lines 2111..2117

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

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 not r.get('created'):
            ret['result'] = False
            ret['comment'] = 'Failed to update policy: {0}.'.format(r['error']['message'])
            ret['changes'] = {}
            return ret
Severity: Major
Found in salt/states/boto_iot.py and 7 other locations - About 2 hrs to fix
salt/states/boto_cloudtrail.py on lines 205..209
salt/states/boto_cloudtrail.py on lines 275..279
salt/states/boto_cloudtrail.py on lines 284..288
salt/states/boto_cloudtrail.py on lines 292..296
salt/states/boto_cloudwatch_event.py on lines 236..240
salt/states/boto_iam.py on lines 1530..1534
salt/states/boto_lambda.py on lines 444..449

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

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

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

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

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

Refactorings

Further Reading

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

try:
    #pylint: disable=unused-import
    import boto
    import boto3
    #pylint: enable=unused-import
Severity: Major
Found in salt/modules/boto_elasticsearch_domain.py and 2 other locations - About 2 hrs to fix
salt/modules/boto_cognitoidentity.py on lines 92..102
salt/modules/boto_rds.py on lines 66..76

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

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

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

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

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

Refactorings

Further Reading

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

def _clean_kwargs(keep_name=False, **kwargs):
    '''
    Sanatize the the arguments for use with shade
    '''
    if 'name' in kwargs and not keep_name:
Severity: Major
Found in salt/modules/glanceng.py and 2 other locations - About 2 hrs to fix
salt/modules/keystoneng.py on lines 86..93
salt/modules/neutronng.py on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

def _clean_kwargs(keep_name=False, **kwargs):
    '''
    Sanatize the the arguments for use with shade
    '''
    if 'name' in kwargs and not keep_name:
Severity: Major
Found in salt/modules/neutronng.py and 2 other locations - About 2 hrs to fix
salt/modules/glanceng.py on lines 63..70
salt/modules/keystoneng.py on lines 86..93

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

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

    try:
        response = bigip_session.post(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/pool/{name}/members'.format(name=name),
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 6 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 541..547
salt/modules/bigip.py on lines 912..918
salt/modules/bigip.py on lines 1012..1018
salt/modules/bigip.py on lines 1787..1793
salt/modules/bigip.py on lines 1907..1913
salt/modules/bigip.py on lines 2111..2117

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

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

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

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

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

Refactorings

Further Reading

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

try:
    #pylint: disable=unused-import
    import boto
    import boto3
    #pylint: enable=unused-import
Severity: Major
Found in salt/modules/boto_rds.py and 2 other locations - About 2 hrs to fix
salt/modules/boto_cognitoidentity.py on lines 92..102
salt/modules/boto_elasticsearch_domain.py on lines 93..103

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

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

    try:
        response = bigip_session.put(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/pool/{name}'.format(name=name),
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 6 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 541..547
salt/modules/bigip.py on lines 1012..1018
salt/modules/bigip.py on lines 1068..1074
salt/modules/bigip.py on lines 1787..1793
salt/modules/bigip.py on lines 1907..1913
salt/modules/bigip.py on lines 2111..2117

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

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

    try:
        response = bigip_session.put(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/node/{name}'.format(name=name),
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 6 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 912..918
salt/modules/bigip.py on lines 1012..1018
salt/modules/bigip.py on lines 1068..1074
salt/modules/bigip.py on lines 1787..1793
salt/modules/bigip.py on lines 1907..1913
salt/modules/bigip.py on lines 2111..2117

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

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 not func.get('updated'):
            ret['result'] = False
            ret['comment'] = ('Failed to update function: '
                              '{0}.'.format(func['error']['message']))
            ret['changes'] = {}
Severity: Major
Found in salt/states/boto_lambda.py and 7 other locations - About 2 hrs to fix
salt/states/boto_cloudtrail.py on lines 205..209
salt/states/boto_cloudtrail.py on lines 275..279
salt/states/boto_cloudtrail.py on lines 284..288
salt/states/boto_cloudtrail.py on lines 292..296
salt/states/boto_cloudwatch_event.py on lines 236..240
salt/states/boto_iam.py on lines 1530..1534
salt/states/boto_iot.py on lines 392..396

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

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

    try:
        response = bigip_session.post(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/monitor/{type}'.format(type=monitor_type),
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 6 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 541..547
salt/modules/bigip.py on lines 912..918
salt/modules/bigip.py on lines 1012..1018
salt/modules/bigip.py on lines 1068..1074
salt/modules/bigip.py on lines 1787..1793
salt/modules/bigip.py on lines 2111..2117

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

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

    try:
        response = bigip_session.put(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/virtual/{name}'.format(name=name),
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 6 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 541..547
salt/modules/bigip.py on lines 912..918
salt/modules/bigip.py on lines 1012..1018
salt/modules/bigip.py on lines 1068..1074
salt/modules/bigip.py on lines 1907..1913
salt/modules/bigip.py on lines 2111..2117

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

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

    try:
        response = bigip_session.post(
            BIG_IP_URL_BASE.format(host=hostname) + '/ltm/profile/{type}'.format(type=profile_type),
            data=salt.utils.json.dumps(payload)
        )
Severity: Major
Found in salt/modules/bigip.py and 6 other locations - About 2 hrs to fix
salt/modules/bigip.py on lines 541..547
salt/modules/bigip.py on lines 912..918
salt/modules/bigip.py on lines 1012..1018
salt/modules/bigip.py on lines 1068..1074
salt/modules/bigip.py on lines 1787..1793
salt/modules/bigip.py on lines 1907..1913

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

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 not r.get('updated'):
            ret['result'] = False
            ret['comment'] = 'Failed to update trail: {0}.'.format(r['error']['message'])
            ret['changes'] = {}
            return ret
Severity: Major
Found in salt/states/boto_cloudtrail.py and 7 other locations - About 2 hrs to fix
salt/states/boto_cloudtrail.py on lines 205..209
salt/states/boto_cloudtrail.py on lines 284..288
salt/states/boto_cloudtrail.py on lines 292..296
salt/states/boto_cloudwatch_event.py on lines 236..240
salt/states/boto_iam.py on lines 1530..1534
salt/states/boto_iot.py on lines 392..396
salt/states/boto_lambda.py on lines 444..449

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

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 not r.get('started'):
                ret['result'] = False
                ret['comment'] = 'Failed to update trail: {0}.'.format(r['error']['message'])
                ret['changes'] = {}
                return ret
Severity: Major
Found in salt/states/boto_cloudtrail.py and 7 other locations - About 2 hrs to fix
salt/states/boto_cloudtrail.py on lines 205..209
salt/states/boto_cloudtrail.py on lines 275..279
salt/states/boto_cloudtrail.py on lines 292..296
salt/states/boto_cloudwatch_event.py on lines 236..240
salt/states/boto_iam.py on lines 1530..1534
salt/states/boto_iot.py on lines 392..396
salt/states/boto_lambda.py on lines 444..449

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

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 not r.get('created'):
                ret['result'] = False
                ret['comment'] = 'Failed to update policy: {0}.'.format(r['error']['message'])
                ret['changes'] = {}
                return ret
Severity: Major
Found in salt/states/boto_iam.py and 7 other locations - About 2 hrs to fix
salt/states/boto_cloudtrail.py on lines 205..209
salt/states/boto_cloudtrail.py on lines 275..279
salt/states/boto_cloudtrail.py on lines 284..288
salt/states/boto_cloudtrail.py on lines 292..296
salt/states/boto_cloudwatch_event.py on lines 236..240
salt/states/boto_iot.py on lines 392..396
salt/states/boto_lambda.py on lines 444..449

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

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

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

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

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

Refactorings

Further Reading

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

def _clean_kwargs(keep_name=False, **kwargs):
    '''
    Sanatize the the arguments for use with shade
    '''
    if 'name' in kwargs and not keep_name:
Severity: Major
Found in salt/modules/keystoneng.py and 2 other locations - About 2 hrs to fix
salt/modules/glanceng.py on lines 63..70
salt/modules/neutronng.py on lines 64..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

                if image_uuid in __salt__['imgadm.delete'](image_uuid):
                    ret['changes'][image_uuid] = None
                else:
                    ret['result'] = False
                    ret['comment'] = 'failed to delete images'
Severity: Major
Found in salt/states/smartos.py and 1 other location - About 2 hrs to fix
salt/states/smartos.py on lines 659..678

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

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

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

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

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

Refactorings

Further Reading

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

    try:
        cc = conn.describe_cache_clusters(name,
                                          show_cache_node_info=True)
    except boto.exception.BotoServerError as e:
        msg = 'Failed to get config for cache cluster {0}.'.format(name)
Severity: Major
Found in salt/modules/boto_elasticache.py and 1 other location - About 2 hrs to fix
salt/modules/boto_elasticache.py on lines 322..329

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

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

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

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

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

Refactorings

Further Reading

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

    if service_type.lower() in SERVICE_TYPE:
        service_type = SERVICE_TYPE[service_type.lower()]
        if run_interactive:
            service_type = service_type | \
                win32service.SERVICE_INTERACTIVE_PROCESS
Severity: Major
Found in salt/modules/win_service.py and 1 other location - About 2 hrs to fix
salt/modules/win_service.py on lines 1006..1014

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

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