saltstack/salt

View on GitHub
salt/modules/boto_route53.py

Summary

Maintainability
F
1 wk
Test Coverage

File boto_route53.py has 710 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Connection module for Amazon Route53

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

    Function add_record has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

    def add_record(name, value, zone, record_type, identifier=None, ttl=None,
                   region=None, key=None, keyid=None, profile=None,
                   wait_for_sync=True, split_dns=False, private_zone=False,
                   retry_on_rate_limit=None, rate_limit_retries=None,
                   retry_on_errors=True, error_retries=5):
    Severity: Minor
    Found in salt/modules/boto_route53.py - About 5 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 get_record has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_record(name, zone, record_type, fetch_all=False, region=None, key=None,
                   keyid=None, profile=None, split_dns=False, private_zone=False,
                   identifier=None, retry_on_rate_limit=None,
                   rate_limit_retries=None, retry_on_errors=True, error_retries=5):
        '''
    Severity: Minor
    Found in salt/modules/boto_route53.py - About 3 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 describe_hosted_zones has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    def describe_hosted_zones(zone_id=None, domain_name=None, region=None,
                              key=None, keyid=None, profile=None):
        '''
        Return detailed info about one, or all, zones in the bound account.
        If neither zone_id nor domain_name is provided, return all zones.
    Severity: Minor
    Found in salt/modules/boto_route53.py - About 3 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 delete_record has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def delete_record(name, zone, record_type, identifier=None, all_records=False,
                      region=None, key=None, keyid=None, profile=None,
                      wait_for_sync=True, split_dns=False, private_zone=False,
                      retry_on_rate_limit=None, rate_limit_retries=None,
                      retry_on_errors=True, error_retries=5):
    Severity: Minor
    Found in salt/modules/boto_route53.py - About 3 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 update_record has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_record(name, value, zone, record_type, identifier=None, ttl=None,
                      region=None, key=None, keyid=None, profile=None,
                      wait_for_sync=True, split_dns=False, private_zone=False,
                      retry_on_rate_limit=None, rate_limit_retries=None,
                      retry_on_errors=True, error_retries=5):
    Severity: Minor
    Found in salt/modules/boto_route53.py - About 3 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_hosted_zone has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def create_hosted_zone(domain_name, caller_ref=None, comment='', private_zone=False, vpc_id=None,
                           vpc_name=None, vpc_region=None, region=None, key=None, keyid=None,
                           profile=None):
        '''
        Create a new Route53 Hosted Zone. Returns a Python data structure with information about the
    Severity: Minor
    Found in salt/modules/boto_route53.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 zone_exists has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def zone_exists(zone, region=None, key=None, keyid=None, profile=None,
                    retry_on_rate_limit=None, rate_limit_retries=None,
                    retry_on_errors=True, error_retries=5):
        '''
        Check for the existence of a Route53 hosted zone.
    Severity: Minor
    Found in salt/modules/boto_route53.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

    Cyclomatic complexity is too high in function add_record. (21)
    Open

    def add_record(name, value, zone, record_type, identifier=None, ttl=None,
                   region=None, key=None, keyid=None, profile=None,
                   wait_for_sync=True, split_dns=False, private_zone=False,
                   retry_on_rate_limit=None, rate_limit_retries=None,
                   retry_on_errors=True, error_retries=5):
    Severity: Minor
    Found in salt/modules/boto_route53.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

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

    def create_healthcheck(ip_addr=None, fqdn=None, region=None, key=None, keyid=None, profile=None,
                          port=53, hc_type='TCP', resource_path='', string_match=None, request_interval=30,
                          failure_threshold=3, retry_on_errors=True, error_retries=5):
        '''
        Create a Route53 healthcheck
    Severity: Minor
    Found in salt/modules/boto_route53.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 _get_split_zone has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def _get_split_zone(zone, _conn, private_zone):
        '''
        With boto route53, zones can only be matched by name
        or iterated over in a list.  Since the name will be the
        same for public and private zones in a split DNS situation,
    Severity: Minor
    Found in salt/modules/boto_route53.py - About 55 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

    Function _try_func has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def _try_func(conn, func, **args):
        tries = 30
        while True:
            try:
                return getattr(conn, func)(**args)
    Severity: Minor
    Found in salt/modules/boto_route53.py - About 45 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

    Function _wait_for_sync has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def _wait_for_sync(status, conn, wait=True):
        ### Wait should be a bool or an integer
        if wait is True:
            wait = 600
        if not wait:
    Severity: Minor
    Found in salt/modules/boto_route53.py - About 35 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

    Avoid too many return statements within this function.
    Open

        return r
    Severity: Major
    Found in salt/modules/boto_route53.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return None
      Severity: Major
      Found in salt/modules/boto_route53.py - About 30 mins to fix

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

        def create_zone(zone, private=False, vpc_id=None, vpc_region=None, region=None,
                        key=None, keyid=None, profile=None):
            '''
            Create a Route53 hosted zone.
        
        
        Severity: Minor
        Found in salt/modules/boto_route53.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

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

                try:
                    if split_dns:
                        _zone = _get_split_zone(zone, conn, private_zone)
                    else:
                        _zone = conn.get_zone(zone)
        Severity: Major
        Found in salt/modules/boto_route53.py and 5 other locations - About 5 hrs to fix
        salt/modules/boto_route53.py on lines 273..286
        salt/modules/boto_route53.py on lines 588..610
        salt/modules/boto_route53.py on lines 614..631
        salt/modules/boto_route53.py on lines 676..693
        salt/modules/boto_route53.py on lines 737..754

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

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

                try:
                    if split_dns:
                        _zone = _get_split_zone(zone, conn, private_zone)
                    else:
                        _zone = conn.get_zone(zone)
        Severity: Major
        Found in salt/modules/boto_route53.py and 5 other locations - About 5 hrs to fix
        salt/modules/boto_route53.py on lines 273..286
        salt/modules/boto_route53.py on lines 507..535
        salt/modules/boto_route53.py on lines 614..631
        salt/modules/boto_route53.py on lines 676..693
        salt/modules/boto_route53.py on lines 737..754

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

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

                try:
                    old_record = _zone.find_records(name, _type, all=all_records, identifier=identifier)
                    if not old_record:
                        return False
                    status = _zone.delete_record(old_record)
        Severity: Major
        Found in salt/modules/boto_route53.py and 5 other locations - About 5 hrs to fix
        salt/modules/boto_route53.py on lines 273..286
        salt/modules/boto_route53.py on lines 507..535
        salt/modules/boto_route53.py on lines 588..610
        salt/modules/boto_route53.py on lines 614..631
        salt/modules/boto_route53.py on lines 676..693

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

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

                try:
                    # add_record requires a ttl value, annoyingly.
                    if ttl is None:
                        ttl = 60
                    status = _zone.add_record(_type, name, _value, ttl, identifier)
        Severity: Major
        Found in salt/modules/boto_route53.py and 5 other locations - About 5 hrs to fix
        salt/modules/boto_route53.py on lines 273..286
        salt/modules/boto_route53.py on lines 507..535
        salt/modules/boto_route53.py on lines 588..610
        salt/modules/boto_route53.py on lines 676..693
        salt/modules/boto_route53.py on lines 737..754

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

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

                try:
                    old_record = _zone.find_records(name, _type, identifier=identifier)
                    if not old_record:
                        return False
                    status = _zone.update_record(old_record, _value, ttl, identifier)
        Severity: Major
        Found in salt/modules/boto_route53.py and 5 other locations - About 5 hrs to fix
        salt/modules/boto_route53.py on lines 273..286
        salt/modules/boto_route53.py on lines 507..535
        salt/modules/boto_route53.py on lines 588..610
        salt/modules/boto_route53.py on lines 614..631
        salt/modules/boto_route53.py on lines 737..754

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

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

                try:
                    return bool(conn.get_zone(zone))
        
                except DNSServerError as e:
                    if retry_on_errors and _is_retryable_error(e):
        Severity: Major
        Found in salt/modules/boto_route53.py and 5 other locations - About 5 hrs to fix
        salt/modules/boto_route53.py on lines 507..535
        salt/modules/boto_route53.py on lines 588..610
        salt/modules/boto_route53.py on lines 614..631
        salt/modules/boto_route53.py on lines 676..693
        salt/modules/boto_route53.py on lines 737..754

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

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

            if retry_on_rate_limit or rate_limit_retries is not None:
                salt.utils.versions.warn_until(
                    'Neon',
                    'The \'retry_on_rate_limit\' and \'rate_limit_retries\' arguments '
                    'have been deprecated in favor of \'retry_on_errors\' and '
        Severity: Major
        Found in salt/modules/boto_route53.py and 4 other locations - About 2 hrs to fix
        salt/modules/boto_route53.py on lines 259..270
        salt/modules/boto_route53.py on lines 493..504
        salt/modules/boto_route53.py on lines 574..585
        salt/modules/boto_route53.py on lines 661..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 59.

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

            if retry_on_rate_limit or rate_limit_retries is not None:
                salt.utils.versions.warn_until(
                    'Neon',
                    'The \'retry_on_rate_limit\' and \'rate_limit_retries\' arguments '
                    'have been deprecated in favor of \'retry_on_errors\' and '
        Severity: Major
        Found in salt/modules/boto_route53.py and 4 other locations - About 2 hrs to fix
        salt/modules/boto_route53.py on lines 259..270
        salt/modules/boto_route53.py on lines 493..504
        salt/modules/boto_route53.py on lines 661..672
        salt/modules/boto_route53.py on lines 723..734

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

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

            if retry_on_rate_limit or rate_limit_retries is not None:
                salt.utils.versions.warn_until(
                    'Neon',
                    'The \'retry_on_rate_limit\' and \'rate_limit_retries\' arguments '
                    'have been deprecated in favor of \'retry_on_errors\' and '
        Severity: Major
        Found in salt/modules/boto_route53.py and 4 other locations - About 2 hrs to fix
        salt/modules/boto_route53.py on lines 259..270
        salt/modules/boto_route53.py on lines 493..504
        salt/modules/boto_route53.py on lines 574..585
        salt/modules/boto_route53.py on lines 723..734

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

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

            if retry_on_rate_limit or rate_limit_retries is not None:
                salt.utils.versions.warn_until(
                    'Neon',
                    'The \'retry_on_rate_limit\' and \'rate_limit_retries\' arguments '
                    'have been deprecated in favor of \'retry_on_errors\' and '
        Severity: Major
        Found in salt/modules/boto_route53.py and 4 other locations - About 2 hrs to fix
        salt/modules/boto_route53.py on lines 493..504
        salt/modules/boto_route53.py on lines 574..585
        salt/modules/boto_route53.py on lines 661..672
        salt/modules/boto_route53.py on lines 723..734

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

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

            if retry_on_rate_limit or rate_limit_retries is not None:
                salt.utils.versions.warn_until(
                    'Neon',
                    'The \'retry_on_rate_limit\' and \'rate_limit_retries\' arguments '
                    'have been deprecated in favor of \'retry_on_errors\' and '
        Severity: Major
        Found in salt/modules/boto_route53.py and 4 other locations - About 2 hrs to fix
        salt/modules/boto_route53.py on lines 259..270
        salt/modules/boto_route53.py on lines 574..585
        salt/modules/boto_route53.py on lines 661..672
        salt/modules/boto_route53.py on lines 723..734

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

        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:
            #pylint: disable=unused-import
            import boto
            import boto.route53
            import boto.route53.healthcheck
        Severity: Major
        Found in salt/modules/boto_route53.py and 1 other location - About 1 hr to fix
        salt/modules/boto_vpc.py on lines 152..162

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

        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

                if len(vpcs) > 1:
                    log.error('Private zone requested but multiple VPCs matching given '
                              'criteria found: %s.', [v['id'] for v in vpcs])
                    return None
        Severity: Minor
        Found in salt/modules/boto_route53.py and 2 other locations - About 35 mins to fix
        salt/modules/boto3_route53.py on lines 380..385
        salt/states/boto_route53.py on lines 419..424

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

        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 __init__(opts):
            salt.utils.compat.pack_dunder(__name__)
            if HAS_BOTO:
                __utils__['boto.assign_funcs'](__name__, 'route53', pack=__salt__)
        Severity: Minor
        Found in salt/modules/boto_route53.py and 2 other locations - About 35 mins to fix
        salt/modules/boto_iam.py on lines 80..83
        salt/modules/boto_kms.py on lines 74..77

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

        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