saltstack/salt

View on GitHub
salt/modules/keystoneng.py

Summary

Maintainability
F
5 days
Test Coverage

File keystoneng.py has 610 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Keystone module for interacting with OpenStack Keystone

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

    Function compare_changes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def compare_changes(obj, **kwargs):
        '''
        Compare two dicts returning only keys that exist in the first dict and are
        different in the second one
        '''
    Severity: Minor
    Found in salt/modules/keystoneng.py - About 25 mins 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 6 locations. Consider refactoring.
    Open

    def get_operator_cloud(auth=None):
        '''
        Return an operator_cloud
        '''
        if auth is None:
    Severity: Major
    Found in salt/modules/keystoneng.py and 5 other locations - About 5 hrs to fix
    salt/modules/glanceng.py on lines 82..92
    salt/modules/glanceng.py on lines 95..105
    salt/modules/keystoneng.py on lines 118..128
    salt/modules/neutronng.py on lines 83..93
    salt/modules/neutronng.py on lines 96..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 100.

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

    def get_openstack_cloud(auth=None):
        '''
        Return an openstack_cloud
        '''
        if auth is None:
    Severity: Major
    Found in salt/modules/keystoneng.py and 5 other locations - About 5 hrs to fix
    salt/modules/glanceng.py on lines 82..92
    salt/modules/glanceng.py on lines 95..105
    salt/modules/keystoneng.py on lines 105..115
    salt/modules/neutronng.py on lines 83..93
    salt/modules/neutronng.py on lines 96..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 100.

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

    def compare_changes(obj, **kwargs):
        '''
        Compare two dicts returning only keys that exist in the first dict and are
        different in the second one
        '''
    Severity: Major
    Found in salt/modules/keystoneng.py and 2 other locations - About 3 hrs to fix
    salt/modules/glanceng.py on lines 50..60
    salt/modules/neutronng.py on lines 51..61

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

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

    def _clean_kwargs(keep_name=False, **kwargs):
        '''
        Sanatize the the arguments for use with shade
        '''
        if 'name' in kwargs and not keep_name:
    Severity: Major
    Found in salt/modules/keystoneng.py and 2 other locations - About 2 hrs to fix
    salt/modules/glanceng.py on lines 63..70
    salt/modules/neutronng.py on lines 64..71

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

    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 user_update(auth=None, **kwargs):
        '''
        Update a user
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 4 other locations - About 2 hrs to fix
    salt/modules/keystoneng.py on lines 164..180
    salt/modules/keystoneng.py on lines 266..281
    salt/modules/keystoneng.py on lines 365..380
    salt/modules/keystoneng.py on lines 462..477

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

    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 group_update(auth=None, **kwargs):
        '''
        Update a group
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 4 other locations - About 2 hrs to fix
    salt/modules/keystoneng.py on lines 266..281
    salt/modules/keystoneng.py on lines 365..380
    salt/modules/keystoneng.py on lines 462..477
    salt/modules/keystoneng.py on lines 564..579

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

    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 domain_update(auth=None, **kwargs):
        '''
        Update a domain
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 4 other locations - About 2 hrs to fix
    salt/modules/keystoneng.py on lines 164..180
    salt/modules/keystoneng.py on lines 266..281
    salt/modules/keystoneng.py on lines 462..477
    salt/modules/keystoneng.py on lines 564..579

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

    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 project_update(auth=None, **kwargs):
        '''
        Update a project
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 4 other locations - About 2 hrs to fix
    salt/modules/keystoneng.py on lines 164..180
    salt/modules/keystoneng.py on lines 365..380
    salt/modules/keystoneng.py on lines 462..477
    salt/modules/keystoneng.py on lines 564..579

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

    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 role_update(auth=None, **kwargs):
        '''
        Update a role
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 4 other locations - About 2 hrs to fix
    salt/modules/keystoneng.py on lines 164..180
    salt/modules/keystoneng.py on lines 266..281
    salt/modules/keystoneng.py on lines 365..380
    salt/modules/keystoneng.py on lines 564..579

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

    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 domain_create(auth=None, **kwargs):
        '''
        Create a domain
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 9 other locations - About 40 mins to fix
    salt/modules/glanceng.py on lines 108..121
    salt/modules/keystoneng.py on lines 131..144
    salt/modules/keystoneng.py on lines 232..246
    salt/modules/keystoneng.py on lines 430..443
    salt/modules/keystoneng.py on lines 530..544
    salt/modules/keystoneng.py on lines 631..645
    salt/modules/keystoneng.py on lines 726..739
    salt/modules/neutronng.py on lines 109..147
    salt/modules/neutronng.py on lines 392..412

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

    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 project_create(auth=None, **kwargs):
        '''
        Create a project
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 9 other locations - About 40 mins to fix
    salt/modules/glanceng.py on lines 108..121
    salt/modules/keystoneng.py on lines 131..144
    salt/modules/keystoneng.py on lines 334..346
    salt/modules/keystoneng.py on lines 430..443
    salt/modules/keystoneng.py on lines 530..544
    salt/modules/keystoneng.py on lines 631..645
    salt/modules/keystoneng.py on lines 726..739
    salt/modules/neutronng.py on lines 109..147
    salt/modules/neutronng.py on lines 392..412

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

    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 service_create(auth=None, **kwargs):
        '''
        Create a service
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 9 other locations - About 40 mins to fix
    salt/modules/glanceng.py on lines 108..121
    salt/modules/keystoneng.py on lines 131..144
    salt/modules/keystoneng.py on lines 232..246
    salt/modules/keystoneng.py on lines 334..346
    salt/modules/keystoneng.py on lines 430..443
    salt/modules/keystoneng.py on lines 530..544
    salt/modules/keystoneng.py on lines 631..645
    salt/modules/neutronng.py on lines 109..147
    salt/modules/neutronng.py on lines 392..412

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

    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 group_create(auth=None, **kwargs):
        '''
        Create a group
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 9 other locations - About 40 mins to fix
    salt/modules/glanceng.py on lines 108..121
    salt/modules/keystoneng.py on lines 232..246
    salt/modules/keystoneng.py on lines 334..346
    salt/modules/keystoneng.py on lines 430..443
    salt/modules/keystoneng.py on lines 530..544
    salt/modules/keystoneng.py on lines 631..645
    salt/modules/keystoneng.py on lines 726..739
    salt/modules/neutronng.py on lines 109..147
    salt/modules/neutronng.py on lines 392..412

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

    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 role_create(auth=None, **kwargs):
        '''
        Create a role
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 9 other locations - About 40 mins to fix
    salt/modules/glanceng.py on lines 108..121
    salt/modules/keystoneng.py on lines 131..144
    salt/modules/keystoneng.py on lines 232..246
    salt/modules/keystoneng.py on lines 334..346
    salt/modules/keystoneng.py on lines 530..544
    salt/modules/keystoneng.py on lines 631..645
    salt/modules/keystoneng.py on lines 726..739
    salt/modules/neutronng.py on lines 109..147
    salt/modules/neutronng.py on lines 392..412

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

    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 endpoint_create(auth=None, **kwargs):
        '''
        Create an endpoint
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 9 other locations - About 40 mins to fix
    salt/modules/glanceng.py on lines 108..121
    salt/modules/keystoneng.py on lines 131..144
    salt/modules/keystoneng.py on lines 232..246
    salt/modules/keystoneng.py on lines 334..346
    salt/modules/keystoneng.py on lines 430..443
    salt/modules/keystoneng.py on lines 530..544
    salt/modules/keystoneng.py on lines 726..739
    salt/modules/neutronng.py on lines 109..147
    salt/modules/neutronng.py on lines 392..412

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

    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 user_create(auth=None, **kwargs):
        '''
        Create a user
    
        CLI Example:
    Severity: Major
    Found in salt/modules/keystoneng.py and 9 other locations - About 40 mins to fix
    salt/modules/glanceng.py on lines 108..121
    salt/modules/keystoneng.py on lines 131..144
    salt/modules/keystoneng.py on lines 232..246
    salt/modules/keystoneng.py on lines 334..346
    salt/modules/keystoneng.py on lines 430..443
    salt/modules/keystoneng.py on lines 631..645
    salt/modules/keystoneng.py on lines 726..739
    salt/modules/neutronng.py on lines 109..147
    salt/modules/neutronng.py on lines 392..412

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

    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