saltstack/salt

View on GitHub
salt/modules/boto3_elasticache.py

Summary

Maintainability
F
3 wks
Test Coverage

File boto3_elasticache.py has 821 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Execution module for Amazon Elasticache using boto3
===================================================

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

    Function create_cache_subnet_group has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def create_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Create an ElastiCache subnet group
    
        Example:
    Severity: Minor
    Found in salt/modules/boto3_elasticache.py - About 2 hrs 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 _create_resource has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def _create_resource(name, name_param=None, desc=None, res_type=None, wait=0, status_param=None,
                         status_good='available', region=None, key=None, keyid=None, profile=None,
                         **args):
        try:
            wait = int(wait)
    Severity: Minor
    Found in salt/modules/boto3_elasticache.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 _delete_resource has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def _delete_resource(name, name_param, desc, res_type, wait=0, status_param=None,
                         status_gone='deleted', region=None, key=None, keyid=None, profile=None,
                         **args):
        '''
        Delete a generic Elasticache resource.
    Severity: Minor
    Found in salt/modules/boto3_elasticache.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 modify_cache_subnet_group has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def modify_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Modify an ElastiCache subnet group
    
        Example:
    Severity: Minor
    Found in salt/modules/boto3_elasticache.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 _modify_resource has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def _modify_resource(name, name_param=None, desc=None, res_type=None, wait=0, status_param=None,
                         status_good='available', region=None, key=None, keyid=None, profile=None,
                         **args):
        try:
            wait = int(wait)
    Severity: Minor
    Found in salt/modules/boto3_elasticache.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 _modify_resource(name, name_param=None, desc=None, res_type=None, wait=0, status_param=None,
                         status_good='available', region=None, key=None, keyid=None, profile=None,
                         **args):
        try:
            wait = int(wait)
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 1 other location - About 4 days to fix
    salt/modules/boto3_elasticache.py on lines 178..228

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

    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 _create_resource(name, name_param=None, desc=None, res_type=None, wait=0, status_param=None,
                         status_good='available', region=None, key=None, keyid=None, profile=None,
                         **args):
        try:
            wait = int(wait)
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 1 other location - About 4 days to fix
    salt/modules/boto3_elasticache.py on lines 231..281

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

    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 create_replication_group(name, wait=600, security_groups=None, region=None, key=None, keyid=None,
                                 profile=None, **args):
        '''
        Create a replication group.
        Params are extensive and variable - see
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 day to fix
    salt/modules/boto3_elasticache.py on lines 314..339
    salt/modules/boto3_elasticache.py on lines 344..374
    salt/modules/boto3_elasticache.py on lines 455..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 185.

    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 modify_replication_group(name, wait=600, security_groups=None, region=None, key=None, keyid=None,
                                 profile=None, **args):
        '''
        Modify a replication group.
    
    
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 day to fix
    salt/modules/boto3_elasticache.py on lines 314..339
    salt/modules/boto3_elasticache.py on lines 344..374
    salt/modules/boto3_elasticache.py on lines 425..450

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

    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 create_cache_cluster(name, wait=600, security_groups=None,
                             region=None, key=None, keyid=None, profile=None, **args):
        '''
        Create a cache cluster.
    
    
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 day to fix
    salt/modules/boto3_elasticache.py on lines 344..374
    salt/modules/boto3_elasticache.py on lines 425..450
    salt/modules/boto3_elasticache.py on lines 455..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 185.

    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 modify_cache_cluster(name, wait=600, security_groups=None, region=None,
                             key=None, keyid=None, profile=None, **args):
        '''
        Update a cache cluster in place.
    
    
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 day to fix
    salt/modules/boto3_elasticache.py on lines 314..339
    salt/modules/boto3_elasticache.py on lines 425..450
    salt/modules/boto3_elasticache.py on lines 455..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 185.

    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 remove_tags_from_resource(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Remove tags from an Elasticache resource.
    
        Note that this function is essentially useless as it requires a full AWS ARN for the
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 day to fix
    salt/modules/boto3_elasticache.py on lines 690..721
    salt/modules/boto3_elasticache.py on lines 724..756
    salt/modules/boto3_elasticache.py on lines 797..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 183.

    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 revoke_cache_security_group_ingress(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Revoke network ingress from an ec2 security group to a cache security
        group.
    
    
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 day to fix
    salt/modules/boto3_elasticache.py on lines 690..721
    salt/modules/boto3_elasticache.py on lines 797..832
    salt/modules/boto3_elasticache.py on lines 835..870

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

    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 authorize_cache_security_group_ingress(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Authorize network ingress from an ec2 security group to a cache security group.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 day to fix
    salt/modules/boto3_elasticache.py on lines 724..756
    salt/modules/boto3_elasticache.py on lines 797..832
    salt/modules/boto3_elasticache.py on lines 835..870

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

    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 add_tags_to_resource(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Add tags to an Elasticache resource.
    
        Note that this function is essentially useless as it requires a full AWS ARN for the
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 day to fix
    salt/modules/boto3_elasticache.py on lines 690..721
    salt/modules/boto3_elasticache.py on lines 724..756
    salt/modules/boto3_elasticache.py on lines 835..870

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

    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 delete_cache_cluster(name, wait=600, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Delete a cache cluster.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 1 other location - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 482..492

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

    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 delete_replication_group(name, wait=600, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Delete an ElastiCache replication group, optionally taking a snapshot first.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 1 other location - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 379..389

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

    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 describe_replication_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None):
        '''
        Return details about all (or just one) Elasticache replication groups.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 497..507
    salt/modules/boto3_elasticache.py on lines 630..641
    salt/modules/boto3_elasticache.py on lines 903..915

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

    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 describe_cache_parameter_groups(name=None, conn=None, region=None, key=None, keyid=None,
                                        profile=None):
        '''
        Return details about all (or just one) Elasticache cache clusters.
    
    
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 395..406
    salt/modules/boto3_elasticache.py on lines 497..507
    salt/modules/boto3_elasticache.py on lines 630..641

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

    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 describe_cache_subnet_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None):
        '''
        Return details about all (or just one) Elasticache replication groups.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 395..406
    salt/modules/boto3_elasticache.py on lines 630..641
    salt/modules/boto3_elasticache.py on lines 903..915

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

    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 describe_cache_security_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None):
        '''
        Return details about all (or just one) Elasticache cache clusters.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 3 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 395..406
    salt/modules/boto3_elasticache.py on lines 497..507
    salt/modules/boto3_elasticache.py on lines 903..915

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

    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 create_cache_parameter_group(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Create a cache parameter group.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 4 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 615..625
    salt/modules/boto3_elasticache.py on lines 660..670
    salt/modules/boto3_elasticache.py on lines 675..685
    salt/modules/boto3_elasticache.py on lines 1031..1041

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

    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 delete_cache_subnet_group(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Delete an ElastiCache subnet group.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 4 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 660..670
    salt/modules/boto3_elasticache.py on lines 675..685
    salt/modules/boto3_elasticache.py on lines 959..972
    salt/modules/boto3_elasticache.py on lines 1031..1041

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

    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 create_cache_security_group(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Create a cache security group.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 4 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 615..625
    salt/modules/boto3_elasticache.py on lines 675..685
    salt/modules/boto3_elasticache.py on lines 959..972
    salt/modules/boto3_elasticache.py on lines 1031..1041

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

    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 delete_cache_security_group(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Delete a cache security group.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 4 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 615..625
    salt/modules/boto3_elasticache.py on lines 660..670
    salt/modules/boto3_elasticache.py on lines 959..972
    salt/modules/boto3_elasticache.py on lines 1031..1041

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

    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 delete_cache_parameter_group(name, region=None, key=None, keyid=None, profile=None, **args):
        '''
        Delete a cache parameter group.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 4 other locations - About 1 hr to fix
    salt/modules/boto3_elasticache.py on lines 615..625
    salt/modules/boto3_elasticache.py on lines 660..670
    salt/modules/boto3_elasticache.py on lines 675..685
    salt/modules/boto3_elasticache.py on lines 959..972

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

    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 cache_security_group_exists(name, region=None, key=None, keyid=None, profile=None):
        '''
        Check to see if an ElastiCache security group exists.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 2 other locations - About 45 mins to fix
    salt/modules/boto3_elasticache.py on lines 411..421
    salt/modules/boto3_elasticache.py on lines 512..522

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

    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 replication_group_exists(name, region=None, key=None, keyid=None, profile=None):
        '''
        Check to see if a replication group exists.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 2 other locations - About 45 mins to fix
    salt/modules/boto3_elasticache.py on lines 512..522
    salt/modules/boto3_elasticache.py on lines 646..656

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

    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 cache_subnet_group_exists(name, region=None, key=None, keyid=None, profile=None):
        '''
        Check to see if an ElastiCache subnet group exists.
    
        Example:
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 2 other locations - About 45 mins to fix
    salt/modules/boto3_elasticache.py on lines 411..421
    salt/modules/boto3_elasticache.py on lines 646..656

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

    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

    try:
        #pylint: disable=unused-import
        import botocore
        import boto3
        #pylint: enable=unused-import
    Severity: Major
    Found in salt/modules/boto3_elasticache.py and 7 other locations - About 30 mins to fix
    salt/modules/boto_cloudfront.py on lines 64..72
    salt/modules/boto_kinesis.py on lines 61..67
    salt/modules/boto_s3.py on lines 63..71
    salt/modules/boto_secgroup.py on lines 61..69
    salt/modules/boto_sns.py on lines 55..63
    salt/modules/boto_sqs.py on lines 67..75
    salt/utils/botomod.py on lines 52..60

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

    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