saltstack/salt

View on GitHub

Showing 7,542 of 17,590 total issues

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

def present(name, definition=None):
    '''
    .. versionadded:: 2015.8.0
    .. versionchanged:: 2017.3.0
        Marked ``definition`` as optional.
Severity: Major
Found in salt/states/elasticsearch_index.py and 1 other location - About 2 days to fix
salt/states/elasticsearch.py on lines 52..101

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

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

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

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

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

Refactorings

Further Reading

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

def index_present(name, definition=None):
    '''
    Ensure that the named index is present.

    name
Severity: Major
Found in salt/states/elasticsearch.py and 1 other location - About 2 days to fix
salt/states/elasticsearch_index.py on lines 52..106

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

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

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

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

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

Refactorings

Further Reading

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

def cache_cluster_absent(name, wait=600, region=None, key=None, keyid=None,
                         profile=None, **args):
    '''
    Ensure a given cache cluster is deleted.

Severity: Major
Found in salt/states/boto3_elasticache.py and 1 other location - About 2 days to fix
salt/states/boto3_elasticache.py on lines 916..978

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

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

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

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

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

Refactorings

Further Reading

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

def replication_group_absent(name, wait=600, region=None, key=None, keyid=None,
                             profile=None, **args):
    '''
    Ensure a given replication group is deleted.

Severity: Major
Found in salt/states/boto3_elasticache.py and 1 other location - About 2 days to fix
salt/states/boto3_elasticache.py on lines 487..545

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

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

def network_interface_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure a network interface does not exist in the resource group.
Severity: Major
Found in salt/states/azurearm_network.py and 8 other locations - About 2 days to fix
salt/states/azurearm_compute.py on lines 266..326
salt/states/azurearm_dns.py on lines 307..367
salt/states/azurearm_network.py on lines 261..321
salt/states/azurearm_network.py on lines 674..734
salt/states/azurearm_network.py on lines 1481..1541
salt/states/azurearm_network.py on lines 1730..1790
salt/states/azurearm_network.py on lines 2254..2314
salt/states/azurearm_resource.py on lines 756..816

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

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

def absent(name):
    '''
    Ensure that the named index template is absent.

    name
Severity: Major
Found in salt/states/elasticsearch_index_template.py and 4 other locations - About 2 days to fix
salt/states/elasticsearch.py on lines 19..49
salt/states/elasticsearch.py on lines 202..232
salt/states/elasticsearch.py on lines 312..342
salt/states/elasticsearch_index.py on lines 19..49

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

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

def pipeline_absent(name):
    '''
    Ensure that the named pipeline is absent

    name
Severity: Major
Found in salt/states/elasticsearch.py and 4 other locations - About 2 days to fix
salt/states/elasticsearch.py on lines 19..49
salt/states/elasticsearch.py on lines 202..232
salt/states/elasticsearch_index.py on lines 19..49
salt/states/elasticsearch_index_template.py on lines 19..49

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

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

def public_ip_address_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure a public IP address does not exist in the resource group.
Severity: Major
Found in salt/states/azurearm_network.py and 8 other locations - About 2 days to fix
salt/states/azurearm_compute.py on lines 266..326
salt/states/azurearm_dns.py on lines 307..367
salt/states/azurearm_network.py on lines 261..321
salt/states/azurearm_network.py on lines 674..734
salt/states/azurearm_network.py on lines 1481..1541
salt/states/azurearm_network.py on lines 2050..2110
salt/states/azurearm_network.py on lines 2254..2314
salt/states/azurearm_resource.py on lines 756..816

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

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

def load_balancer_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure a load balancer does not exist in the resource group.
Severity: Major
Found in salt/states/azurearm_network.py and 8 other locations - About 2 days to fix
salt/states/azurearm_compute.py on lines 266..326
salt/states/azurearm_dns.py on lines 307..367
salt/states/azurearm_network.py on lines 261..321
salt/states/azurearm_network.py on lines 674..734
salt/states/azurearm_network.py on lines 1730..1790
salt/states/azurearm_network.py on lines 2050..2110
salt/states/azurearm_network.py on lines 2254..2314
salt/states/azurearm_resource.py on lines 756..816

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

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

def absent(name):
    '''
    Ensure that the named index is absent.

    name
Severity: Major
Found in salt/states/elasticsearch_index.py and 4 other locations - About 2 days to fix
salt/states/elasticsearch.py on lines 19..49
salt/states/elasticsearch.py on lines 202..232
salt/states/elasticsearch.py on lines 312..342
salt/states/elasticsearch_index_template.py on lines 19..49

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

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

def network_security_group_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure a network security group does not exist in the resource group.
Severity: Major
Found in salt/states/azurearm_network.py and 8 other locations - About 2 days to fix
salt/states/azurearm_compute.py on lines 266..326
salt/states/azurearm_dns.py on lines 307..367
salt/states/azurearm_network.py on lines 261..321
salt/states/azurearm_network.py on lines 1481..1541
salt/states/azurearm_network.py on lines 1730..1790
salt/states/azurearm_network.py on lines 2050..2110
salt/states/azurearm_network.py on lines 2254..2314
salt/states/azurearm_resource.py on lines 756..816

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

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

def route_table_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure a route table does not exist in the resource group.
Severity: Major
Found in salt/states/azurearm_network.py and 8 other locations - About 2 days to fix
salt/states/azurearm_compute.py on lines 266..326
salt/states/azurearm_dns.py on lines 307..367
salt/states/azurearm_network.py on lines 261..321
salt/states/azurearm_network.py on lines 674..734
salt/states/azurearm_network.py on lines 1481..1541
salt/states/azurearm_network.py on lines 1730..1790
salt/states/azurearm_network.py on lines 2050..2110
salt/states/azurearm_resource.py on lines 756..816

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

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

def index_template_absent(name):
    '''
    Ensure that the named index template is absent.

    name
Severity: Major
Found in salt/states/elasticsearch.py and 4 other locations - About 2 days to fix
salt/states/elasticsearch.py on lines 19..49
salt/states/elasticsearch.py on lines 312..342
salt/states/elasticsearch_index.py on lines 19..49
salt/states/elasticsearch_index_template.py on lines 19..49

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

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

def zone_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: Fluorine

    Ensure a DNS zone does not exist in the resource group.
Severity: Major
Found in salt/states/azurearm_dns.py and 8 other locations - About 2 days to fix
salt/states/azurearm_compute.py on lines 266..326
salt/states/azurearm_network.py on lines 261..321
salt/states/azurearm_network.py on lines 674..734
salt/states/azurearm_network.py on lines 1481..1541
salt/states/azurearm_network.py on lines 1730..1790
salt/states/azurearm_network.py on lines 2050..2110
salt/states/azurearm_network.py on lines 2254..2314
salt/states/azurearm_resource.py on lines 756..816

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

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

def availability_set_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure an availability set does not exist in a resource group.
Severity: Major
Found in salt/states/azurearm_compute.py and 8 other locations - About 2 days to fix
salt/states/azurearm_dns.py on lines 307..367
salt/states/azurearm_network.py on lines 261..321
salt/states/azurearm_network.py on lines 674..734
salt/states/azurearm_network.py on lines 1481..1541
salt/states/azurearm_network.py on lines 1730..1790
salt/states/azurearm_network.py on lines 2050..2110
salt/states/azurearm_network.py on lines 2254..2314
salt/states/azurearm_resource.py on lines 756..816

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

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

def virtual_network_absent(name, resource_group, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure a virtual network does not exist in the resource group.
Severity: Major
Found in salt/states/azurearm_network.py and 8 other locations - About 2 days to fix
salt/states/azurearm_compute.py on lines 266..326
salt/states/azurearm_dns.py on lines 307..367
salt/states/azurearm_network.py on lines 674..734
salt/states/azurearm_network.py on lines 1481..1541
salt/states/azurearm_network.py on lines 1730..1790
salt/states/azurearm_network.py on lines 2050..2110
salt/states/azurearm_network.py on lines 2254..2314
salt/states/azurearm_resource.py on lines 756..816

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

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

def index_absent(name):
    '''
    Ensure that the named index is absent.

    name
Severity: Major
Found in salt/states/elasticsearch.py and 4 other locations - About 2 days to fix
salt/states/elasticsearch.py on lines 202..232
salt/states/elasticsearch.py on lines 312..342
salt/states/elasticsearch_index.py on lines 19..49
salt/states/elasticsearch_index_template.py on lines 19..49

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

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

def _auto_adjust_panel_spans(dashboard):
    '''Adjust panel spans to take up the available width.

    For each group of panels that would be laid out on the same level, scale up
    the unspecified panel spans to fill up the level.
Severity: Major
Found in salt/states/grafana4_dashboard.py and 1 other location - About 2 days to fix
salt/states/grafana_dashboard.py on lines 331..362

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

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

def policy_assignment_absent(name, scope, connection_auth=None):
    '''
    .. versionadded:: 2019.2.0

    Ensure a policy assignment does not exist in the provided scope.
Severity: Major
Found in salt/states/azurearm_resource.py and 8 other locations - About 2 days to fix
salt/states/azurearm_compute.py on lines 266..326
salt/states/azurearm_dns.py on lines 307..367
salt/states/azurearm_network.py on lines 261..321
salt/states/azurearm_network.py on lines 674..734
salt/states/azurearm_network.py on lines 1481..1541
salt/states/azurearm_network.py on lines 1730..1790
salt/states/azurearm_network.py on lines 2050..2110
salt/states/azurearm_network.py on lines 2254..2314

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

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

def _auto_adjust_panel_spans(dashboard):
    '''Adjust panel spans to take up the available width.

    For each group of panels that would be laid out on the same level, scale up
    the unspecified panel spans to fill up the level.
Severity: Major
Found in salt/states/grafana_dashboard.py and 1 other location - About 2 days to fix
salt/states/grafana4_dashboard.py on lines 355..386

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

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