saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

        if not tag:
            jobs.append({'job': job, 'date': specs[0], 'time': specs[1],
                'queue': specs[2], 'user': specs[3], 'tag': job_tag})
Severity: Major
Found in salt/modules/at_solaris.py and 3 other locations - About 1 hr to fix
salt/modules/at.py on lines 156..158
salt/modules/at.py on lines 152..161
salt/modules/at_solaris.py on lines 117..119

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

    try:
        # Check for required profile parameters before sending any API calls.
        if vm_['profile'] and config.is_profile_configured(__opts__,
                                                           __active_provider_name__ or 'aliyun',
                                                           vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/aliyun.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/azurearm.py on lines 1384..1392
salt/cloud/clouds/cloudstack.py on lines 270..277
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/joyent.py on lines 260..267
salt/cloud/clouds/linode.py on lines 328..335
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/parallels.py on lines 277..284
salt/cloud/clouds/proxmox.py on lines 566..573
salt/cloud/clouds/qingcloud.py on lines 658..665
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer.py on lines 248..255
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

    try:
        if vm_['profile'] and config.is_profile_configured(
            __opts__,
            __active_provider_name__ or 'azurearm',
            vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/azurearm.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/aliyun.py on lines 615..622
salt/cloud/clouds/cloudstack.py on lines 270..277
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/joyent.py on lines 260..267
salt/cloud/clouds/linode.py on lines 328..335
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/parallels.py on lines 277..284
salt/cloud/clouds/proxmox.py on lines 566..573
salt/cloud/clouds/qingcloud.py on lines 658..665
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer.py on lines 248..255
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

    try:
        # Check for required profile parameters before sending any API calls.
        if vm_['profile'] and config.is_profile_configured(__opts__,
                                                           __active_provider_name__ or 'softlayer',
                                                           vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/softlayer.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/aliyun.py on lines 615..622
salt/cloud/clouds/azurearm.py on lines 1384..1392
salt/cloud/clouds/cloudstack.py on lines 270..277
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/joyent.py on lines 260..267
salt/cloud/clouds/linode.py on lines 328..335
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/parallels.py on lines 277..284
salt/cloud/clouds/proxmox.py on lines 566..573
salt/cloud/clouds/qingcloud.py on lines 658..665
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

    try:
        # Check for required profile parameters before sending any API calls.
        if vm_['profile'] and config.is_profile_configured(__opts__,
                                                           __active_provider_name__ or 'linode',
                                                           vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/linode.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/aliyun.py on lines 615..622
salt/cloud/clouds/azurearm.py on lines 1384..1392
salt/cloud/clouds/cloudstack.py on lines 270..277
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/joyent.py on lines 260..267
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/parallels.py on lines 277..284
salt/cloud/clouds/proxmox.py on lines 566..573
salt/cloud/clouds/qingcloud.py on lines 658..665
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer.py on lines 248..255
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

            if tag == job_tag or tag == job:
                jobs.append({'job': job, 'date': specs[0], 'time': specs[1],
                    'queue': specs[2], 'user': specs[3], 'tag': job_tag})
Severity: Major
Found in salt/modules/at.py and 3 other locations - About 1 hr to fix
salt/modules/at.py on lines 152..161
salt/modules/at_solaris.py on lines 114..116
salt/modules/at_solaris.py on lines 117..119

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

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

        if res['retcode'] > 0:
            return {login: res['stderr'] if 'stderr' in res else res['stdout']}
Severity: Major
Found in salt/modules/pdbedit.py and 3 other locations - About 1 hr to fix
salt/modules/pdbedit.py on lines 164..165
salt/modules/pdbedit.py on lines 212..213
salt/modules/pdbedit.py on lines 227..228

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

                    'WfwPrivateInboundConnections': {
                        'Policy': 'Network firewall: Private: Inbound connections',
                        'lgpo_section': self.windows_firewall_gpedit_path,
                        # Settings available are:
                        # - Block (default)
Severity: Major
Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 928..950
salt/modules/win_lgpo.py on lines 954..976
salt/modules/win_lgpo.py on lines 980..1002
salt/modules/win_lgpo.py on lines 1006..1029
salt/modules/win_lgpo.py on lines 1060..1083
salt/modules/win_lgpo.py on lines 1087..1109
salt/modules/win_lgpo.py on lines 1113..1135
salt/modules/win_lgpo.py on lines 1139..1161
salt/modules/win_lgpo.py on lines 1165..1187
salt/modules/win_lgpo.py on lines 1191..1213
salt/modules/win_lgpo.py on lines 1217..1239
salt/modules/win_lgpo.py on lines 1243..1266
salt/modules/win_lgpo.py on lines 1270..1293
salt/modules/win_lgpo.py on lines 1297..1320
salt/modules/win_lgpo.py on lines 1324..1347
salt/modules/win_lgpo.py on lines 1351..1374
salt/modules/win_lgpo.py on lines 1378..1401
salt/modules/win_lgpo.py on lines 1483..1505
salt/modules/win_lgpo.py on lines 1509..1531
salt/modules/win_lgpo.py on lines 1535..1557
salt/modules/win_lgpo.py on lines 1561..1583
salt/modules/win_lgpo.py on lines 1587..1609
salt/modules/win_lgpo.py on lines 1613..1635

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

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

                    'WfwPublicInboundConnections': {
                        'Policy': 'Network firewall: Public: Inbound connections',
                        'lgpo_section': self.windows_firewall_gpedit_path,
                        # Settings available are:
                        # - Block (default)
Severity: Major
Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 928..950
salt/modules/win_lgpo.py on lines 954..976
salt/modules/win_lgpo.py on lines 980..1002
salt/modules/win_lgpo.py on lines 1006..1029
salt/modules/win_lgpo.py on lines 1033..1056
salt/modules/win_lgpo.py on lines 1087..1109
salt/modules/win_lgpo.py on lines 1113..1135
salt/modules/win_lgpo.py on lines 1139..1161
salt/modules/win_lgpo.py on lines 1165..1187
salt/modules/win_lgpo.py on lines 1191..1213
salt/modules/win_lgpo.py on lines 1217..1239
salt/modules/win_lgpo.py on lines 1243..1266
salt/modules/win_lgpo.py on lines 1270..1293
salt/modules/win_lgpo.py on lines 1297..1320
salt/modules/win_lgpo.py on lines 1324..1347
salt/modules/win_lgpo.py on lines 1351..1374
salt/modules/win_lgpo.py on lines 1378..1401
salt/modules/win_lgpo.py on lines 1483..1505
salt/modules/win_lgpo.py on lines 1509..1531
salt/modules/win_lgpo.py on lines 1535..1557
salt/modules/win_lgpo.py on lines 1561..1583
salt/modules/win_lgpo.py on lines 1587..1609
salt/modules/win_lgpo.py on lines 1613..1635

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

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

    try:
        # Check for required profile parameters before sending any API calls.
        if vm_['profile'] and config.is_profile_configured(__opts__,
                                                           __active_provider_name__ or 'qingcloud',
                                                           vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/qingcloud.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/aliyun.py on lines 615..622
salt/cloud/clouds/azurearm.py on lines 1384..1392
salt/cloud/clouds/cloudstack.py on lines 270..277
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/joyent.py on lines 260..267
salt/cloud/clouds/linode.py on lines 328..335
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/parallels.py on lines 277..284
salt/cloud/clouds/proxmox.py on lines 566..573
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer.py on lines 248..255
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

    try:
        # Check for required profile parameters before sending any API calls.
        if vm_['profile'] and config.is_profile_configured(__opts__,
                                                           __active_provider_name__ or 'proxmox',
                                                           vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/proxmox.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/aliyun.py on lines 615..622
salt/cloud/clouds/azurearm.py on lines 1384..1392
salt/cloud/clouds/cloudstack.py on lines 270..277
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/joyent.py on lines 260..267
salt/cloud/clouds/linode.py on lines 328..335
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/parallels.py on lines 277..284
salt/cloud/clouds/qingcloud.py on lines 658..665
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer.py on lines 248..255
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

        if res['retcode'] > 0:
            return {login: res['stderr'] if 'stderr' in res else res['stdout']}
Severity: Major
Found in salt/modules/pdbedit.py and 3 other locations - About 1 hr to fix
salt/modules/pdbedit.py on lines 212..213
salt/modules/pdbedit.py on lines 227..228
salt/modules/pdbedit.py on lines 379..380

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

                    'WfwPublicSettingsLocalFirewallRules': {
                        'Policy': 'Network firewall: Public: Settings: Apply '
                                  'local firewall rules',
                        'lgpo_section': self.windows_firewall_gpedit_path,
                        # Settings available are:
Severity: Major
Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 928..950
salt/modules/win_lgpo.py on lines 954..976
salt/modules/win_lgpo.py on lines 980..1002
salt/modules/win_lgpo.py on lines 1006..1029
salt/modules/win_lgpo.py on lines 1033..1056
salt/modules/win_lgpo.py on lines 1060..1083
salt/modules/win_lgpo.py on lines 1087..1109
salt/modules/win_lgpo.py on lines 1113..1135
salt/modules/win_lgpo.py on lines 1139..1161
salt/modules/win_lgpo.py on lines 1165..1187
salt/modules/win_lgpo.py on lines 1191..1213
salt/modules/win_lgpo.py on lines 1217..1239
salt/modules/win_lgpo.py on lines 1243..1266
salt/modules/win_lgpo.py on lines 1270..1293
salt/modules/win_lgpo.py on lines 1324..1347
salt/modules/win_lgpo.py on lines 1351..1374
salt/modules/win_lgpo.py on lines 1378..1401
salt/modules/win_lgpo.py on lines 1483..1505
salt/modules/win_lgpo.py on lines 1509..1531
salt/modules/win_lgpo.py on lines 1535..1557
salt/modules/win_lgpo.py on lines 1561..1583
salt/modules/win_lgpo.py on lines 1587..1609
salt/modules/win_lgpo.py on lines 1613..1635

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

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

                    'WfwPublicLoggingDroppedConnections': {
                        'Policy': 'Network firewall: Public: Logging: Log dropped packets',
                        'lgpo_section': self.windows_firewall_gpedit_path,
                        # Settings available are:
                        # - Yes
Severity: Major
Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 928..950
salt/modules/win_lgpo.py on lines 954..976
salt/modules/win_lgpo.py on lines 980..1002
salt/modules/win_lgpo.py on lines 1006..1029
salt/modules/win_lgpo.py on lines 1033..1056
salt/modules/win_lgpo.py on lines 1060..1083
salt/modules/win_lgpo.py on lines 1087..1109
salt/modules/win_lgpo.py on lines 1113..1135
salt/modules/win_lgpo.py on lines 1139..1161
salt/modules/win_lgpo.py on lines 1165..1187
salt/modules/win_lgpo.py on lines 1191..1213
salt/modules/win_lgpo.py on lines 1217..1239
salt/modules/win_lgpo.py on lines 1243..1266
salt/modules/win_lgpo.py on lines 1270..1293
salt/modules/win_lgpo.py on lines 1297..1320
salt/modules/win_lgpo.py on lines 1324..1347
salt/modules/win_lgpo.py on lines 1351..1374
salt/modules/win_lgpo.py on lines 1378..1401
salt/modules/win_lgpo.py on lines 1483..1505
salt/modules/win_lgpo.py on lines 1509..1531
salt/modules/win_lgpo.py on lines 1535..1557
salt/modules/win_lgpo.py on lines 1561..1583
salt/modules/win_lgpo.py on lines 1587..1609

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

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

    try:
        # Check for required profile parameters before sending any API calls.
        if vm_['profile'] and config.is_profile_configured(__opts__,
                                                           __active_provider_name__ or 'cloudstack',
                                                           vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/cloudstack.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/aliyun.py on lines 615..622
salt/cloud/clouds/azurearm.py on lines 1384..1392
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/joyent.py on lines 260..267
salt/cloud/clouds/linode.py on lines 328..335
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/parallels.py on lines 277..284
salt/cloud/clouds/proxmox.py on lines 566..573
salt/cloud/clouds/qingcloud.py on lines 658..665
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer.py on lines 248..255
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

    try:
        # Check for required profile parameters before sending any API calls.
        if vm_['profile'] and config.is_profile_configured(__opts__,
                                                           __active_provider_name__ or 'parallels',
                                                           vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/parallels.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/aliyun.py on lines 615..622
salt/cloud/clouds/azurearm.py on lines 1384..1392
salt/cloud/clouds/cloudstack.py on lines 270..277
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/joyent.py on lines 260..267
salt/cloud/clouds/linode.py on lines 328..335
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/proxmox.py on lines 566..573
salt/cloud/clouds/qingcloud.py on lines 658..665
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer.py on lines 248..255
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

    try:
        # Check for required profile parameters before sending any API calls.
        if vm_['profile'] and config.is_profile_configured(__opts__,
                                                           __active_provider_name__ or 'joyent',
                                                           vm_['profile'],
Severity: Major
Found in salt/cloud/clouds/joyent.py and 17 other locations - About 1 hr to fix
salt/cloud/clouds/aliyun.py on lines 615..622
salt/cloud/clouds/azurearm.py on lines 1384..1392
salt/cloud/clouds/cloudstack.py on lines 270..277
salt/cloud/clouds/digitalocean.py on lines 277..284
salt/cloud/clouds/ec2.py on lines 2554..2561
salt/cloud/clouds/gce.py on lines 2451..2458
salt/cloud/clouds/gogrid.py on lines 86..93
salt/cloud/clouds/linode.py on lines 328..335
salt/cloud/clouds/msazure.py on lines 419..426
salt/cloud/clouds/nova.py on lines 938..945
salt/cloud/clouds/parallels.py on lines 277..284
salt/cloud/clouds/proxmox.py on lines 566..573
salt/cloud/clouds/qingcloud.py on lines 658..665
salt/cloud/clouds/scaleway.py on lines 190..197
salt/cloud/clouds/softlayer.py on lines 248..255
salt/cloud/clouds/softlayer_hw.py on lines 216..223
salt/cloud/clouds/vmware.py on lines 2532..2540

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

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

                    'WfwPublicState': {
                        'Policy': 'Network firewall: Public: State',
                        'lgpo_section': self.windows_firewall_gpedit_path,
                        # Settings available are:
                        # - On (recommended)
Severity: Major
Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 928..950
salt/modules/win_lgpo.py on lines 954..976
salt/modules/win_lgpo.py on lines 1006..1029
salt/modules/win_lgpo.py on lines 1033..1056
salt/modules/win_lgpo.py on lines 1060..1083
salt/modules/win_lgpo.py on lines 1087..1109
salt/modules/win_lgpo.py on lines 1113..1135
salt/modules/win_lgpo.py on lines 1139..1161
salt/modules/win_lgpo.py on lines 1165..1187
salt/modules/win_lgpo.py on lines 1191..1213
salt/modules/win_lgpo.py on lines 1217..1239
salt/modules/win_lgpo.py on lines 1243..1266
salt/modules/win_lgpo.py on lines 1270..1293
salt/modules/win_lgpo.py on lines 1297..1320
salt/modules/win_lgpo.py on lines 1324..1347
salt/modules/win_lgpo.py on lines 1351..1374
salt/modules/win_lgpo.py on lines 1378..1401
salt/modules/win_lgpo.py on lines 1483..1505
salt/modules/win_lgpo.py on lines 1509..1531
salt/modules/win_lgpo.py on lines 1535..1557
salt/modules/win_lgpo.py on lines 1561..1583
salt/modules/win_lgpo.py on lines 1587..1609
salt/modules/win_lgpo.py on lines 1613..1635

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

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

                    'WfwDomainSettingsLocalFirewallRules': {
                        'Policy': 'Network firewall: Domain: Settings: Apply '
                                  'local firewall rules',
                        'lgpo_section': self.windows_firewall_gpedit_path,
                        # Settings available are:
Severity: Major
Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 928..950
salt/modules/win_lgpo.py on lines 954..976
salt/modules/win_lgpo.py on lines 980..1002
salt/modules/win_lgpo.py on lines 1006..1029
salt/modules/win_lgpo.py on lines 1033..1056
salt/modules/win_lgpo.py on lines 1060..1083
salt/modules/win_lgpo.py on lines 1087..1109
salt/modules/win_lgpo.py on lines 1113..1135
salt/modules/win_lgpo.py on lines 1139..1161
salt/modules/win_lgpo.py on lines 1165..1187
salt/modules/win_lgpo.py on lines 1191..1213
salt/modules/win_lgpo.py on lines 1217..1239
salt/modules/win_lgpo.py on lines 1270..1293
salt/modules/win_lgpo.py on lines 1297..1320
salt/modules/win_lgpo.py on lines 1324..1347
salt/modules/win_lgpo.py on lines 1351..1374
salt/modules/win_lgpo.py on lines 1378..1401
salt/modules/win_lgpo.py on lines 1483..1505
salt/modules/win_lgpo.py on lines 1509..1531
salt/modules/win_lgpo.py on lines 1535..1557
salt/modules/win_lgpo.py on lines 1561..1583
salt/modules/win_lgpo.py on lines 1587..1609
salt/modules/win_lgpo.py on lines 1613..1635

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

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

                    'WfwDomainSettingsLocalConnectionRules': {
                        'Policy': 'Network firewall: Domain: Settings: Apply '
                                  'local connection security rules',
                        'lgpo_section': self.windows_firewall_gpedit_path,
                        # Settings available are:
Severity: Major
Found in salt/modules/win_lgpo.py and 23 other locations - About 1 hr to fix
salt/modules/win_lgpo.py on lines 928..950
salt/modules/win_lgpo.py on lines 954..976
salt/modules/win_lgpo.py on lines 980..1002
salt/modules/win_lgpo.py on lines 1006..1029
salt/modules/win_lgpo.py on lines 1033..1056
salt/modules/win_lgpo.py on lines 1060..1083
salt/modules/win_lgpo.py on lines 1087..1109
salt/modules/win_lgpo.py on lines 1113..1135
salt/modules/win_lgpo.py on lines 1139..1161
salt/modules/win_lgpo.py on lines 1165..1187
salt/modules/win_lgpo.py on lines 1191..1213
salt/modules/win_lgpo.py on lines 1217..1239
salt/modules/win_lgpo.py on lines 1243..1266
salt/modules/win_lgpo.py on lines 1270..1293
salt/modules/win_lgpo.py on lines 1297..1320
salt/modules/win_lgpo.py on lines 1351..1374
salt/modules/win_lgpo.py on lines 1378..1401
salt/modules/win_lgpo.py on lines 1483..1505
salt/modules/win_lgpo.py on lines 1509..1531
salt/modules/win_lgpo.py on lines 1535..1557
salt/modules/win_lgpo.py on lines 1561..1583
salt/modules/win_lgpo.py on lines 1587..1609
salt/modules/win_lgpo.py on lines 1613..1635

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

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