saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

    if 'test' in __opts__ and __opts__['test']:
        ret['comment'] = 'nftables rule for {0} needs to be set for {1} ({2})'.format(
            name,
            family,
            command.strip())
Severity: Major
Found in salt/states/nftables.py and 1 other location - About 1 hr to fix
salt/states/nftables.py on lines 439..444

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    def _new_layer(id_):
        '''
        Pulled a new layer
        '''
        pulled = data.setdefault('Layers', {}).setdefault(
Severity: Major
Found in salt/modules/dockermod.py and 1 other location - About 1 hr to fix
salt/modules/dockermod.py on lines 720..727

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    if disk_format not in df_list:
        raise SaltInvocationError('"disk_format" needs to be one ' +
            'of the following: {0}'.format(', '.join(df_list)))
    else:
        kwargs['disk_format'] = disk_format
Severity: Major
Found in salt/modules/glance.py and 1 other location - About 1 hr to fix
salt/modules/glance.py on lines 265..269

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    if text:
        if gnupg_version >= '1.3.1':
            signed_data = gpg.sign(text, default_key=keyid, passphrase=gpg_passphrase)
        else:
            signed_data = gpg.sign(text, keyid=keyid, passphrase=gpg_passphrase)
Severity: Major
Found in salt/modules/gpg.py and 1 other location - About 1 hr to fix
salt/modules/gpg.py on lines 1017..1021

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

def hincrbyfloat(key, field, increment=1.0, host=None, port=None, db=None, password=None):
    '''
    Increment the float value of a hash field by the given number.

    .. versionadded:: 2017.7.0
Severity: Major
Found in salt/modules/redismod.py and 1 other location - About 1 hr to fix
salt/modules/redismod.py on lines 314..327

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

        new_keys[six.text_type(i)]['secret_key'] = created[response][result]['access_key']['secret_access_key']
Severity: Major
Found in salt/states/boto_iam.py and 1 other location - About 1 hr to fix
salt/states/boto_iam.py on lines 392..392

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

                            adml_file = os.path.join(
                                root,
                                display_language_fallback.split('-')[0],
                                os.path.splitext(t_admfile)[0] + '.adml')
Severity: Major
Found in salt/modules/win_lgpo.py and 1 other location - About 1 hr to fix
salt/modules/win_lgpo.py on lines 4887..4890

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

        if win_perms:
            for name_check in win_perms:
                try:
                    salt.utils.win_functions.get_sid_from_name(name_check)
                except CommandExecutionError as exc:
Severity: Major
Found in salt/states/file.py and 1 other location - About 1 hr to fix
salt/states/file.py on lines 1542..1547

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

    if 'error' in changes:
        ret['result'] = False
        ret['changes'] = 'Errors encountered {0}'.format(changes['error'])
        return ret
Severity: Major
Found in salt/states/ini_manage.py and 1 other location - About 1 hr to fix
salt/states/boto_s3.py on lines 239..244

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

          this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 1 other location - About 1 hr to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1105..1105

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

          this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
Severity: Major
Found in doc/_themes/saltstack/static/js/vendor/bootstrap.js and 1 other location - About 1 hr to fix
doc/_themes/saltstack/static/js/vendor/bootstrap.js on lines 1104..1104

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

        if __opts__['test']:
            msg = 'Domain {0} set to be modified.'.format(DomainName)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/boto_elasticsearch_domain.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 150..154
salt/states/boto_cloudwatch_alarm.py on lines 164..168
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_iot.py on lines 378..382
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1005..1009
salt/states/boto_vpc.py on lines 1117..1121
salt/states/boto_vpc.py on lines 1200..1204
salt/states/pyrax_queues.py on lines 51..55
salt/states/telemetry_alert.py on lines 141..145

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

        if __opts__['test']:
            msg = 'alert config {0} is to be created.'.format(metric_name)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/telemetry_alert.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 150..154
salt/states/boto_cloudwatch_alarm.py on lines 164..168
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_elasticsearch_domain.py on lines 308..312
salt/states/boto_iot.py on lines 378..382
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1005..1009
salt/states/boto_vpc.py on lines 1117..1121
salt/states/boto_vpc.py on lines 1200..1204
salt/states/pyrax_queues.py on lines 51..55

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

        if __opts__['test']:
            msg = 'alarm {0} is to be created/updated.'.format(name)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/boto_cloudwatch_alarm.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 164..168
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_elasticsearch_domain.py on lines 308..312
salt/states/boto_iot.py on lines 378..382
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1005..1009
salt/states/boto_vpc.py on lines 1117..1121
salt/states/boto_vpc.py on lines 1200..1204
salt/states/pyrax_queues.py on lines 51..55
salt/states/telemetry_alert.py on lines 141..145

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

        if __opts__['test']:
            msg = 'Route table {0} set to have routes modified.'.format(route_table_name)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/boto_vpc.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 150..154
salt/states/boto_cloudwatch_alarm.py on lines 164..168
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_elasticsearch_domain.py on lines 308..312
salt/states/boto_iot.py on lines 378..382
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1005..1009
salt/states/boto_vpc.py on lines 1200..1204
salt/states/pyrax_queues.py on lines 51..55
salt/states/telemetry_alert.py on lines 141..145

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

        if __opts__['test']:
            msg = 'Policy {0} set to be modified.'.format(policyName)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/boto_iot.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 150..154
salt/states/boto_cloudwatch_alarm.py on lines 164..168
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_elasticsearch_domain.py on lines 308..312
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1005..1009
salt/states/boto_vpc.py on lines 1117..1121
salt/states/boto_vpc.py on lines 1200..1204
salt/states/pyrax_queues.py on lines 51..55
salt/states/telemetry_alert.py on lines 141..145

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

        if __opts__['test']:
            msg = 'Rackspace queue {0} is set to be created.'.format(name)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/pyrax_queues.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 150..154
salt/states/boto_cloudwatch_alarm.py on lines 164..168
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_elasticsearch_domain.py on lines 308..312
salt/states/boto_iot.py on lines 378..382
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1005..1009
salt/states/boto_vpc.py on lines 1117..1121
salt/states/boto_vpc.py on lines 1200..1204
salt/states/telemetry_alert.py on lines 141..145

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

        if __opts__['test']:
            msg = 'alarm {0} is to be created/updated.'.format(name)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/boto_cloudwatch_alarm.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 150..154
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_elasticsearch_domain.py on lines 308..312
salt/states/boto_iot.py on lines 378..382
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1005..1009
salt/states/boto_vpc.py on lines 1117..1121
salt/states/boto_vpc.py on lines 1200..1204
salt/states/pyrax_queues.py on lines 51..55
salt/states/telemetry_alert.py on lines 141..145

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

        if __opts__['test']:
            msg = 'Route table {0} is set to be created.'.format(name)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/boto_vpc.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 150..154
salt/states/boto_cloudwatch_alarm.py on lines 164..168
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_elasticsearch_domain.py on lines 308..312
salt/states/boto_iot.py on lines 378..382
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1117..1121
salt/states/boto_vpc.py on lines 1200..1204
salt/states/pyrax_queues.py on lines 51..55
salt/states/telemetry_alert.py on lines 141..145

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

        if __opts__['test']:
            msg = 'Subnet associations for route table {0} set to be modified.'.format(route_table_name)
            ret['comment'] = msg
            ret['result'] = None
            return ret
Severity: Major
Found in salt/states/boto_vpc.py and 12 other locations - About 1 hr to fix
salt/states/boto_cloudtrail.py on lines 257..261
salt/states/boto_cloudwatch_alarm.py on lines 150..154
salt/states/boto_cloudwatch_alarm.py on lines 164..168
salt/states/boto_cloudwatch_event.py on lines 222..226
salt/states/boto_elasticache.py on lines 232..236
salt/states/boto_elasticsearch_domain.py on lines 308..312
salt/states/boto_iot.py on lines 378..382
salt/states/boto_sns.py on lines 117..121
salt/states/boto_vpc.py on lines 1005..1009
salt/states/boto_vpc.py on lines 1117..1121
salt/states/pyrax_queues.py on lines 51..55
salt/states/telemetry_alert.py on lines 141..145

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

Severity
Category
Status
Source
Language