saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

def sync_states(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
    '''
    Sync state modules from ``salt://_states`` to the master

    saltenv : base
Severity: Major
Found in salt/runners/saltutil.py and 23 other locations - About 55 mins to fix
salt/runners/saltutil.py on lines 72..92
salt/runners/saltutil.py on lines 96..116
salt/runners/saltutil.py on lines 144..164
salt/runners/saltutil.py on lines 168..188
salt/runners/saltutil.py on lines 192..212
salt/runners/saltutil.py on lines 216..236
salt/runners/saltutil.py on lines 240..260
salt/runners/saltutil.py on lines 264..284
salt/runners/saltutil.py on lines 288..308
salt/runners/saltutil.py on lines 312..332
salt/runners/saltutil.py on lines 336..358
salt/runners/saltutil.py on lines 362..382
salt/runners/saltutil.py on lines 386..406
salt/runners/saltutil.py on lines 410..432
salt/runners/saltutil.py on lines 436..458
salt/runners/saltutil.py on lines 462..478
salt/runners/saltutil.py on lines 482..504
salt/runners/saltutil.py on lines 508..530
salt/runners/saltutil.py on lines 534..556
salt/runners/saltutil.py on lines 560..582
salt/runners/saltutil.py on lines 586..608
salt/runners/saltutil.py on lines 612..634
salt/runners/saltutil.py on lines 638..660

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

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

def sync_utils(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 2016.11.0

    Sync utils modules from ``salt://_utils`` to the master
Severity: Major
Found in salt/runners/saltutil.py and 23 other locations - About 55 mins to fix
salt/runners/saltutil.py on lines 72..92
salt/runners/saltutil.py on lines 96..116
salt/runners/saltutil.py on lines 120..140
salt/runners/saltutil.py on lines 144..164
salt/runners/saltutil.py on lines 168..188
salt/runners/saltutil.py on lines 192..212
salt/runners/saltutil.py on lines 216..236
salt/runners/saltutil.py on lines 240..260
salt/runners/saltutil.py on lines 264..284
salt/runners/saltutil.py on lines 288..308
salt/runners/saltutil.py on lines 312..332
salt/runners/saltutil.py on lines 336..358
salt/runners/saltutil.py on lines 362..382
salt/runners/saltutil.py on lines 386..406
salt/runners/saltutil.py on lines 436..458
salt/runners/saltutil.py on lines 462..478
salt/runners/saltutil.py on lines 482..504
salt/runners/saltutil.py on lines 508..530
salt/runners/saltutil.py on lines 534..556
salt/runners/saltutil.py on lines 560..582
salt/runners/saltutil.py on lines 586..608
salt/runners/saltutil.py on lines 612..634
salt/runners/saltutil.py on lines 638..660

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

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

def sync_grains(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
    '''
    Sync grains modules from ``salt://_grains`` to the master

    saltenv : base
Severity: Major
Found in salt/runners/saltutil.py and 23 other locations - About 55 mins to fix
salt/runners/saltutil.py on lines 72..92
salt/runners/saltutil.py on lines 96..116
salt/runners/saltutil.py on lines 120..140
salt/runners/saltutil.py on lines 168..188
salt/runners/saltutil.py on lines 192..212
salt/runners/saltutil.py on lines 216..236
salt/runners/saltutil.py on lines 240..260
salt/runners/saltutil.py on lines 264..284
salt/runners/saltutil.py on lines 288..308
salt/runners/saltutil.py on lines 312..332
salt/runners/saltutil.py on lines 336..358
salt/runners/saltutil.py on lines 362..382
salt/runners/saltutil.py on lines 386..406
salt/runners/saltutil.py on lines 410..432
salt/runners/saltutil.py on lines 436..458
salt/runners/saltutil.py on lines 462..478
salt/runners/saltutil.py on lines 482..504
salt/runners/saltutil.py on lines 508..530
salt/runners/saltutil.py on lines 534..556
salt/runners/saltutil.py on lines 560..582
salt/runners/saltutil.py on lines 586..608
salt/runners/saltutil.py on lines 612..634
salt/runners/saltutil.py on lines 638..660

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

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

def sync_output(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
    '''
    Sync output modules from ``salt://_output`` to the master

    saltenv : base
Severity: Major
Found in salt/runners/saltutil.py and 23 other locations - About 55 mins to fix
salt/runners/saltutil.py on lines 72..92
salt/runners/saltutil.py on lines 96..116
salt/runners/saltutil.py on lines 120..140
salt/runners/saltutil.py on lines 144..164
salt/runners/saltutil.py on lines 168..188
salt/runners/saltutil.py on lines 192..212
salt/runners/saltutil.py on lines 240..260
salt/runners/saltutil.py on lines 264..284
salt/runners/saltutil.py on lines 288..308
salt/runners/saltutil.py on lines 312..332
salt/runners/saltutil.py on lines 336..358
salt/runners/saltutil.py on lines 362..382
salt/runners/saltutil.py on lines 386..406
salt/runners/saltutil.py on lines 410..432
salt/runners/saltutil.py on lines 436..458
salt/runners/saltutil.py on lines 462..478
salt/runners/saltutil.py on lines 482..504
salt/runners/saltutil.py on lines 508..530
salt/runners/saltutil.py on lines 534..556
salt/runners/saltutil.py on lines 560..582
salt/runners/saltutil.py on lines 586..608
salt/runners/saltutil.py on lines 612..634
salt/runners/saltutil.py on lines 638..660

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

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

def sync_pillar(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
    '''
    Sync pillar modules from ``salt://_pillar`` to the master

    saltenv : base
Severity: Major
Found in salt/runners/saltutil.py and 23 other locations - About 55 mins to fix
salt/runners/saltutil.py on lines 72..92
salt/runners/saltutil.py on lines 96..116
salt/runners/saltutil.py on lines 120..140
salt/runners/saltutil.py on lines 144..164
salt/runners/saltutil.py on lines 168..188
salt/runners/saltutil.py on lines 192..212
salt/runners/saltutil.py on lines 216..236
salt/runners/saltutil.py on lines 240..260
salt/runners/saltutil.py on lines 264..284
salt/runners/saltutil.py on lines 288..308
salt/runners/saltutil.py on lines 312..332
salt/runners/saltutil.py on lines 336..358
salt/runners/saltutil.py on lines 362..382
salt/runners/saltutil.py on lines 410..432
salt/runners/saltutil.py on lines 436..458
salt/runners/saltutil.py on lines 462..478
salt/runners/saltutil.py on lines 482..504
salt/runners/saltutil.py on lines 508..530
salt/runners/saltutil.py on lines 534..556
salt/runners/saltutil.py on lines 560..582
salt/runners/saltutil.py on lines 586..608
salt/runners/saltutil.py on lines 612..634
salt/runners/saltutil.py on lines 638..660

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

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

def sync_tops(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
    '''
    .. versionadded:: 2016.3.7,2016.11.4,2017.7.0

    Sync master_tops modules from ``salt://_tops`` to the master
Severity: Major
Found in salt/runners/saltutil.py and 23 other locations - About 55 mins to fix
salt/runners/saltutil.py on lines 72..92
salt/runners/saltutil.py on lines 96..116
salt/runners/saltutil.py on lines 120..140
salt/runners/saltutil.py on lines 144..164
salt/runners/saltutil.py on lines 168..188
salt/runners/saltutil.py on lines 192..212
salt/runners/saltutil.py on lines 216..236
salt/runners/saltutil.py on lines 240..260
salt/runners/saltutil.py on lines 264..284
salt/runners/saltutil.py on lines 288..308
salt/runners/saltutil.py on lines 312..332
salt/runners/saltutil.py on lines 336..358
salt/runners/saltutil.py on lines 362..382
salt/runners/saltutil.py on lines 386..406
salt/runners/saltutil.py on lines 410..432
salt/runners/saltutil.py on lines 436..458
salt/runners/saltutil.py on lines 482..504
salt/runners/saltutil.py on lines 508..530
salt/runners/saltutil.py on lines 534..556
salt/runners/saltutil.py on lines 560..582
salt/runners/saltutil.py on lines 586..608
salt/runners/saltutil.py on lines 612..634
salt/runners/saltutil.py on lines 638..660

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Network interface {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Virtual network {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Public IP address {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Subnet {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Policy definition {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_resource.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Security rule {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Network security group {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Route table {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Resource group {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_resource.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Record set {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_dns.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Route {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Policy assignment {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_resource.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'DNS zone {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_dns.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1422..1425
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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 not ret['changes']:
            ret['result'] = True
            ret['comment'] = 'Load balancer {0} is already present.'.format(name)
            return ret
Severity: Major
Found in salt/states/azurearm_network.py and 14 other locations - About 55 mins to fix
salt/states/azurearm_compute.py on lines 215..218
salt/states/azurearm_dns.py on lines 253..256
salt/states/azurearm_dns.py on lines 557..560
salt/states/azurearm_network.py on lines 211..214
salt/states/azurearm_network.py on lines 418..421
salt/states/azurearm_network.py on lines 628..631
salt/states/azurearm_network.py on lines 987..990
salt/states/azurearm_network.py on lines 1677..1680
salt/states/azurearm_network.py on lines 1989..1992
salt/states/azurearm_network.py on lines 2207..2210
salt/states/azurearm_network.py on lines 2402..2405
salt/states/azurearm_resource.py on lines 160..163
salt/states/azurearm_resource.py on lines 487..490
salt/states/azurearm_resource.py on lines 702..705

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

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