saltstack/salt

View on GitHub
salt/modules/azurearm_resource.py

Summary

Maintainability
F
1 wk
Test Coverage

File azurearm_resource.py has 827 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Azure (ARM) Resource Execution Module

.. versionadded:: 2019.2.0
Severity: Major
Found in salt/modules/azurearm_resource.py - About 1 day to fix

    Function deployment_create_or_update has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def deployment_create_or_update(name, resource_group, deploy_mode='incremental',
                                    debug_setting='none', deploy_params=None,
                                    parameters_link=None, deploy_template=None,
                                    template_link=None, **kwargs):
        '''
    Severity: Minor
    Found in salt/modules/azurearm_resource.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function deployment_validate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def deployment_validate(name, resource_group, deploy_mode=None,
                            debug_setting=None, deploy_params=None,
                            parameters_link=None, deploy_template=None,
                            template_link=None, **kwargs):
        '''
    Severity: Minor
    Found in salt/modules/azurearm_resource.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function policy_assignment_create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def policy_assignment_create(name, scope, definition_name, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        Create a policy assignment.
    Severity: Minor
    Found in salt/modules/azurearm_resource.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    def deployment_operations_list(name, resource_group, result_limit=10, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        List all deployment operations within a deployment.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 1 other location - About 7 hrs to fix
    salt/modules/azurearm_network.py on lines 1707..1747

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

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

    def deployments_list(resource_group, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        List all deployments within a resource group.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 9 other locations - About 7 hrs to fix
    salt/modules/azurearm_compute.py on lines 214..245
    salt/modules/azurearm_compute.py on lines 479..509
    salt/modules/azurearm_network.py on lines 604..634
    salt/modules/azurearm_network.py on lines 880..911
    salt/modules/azurearm_network.py on lines 1086..1117
    salt/modules/azurearm_network.py on lines 1600..1631
    salt/modules/azurearm_network.py on lines 1983..2014
    salt/modules/azurearm_network.py on lines 2331..2362
    salt/modules/azurearm_network.py on lines 2690..2721

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

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

    def tenants_list(**kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        List all tenants for your account.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 11 other locations - About 7 hrs to fix
    salt/modules/azurearm_compute.py on lines 512..537
    salt/modules/azurearm_network.py on lines 637..662
    salt/modules/azurearm_network.py on lines 853..877
    salt/modules/azurearm_network.py on lines 1059..1083
    salt/modules/azurearm_network.py on lines 1573..1597
    salt/modules/azurearm_network.py on lines 1956..1980
    salt/modules/azurearm_network.py on lines 2365..2389
    salt/modules/azurearm_network.py on lines 2724..2748
    salt/modules/azurearm_resource.py on lines 81..105
    salt/modules/azurearm_resource.py on lines 781..805
    salt/modules/azurearm_resource.py on lines 1012..1036

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

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

    def policy_assignments_list(**kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        List all policy assignments for a subscription.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 11 other locations - About 7 hrs to fix
    salt/modules/azurearm_compute.py on lines 512..537
    salt/modules/azurearm_network.py on lines 637..662
    salt/modules/azurearm_network.py on lines 853..877
    salt/modules/azurearm_network.py on lines 1059..1083
    salt/modules/azurearm_network.py on lines 1573..1597
    salt/modules/azurearm_network.py on lines 1956..1980
    salt/modules/azurearm_network.py on lines 2365..2389
    salt/modules/azurearm_network.py on lines 2724..2748
    salt/modules/azurearm_resource.py on lines 81..105
    salt/modules/azurearm_resource.py on lines 781..805
    salt/modules/azurearm_resource.py on lines 808..832

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

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

    def subscriptions_list(**kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        List all subscriptions for a tenant.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 11 other locations - About 7 hrs to fix
    salt/modules/azurearm_compute.py on lines 512..537
    salt/modules/azurearm_network.py on lines 637..662
    salt/modules/azurearm_network.py on lines 853..877
    salt/modules/azurearm_network.py on lines 1059..1083
    salt/modules/azurearm_network.py on lines 1573..1597
    salt/modules/azurearm_network.py on lines 1956..1980
    salt/modules/azurearm_network.py on lines 2365..2389
    salt/modules/azurearm_network.py on lines 2724..2748
    salt/modules/azurearm_resource.py on lines 81..105
    salt/modules/azurearm_resource.py on lines 808..832
    salt/modules/azurearm_resource.py on lines 1012..1036

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

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

    def resource_groups_list(**kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        List all resource groups within a subscription.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 11 other locations - About 7 hrs to fix
    salt/modules/azurearm_compute.py on lines 512..537
    salt/modules/azurearm_network.py on lines 637..662
    salt/modules/azurearm_network.py on lines 853..877
    salt/modules/azurearm_network.py on lines 1059..1083
    salt/modules/azurearm_network.py on lines 1573..1597
    salt/modules/azurearm_network.py on lines 1956..1980
    salt/modules/azurearm_network.py on lines 2365..2389
    salt/modules/azurearm_network.py on lines 2724..2748
    salt/modules/azurearm_resource.py on lines 781..805
    salt/modules/azurearm_resource.py on lines 808..832
    salt/modules/azurearm_resource.py on lines 1012..1036

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

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

    def deployment_operation_get(operation, deployment, resource_group, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        Get a deployment operation within a deployment.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 3 other locations - About 5 hrs to fix
    salt/modules/azurearm_network.py on lines 118..152
    salt/modules/azurearm_network.py on lines 447..480
    salt/modules/azurearm_network.py on lines 702..736

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

    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 deployment_get(name, resource_group, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        Get details about a specific deployment.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 8 other locations - About 5 hrs to fix
    salt/modules/azurearm_compute.py on lines 181..211
    salt/modules/azurearm_dns.py on lines 403..433
    salt/modules/azurearm_network.py on lines 572..601
    salt/modules/azurearm_network.py on lines 1027..1056
    salt/modules/azurearm_network.py on lines 1120..1149
    salt/modules/azurearm_network.py on lines 1418..1447
    salt/modules/azurearm_resource.py on lines 643..672
    salt/modules/azurearm_resource.py on lines 946..975

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

    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 deployment_export_template(name, resource_group, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        Exports the template used for the specified deployment.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 8 other locations - About 5 hrs to fix
    salt/modules/azurearm_compute.py on lines 181..211
    salt/modules/azurearm_dns.py on lines 403..433
    salt/modules/azurearm_network.py on lines 572..601
    salt/modules/azurearm_network.py on lines 1027..1056
    salt/modules/azurearm_network.py on lines 1120..1149
    salt/modules/azurearm_network.py on lines 1418..1447
    salt/modules/azurearm_resource.py on lines 473..502
    salt/modules/azurearm_resource.py on lines 946..975

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

    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_get(name, scope, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        Get details about a specific policy assignment.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 8 other locations - About 5 hrs to fix
    salt/modules/azurearm_compute.py on lines 181..211
    salt/modules/azurearm_dns.py on lines 403..433
    salt/modules/azurearm_network.py on lines 572..601
    salt/modules/azurearm_network.py on lines 1027..1056
    salt/modules/azurearm_network.py on lines 1120..1149
    salt/modules/azurearm_network.py on lines 1418..1447
    salt/modules/azurearm_resource.py on lines 473..502
    salt/modules/azurearm_resource.py on lines 643..672

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

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

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

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

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

    Refactorings

    Further Reading

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

            try:
                policy = polconn.policy_assignments.create(
                    scope=scope,
                    policy_assignment_name=name,
                    parameters=policy_model
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 1 other location - About 5 hrs to fix
    salt/modules/azurearm_compute.py on lines 131..143

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

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

    def deployment_delete(name, resource_group, **kwargs):
        '''
        .. versionadded:: 2019.2.0
    
        Delete a deployment.
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 7 other locations - About 5 hrs to fix
    salt/modules/azurearm_network.py on lines 539..569
    salt/modules/azurearm_network.py on lines 994..1024
    salt/modules/azurearm_network.py on lines 1326..1356
    salt/modules/azurearm_network.py on lines 1384..1415
    salt/modules/azurearm_network.py on lines 1831..1861
    salt/modules/azurearm_network.py on lines 2206..2236
    salt/modules/azurearm_network.py on lines 2565..2595

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

    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

        if not subscription_id:
            subscription_id = kwargs.get('subscription_id')
        elif not kwargs.get('subscription_id'):
            kwargs['subscription_id'] = subscription_id
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 1 other location - About 1 hr to fix
    salt/modules/azurearm_resource.py on lines 723..726

    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

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

        if not subscription_id:
            subscription_id = kwargs.get('subscription_id')
        elif not kwargs.get('subscription_id'):
            kwargs['subscription_id'] = subscription_id
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 1 other location - About 1 hr to fix
    salt/modules/azurearm_resource.py on lines 762..765

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

        if deploy_params:
            prop_kwargs['parameters'] = deploy_params
        else:
            if isinstance(parameters_link, dict):
                prop_kwargs['parameters_link'] = parameters_link
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 3 other locations - About 1 hr to fix
    salt/modules/azurearm_resource.py on lines 418..424
    salt/modules/azurearm_resource.py on lines 426..432
    salt/modules/azurearm_resource.py on lines 602..608

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

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

        if deploy_template:
            prop_kwargs['template'] = deploy_template
        else:
            if isinstance(template_link, dict):
                prop_kwargs['template_link'] = template_link
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 3 other locations - About 1 hr to fix
    salt/modules/azurearm_resource.py on lines 418..424
    salt/modules/azurearm_resource.py on lines 426..432
    salt/modules/azurearm_resource.py on lines 594..600

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

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

        if deploy_template:
            prop_kwargs['template'] = deploy_template
        else:
            if isinstance(template_link, dict):
                prop_kwargs['template_link'] = template_link
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 3 other locations - About 1 hr to fix
    salt/modules/azurearm_resource.py on lines 418..424
    salt/modules/azurearm_resource.py on lines 594..600
    salt/modules/azurearm_resource.py on lines 602..608

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

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

        if deploy_params:
            prop_kwargs['parameters'] = deploy_params
        else:
            if isinstance(parameters_link, dict):
                prop_kwargs['parameters_link'] = parameters_link
    Severity: Major
    Found in salt/modules/azurearm_resource.py and 3 other locations - About 1 hr to fix
    salt/modules/azurearm_resource.py on lines 426..432
    salt/modules/azurearm_resource.py on lines 594..600
    salt/modules/azurearm_resource.py on lines 602..608

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

    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

    There are no issues that match your filters.

    Category
    Status