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 __opts__['test']:
            ret['result'] = None
            ret['changes']['removed'] = name
            ret['comment'] = 'Directory {0} is set for removal'.format(name)
            return ret
Severity: Major
Found in salt/states/file.py and 1 other location - About 2 hrs to fix
salt/states/file.py on lines 1741..1745

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

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 get_load(jid):
    '''
    Merge the load data from all returners
    '''
    ret = {}
Severity: Major
Found in salt/returners/multi_returner.py and 1 other location - About 2 hrs to fix
salt/returners/multi_returner.py on lines 90..98

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

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 info['state'] == 'running':
                ret['comment'] = 'Pool {0} exists and is running'.format(name)
            else:
                __salt__['virt.pool_start'](name, connection=connection, username=username, password=password)
                ret['changes'][name] = 'Pool started'
Severity: Major
Found in salt/states/virt.py and 1 other location - About 2 hrs to fix
salt/states/virt.py on lines 686..691

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

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 not isinstance(data['skip_during_range'], dict):
                data['_error'] = ('schedule.handle_func: Invalid, range '
                                  'must be specified as a dictionary. '
                                  'Ignoring job {0}.'.format(data['name']))
                log.error(data['_error'])
Severity: Major
Found in salt/utils/schedule.py and 1 other location - About 2 hrs to fix
salt/utils/schedule.py on lines 1238..1243

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

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

    try:
        conn.create_group(group_name, path)
        log.info('Created IAM group : %s.', group_name)
        return True
    except boto.exception.BotoServerError as e:
Severity: Major
Found in salt/modules/boto_iam.py and 1 other location - About 2 hrs to fix
salt/modules/boto_iam.py on lines 230..237

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

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

    try:
        result = es.indices.put_template(name=name, body=body)
        return result.get('acknowledged', False)
    except elasticsearch.TransportError as e:
        raise CommandExecutionError("Cannot create template {0}, server returned code {1} with message {2}".format(name, e.status_code, e.error))
Severity: Major
Found in salt/modules/elasticsearch.py and 1 other location - About 2 hrs to fix
salt/modules/elasticsearch.py on lines 1033..1038

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

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

                         ('The state would be retried every {1} seconds '
                          '(with a splay of up to {3} seconds) '
                          'a maximum of {0} times or until a result of {2} '
                          'is returned').format(low['retry']['attempts'],
                                                low['retry']['interval'],
Severity: Major
Found in salt/state.py and 1 other location - About 2 hrs to fix
salt/runners/digicertapi.py on lines 586..590

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

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 kwargs.get('enable_ddos_protection', False) != vnet.get('enable_ddos_protection'):
            ret['changes']['enable_ddos_protection'] = {
                'old': vnet.get('enable_ddos_protection'),
                'new': kwargs.get('enable_ddos_protection')
Severity: Major
Found in salt/states/azurearm_network.py and 1 other location - About 2 hrs to fix
salt/states/azurearm_network.py on lines 205..208

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

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

                    'ConsentPromptBehaviorUser': {
                        'Policy': 'User Account Control: Behavior of the '
                                  'elevation prompt for standard users',
                        'Settings': self.uac_user_prompt_lookup.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'LDAPClientIntegrity': {
                        'Policy': 'Network security: LDAP client signing requirements',
                        'Settings': self.ldap_signing_reqs.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
                        'Registry': {
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'AuditReceivingNTLMTraffic': {
                        'Policy': 'Network security: Restrict NTLM: Audit Incoming NTLM Traffic',
                        'Settings': self.ntlm_audit_settings.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
                        'Registry': {
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'DontDisplayLockedUserId': {
                        'Policy': 'Interactive logon: Display user information '
                                  'when the session is locked',
                        'Settings': self.locked_session_user_info.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'AuditNTLMInDomain': {
                        'Policy': 'Network security: Restrict NTLM: Audit NTLM '
                                  'authentication in this domain',
                        'Settings': self.ntlm_domain_audit_settings.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'ScRemoveOption': {
                        'Policy': 'Interactive logon: Smart card removal '
                                  'behavior',
                        'Settings': self.sc_removal_lookup.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'EnableS4U2SelfForClaims': {
                        'Policy': 'Microsoft network server: Attempt S4U2Self '
                                  'to obtain claim information',
                        'Settings': self.s4u2self_options.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'ForceKeyProtection': {
                        'Policy': 'System Cryptography: Force strong key protection for '
                                  'user keys stored on the computer',
                        'Settings': self.force_key_protection.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'SmbServerNameHardeningLevel': {
                        'Policy': 'Microsoft network server: Server SPN target '
                                  'name validation level',
                        'Settings': self.smb_server_name_hardening_levels.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'RestrictNTLMInDomain': {
                        'Policy': 'Network security: Restrict NTLM: NTLM '
                                  'authentication in this domain',
                        'Settings': self.ntlm_domain_auth_settings.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'LDAPServerIntegrity': {
                        'Policy': 'Domain controller: LDAP server signing '
                                  'requirements',
                        'Settings': self.ldap_server_signing_requirements.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4174..4194
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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

                    'RestrictReceivingNTLMTraffic': {
                        'Policy': 'Network security: Restrict NTLM: Incoming'
                                  ' NTLM traffic',
                        'Settings': self.incoming_ntlm_settings.keys(),
                        'lgpo_section': self.security_options_gpedit_path,
Severity: Major
Found in salt/modules/win_lgpo.py and 15 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 1729..1749
salt/modules/win_lgpo.py on lines 1875..1896
salt/modules/win_lgpo.py on lines 1943..1965
salt/modules/win_lgpo.py on lines 1969..1990
salt/modules/win_lgpo.py on lines 2157..2178
salt/modules/win_lgpo.py on lines 2253..2274
salt/modules/win_lgpo.py on lines 2320..2341
salt/modules/win_lgpo.py on lines 2478..2499
salt/modules/win_lgpo.py on lines 3852..3872
salt/modules/win_lgpo.py on lines 4005..4024
salt/modules/win_lgpo.py on lines 4028..4047
salt/modules/win_lgpo.py on lines 4127..4146
salt/modules/win_lgpo.py on lines 4150..4170
salt/modules/win_lgpo.py on lines 4198..4218
salt/modules/win_lgpo.py on lines 4222..4242

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

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