saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

def sync_returners(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 0.10.0

    Sync returners from ``salt://_returners`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 844..880
salt/modules/saltutil.py on lines 924..960

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

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

def sync_log_handlers(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 2015.8.0

    Sync log handlers from ``salt://_log_handlers`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 924..960

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

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

    if 'error' not in nsg:
        ret['result'] = True
        ret['comment'] = 'Network security group {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

    if 'error' not in iface:
        ret['result'] = True
        ret['comment'] = 'Network interface {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

    if 'error' not in aset:
        ret['result'] = True
        ret['comment'] = 'Availability set {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_compute.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

    if 'error' not in policy:
        ret['result'] = True
        ret['comment'] = 'Policy definition {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_resource.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 747..750

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

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

def sync_engines(saltenv=None, refresh=False, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 2016.3.0

    Sync engine modules from ``salt://_engines`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 844..880
salt/modules/saltutil.py on lines 924..960

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

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

def sync_utils(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 2014.7.0

    Sync utility modules from ``salt://_utils`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 844..880
salt/modules/saltutil.py on lines 924..960

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

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

def sync_proxymodules(saltenv=None, refresh=False, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 2015.8.2

    Sync proxy modules from ``salt://_proxy`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 844..880
salt/modules/saltutil.py on lines 924..960

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

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

    if 'error' not in pub_ip:
        ret['result'] = True
        ret['comment'] = 'Public IP address {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

    if 'error' not in load_bal:
        ret['result'] = True
        ret['comment'] = 'Load balancer {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

    if 'error' not in route:
        ret['result'] = True
        ret['comment'] = 'Route {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

def sync_output(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
    '''
    Sync outputters from ``salt://_output`` to the minion

    saltenv
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 844..880
salt/modules/saltutil.py on lines 924..960

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

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

def sync_serializers(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 2019.2.0

    Sync serializers from ``salt://_serializers`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 844..880
salt/modules/saltutil.py on lines 924..960

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

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

    if 'error' not in snet:
        ret['result'] = True
        ret['comment'] = 'Subnet {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

    if 'error' not in zone:
        ret['result'] = True
        ret['comment'] = 'DNS zone {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_dns.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1046..1049
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

def sync_modules(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 0.10.0

    Sync execution modules from ``salt://_modules`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 844..880
salt/modules/saltutil.py on lines 924..960

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

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

    if 'error' not in rule:
        ret['result'] = True
        ret['comment'] = 'Security rule {0} has been created.'.format(name)
        return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 35 mins to fix
salt/modules/gpg.py on lines 904..907
salt/states/azurearm_compute.py on lines 257..260
salt/states/azurearm_dns.py on lines 298..301
salt/states/azurearm_dns.py on lines 617..620
salt/states/azurearm_network.py on lines 252..255
salt/states/azurearm_network.py on lines 457..460
salt/states/azurearm_network.py on lines 665..668
salt/states/azurearm_network.py on lines 1472..1475
salt/states/azurearm_network.py on lines 1721..1724
salt/states/azurearm_network.py on lines 2041..2044
salt/states/azurearm_network.py on lines 2245..2248
salt/states/azurearm_network.py on lines 2441..2444
salt/states/azurearm_resource.py on lines 538..541
salt/states/azurearm_resource.py on lines 747..750

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

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

def sync_renderers(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 0.10.0

    Sync renderers from ``salt://_renderers`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 844..880
salt/modules/saltutil.py on lines 924..960

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

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

def sync_executors(saltenv=None, refresh=True, extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 2019.2.1

    Sync executors from ``salt://_executors`` to the minion
Severity: Major
Found in salt/modules/saltutil.py and 14 other locations - About 35 mins to fix
salt/modules/saltutil.py on lines 192..228
salt/modules/saltutil.py on lines 267..320
salt/modules/saltutil.py on lines 323..359
salt/modules/saltutil.py on lines 436..473
salt/modules/saltutil.py on lines 476..511
salt/modules/saltutil.py on lines 514..550
salt/modules/saltutil.py on lines 553..588
salt/modules/saltutil.py on lines 591..626
salt/modules/saltutil.py on lines 629..664
salt/modules/saltutil.py on lines 667..701
salt/modules/saltutil.py on lines 707..739
salt/modules/saltutil.py on lines 742..778
salt/modules/saltutil.py on lines 781..817
salt/modules/saltutil.py on lines 844..880

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

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