saltstack/salt

View on GitHub
salt/states/boto_elb.py

Summary

Maintainability
F
1 mo
Test Coverage

File boto_elb.py has 1174 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Manage ELBs

.. versionadded:: 2014.7.0
Severity: Major
Found in salt/states/boto_elb.py - About 3 days to fix

    Function _tags_present has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
    Open

    def _tags_present(name, tags, region, key, keyid, profile):
        '''
        helper function to validate tags on elb
        '''
        ret = {'result': True, 'comment': '', 'changes': {}}
    Severity: Minor
    Found in salt/states/boto_elb.py - About 2 days 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 _policies_present has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

    def _policies_present(name, policies, policies_from_pillar, listeners, backends,
                          region, key, keyid, profile):
        '''helper method for present. ensure that ELB policies are set'''
        if policies is None:
            policies = []
    Severity: Minor
    Found in salt/states/boto_elb.py - About 1 day 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 present has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
    Open

    def present(name, listeners, availability_zones=None, subnets=None,
                subnet_names=None, security_groups=None, scheme='internet-facing',
                health_check=None, attributes=None,
                attributes_from_pillar="boto_elb_attributes", cnames=None,
                alarms=None, alarms_from_pillar="boto_elb_alarms", policies=None,
    Severity: Minor
    Found in salt/states/boto_elb.py - About 1 day 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 _elb_present has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
    Open

    def _elb_present(name, availability_zones, listeners, subnets, subnet_names,
                     security_groups, scheme, region, key, keyid, profile):
        ret = {'result': True, 'comment': '', 'changes': {}}
        if not salt.utils.data.exactly_one((availability_zones, subnets, subnet_names)):
            raise SaltInvocationError('Exactly one of availability_zones, subnets, '
    Severity: Minor
    Found in salt/states/boto_elb.py - About 1 day 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 _policies_present. (54)
    Open

    def _policies_present(name, policies, policies_from_pillar, listeners, backends,
                          region, key, keyid, profile):
        '''helper method for present. ensure that ELB policies are set'''
        if policies is None:
            policies = []
    Severity: Minor
    Found in salt/states/boto_elb.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 _listeners_present has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    def _listeners_present(name, listeners, region, key, keyid, profile):
        ret = {'result': True, 'comment': '', 'changes': {}}
        lb = __salt__['boto_elb.get_elb_config'](name, region, key, keyid, profile)
        if not lb:
            ret['comment'] = '{0} ELB configuration could not be retrieved.'.format(name)
    Severity: Minor
    Found in salt/states/boto_elb.py - About 4 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 _attributes_present has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    def _attributes_present(name, attributes, region, key, keyid, profile):
        ret = {'result': True, 'comment': '', 'changes': {}}
        _attributes = __salt__['boto_elb.get_attributes'](name, region, key, keyid,
                                                          profile)
        if not _attributes:
    Severity: Minor
    Found in salt/states/boto_elb.py - About 4 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 present. (35)
    Open

    def present(name, listeners, availability_zones=None, subnets=None,
                subnet_names=None, security_groups=None, scheme='internet-facing',
                health_check=None, attributes=None,
                attributes_from_pillar="boto_elb_attributes", cnames=None,
                alarms=None, alarms_from_pillar="boto_elb_alarms", policies=None,
    Severity: Minor
    Found in salt/states/boto_elb.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

    Cyclomatic complexity is too high in function _elb_present. (32)
    Open

    def _elb_present(name, availability_zones, listeners, subnets, subnet_names,
                     security_groups, scheme, region, key, keyid, profile):
        ret = {'result': True, 'comment': '', 'changes': {}}
        if not salt.utils.data.exactly_one((availability_zones, subnets, subnet_names)):
            raise SaltInvocationError('Exactly one of availability_zones, subnets, '
    Severity: Minor
    Found in salt/states/boto_elb.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 _subnets_present has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def _subnets_present(name, subnets, region, key, keyid, profile):
        ret = {'result': True, 'comment': '', 'changes': {}}
        if not subnets:
            subnets = []
        lb = __salt__['boto_elb.get_elb_config'](name, region, key, keyid, profile)
    Severity: Minor
    Found in salt/states/boto_elb.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

    Cyclomatic complexity is too high in function _tags_present. (30)
    Open

    def _tags_present(name, tags, region, key, keyid, profile):
        '''
        helper function to validate tags on elb
        '''
        ret = {'result': True, 'comment': '', 'changes': {}}
    Severity: Minor
    Found in salt/states/boto_elb.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 _zones_present has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def _zones_present(name, availability_zones, region, key, keyid, profile):
        ret = {'result': True, 'comment': '', 'changes': {}}
        lb = __salt__['boto_elb.get_elb_config'](name, region, key, keyid, profile)
        if not lb:
            ret['result'] = False
    Severity: Minor
    Found in salt/states/boto_elb.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

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

    def _listeners_present(name, listeners, region, key, keyid, profile):
        ret = {'result': True, 'comment': '', 'changes': {}}
        lb = __salt__['boto_elb.get_elb_config'](name, region, key, keyid, profile)
        if not lb:
            ret['comment'] = '{0} ELB configuration could not be retrieved.'.format(name)
    Severity: Minor
    Found in salt/states/boto_elb.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 _policies_present has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def _policies_present(name, policies, policies_from_pillar, listeners, backends,
                          region, key, keyid, profile):
        '''helper method for present. ensure that ELB policies are set'''
        if policies is None:
            policies = []
    Severity: Minor
    Found in salt/states/boto_elb.py - About 1 hr to fix

      Function _health_check_present has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      def _health_check_present(name, health_check, region, key, keyid, profile):
          ret = {'result': True, 'comment': '', 'changes': {}}
          if not health_check:
              health_check = {}
          _health_check = __salt__['boto_elb.get_health_check'](name, region, key,
      Severity: Minor
      Found in salt/states/boto_elb.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 present has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def present(name, listeners, availability_zones=None, subnets=None,
                  subnet_names=None, security_groups=None, scheme='internet-facing',
                  health_check=None, attributes=None,
                  attributes_from_pillar="boto_elb_attributes", cnames=None,
                  alarms=None, alarms_from_pillar="boto_elb_alarms", policies=None,
      Severity: Minor
      Found in salt/states/boto_elb.py - About 1 hr to fix

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

        def _security_groups_present(name, security_groups, region, key, keyid, profile):
            ret = {'result': True, 'comment': '', 'changes': {}}
            lb = __salt__['boto_elb.get_elb_config'](name, region, key, keyid, profile)
            if not lb:
                ret['comment'] = '{0} ELB configuration could not be retrieved.'.format(name)
        Severity: Minor
        Found in salt/states/boto_elb.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

        Avoid deeply nested control flow statements.
        Open

                            for p in ('profile', 'key', 'keyid', 'region', 'wait_for_sync'):
                                cname[p] = locals().get(p) if p not in cname else cname[p]
                        _ret = __states__['boto_route53.present'](**cname)
        Severity: Major
        Found in salt/states/boto_elb.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if 'tags' in lb:
                                  if lb['tags']:
                                      if tag in lb['tags']:
                                          ret['changes']['old']['tags'][tag] = lb['tags'][tag]
                  if not tags_to_update and not tags_to_remove and not tags_to_add:
          Severity: Major
          Found in salt/states/boto_elb.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if _tag not in tags_to_remove:
                                    tags_to_remove.append(_tag)
                            else:
            Severity: Major
            Found in salt/states/boto_elb.py - About 45 mins to fix

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

              def _alarms_present(name, alarms, alarms_from_pillar, region, key, keyid, profile):
                  '''helper method for present.  ensure that cloudwatch_alarms are set'''
                  current = __salt__['config.option'](alarms_from_pillar, {})
                  if alarms:
                      current = salt.utils.dictupdate.update(current, alarms)
              Severity: Minor
              Found in salt/states/boto_elb.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

              Avoid deeply nested control flow statements.
              Open

                                  if tags[_tag] != lb['tags'][_tag]:
                                      tags_to_update[_tag] = tags[_tag]
                                  tags_to_add.pop(_tag)
              Severity: Major
              Found in salt/states/boto_elb.py - About 45 mins to fix

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

                def absent(name, region=None, key=None, keyid=None, profile=None):
                    '''
                    Ensure an ELB does not exist
                
                    name
                Severity: Minor
                Found in salt/states/boto_elb.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 ret
                Severity: Major
                Found in salt/states/boto_elb.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return ret
                  Severity: Major
                  Found in salt/states/boto_elb.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return ret
                    Severity: Major
                    Found in salt/states/boto_elb.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return ret
                      Severity: Major
                      Found in salt/states/boto_elb.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                            return ret
                        Severity: Major
                        Found in salt/states/boto_elb.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return ret
                          Severity: Major
                          Found in salt/states/boto_elb.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return ret
                            Severity: Major
                            Found in salt/states/boto_elb.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                              return ret
                              Severity: Major
                              Found in salt/states/boto_elb.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return ret
                                Severity: Major
                                Found in salt/states/boto_elb.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return ret
                                  Severity: Major
                                  Found in salt/states/boto_elb.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                return ret
                                    Severity: Major
                                    Found in salt/states/boto_elb.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return ret
                                      Severity: Major
                                      Found in salt/states/boto_elb.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return ret
                                        Severity: Major
                                        Found in salt/states/boto_elb.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                              return ret
                                          Severity: Major
                                          Found in salt/states/boto_elb.py - About 30 mins to fix

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

                                                for port in backends_to_update:
                                                    policy_set = __salt__['boto_elb.set_backend_policy'](
                                                            name=name,
                                                            port=port,
                                                            policies=list(expected_policies_by_backend.get(port, [])),
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 day to fix
                                            salt/states/boto_elb.py on lines 1183..1204

                                            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

                                                for port in listeners_to_update:
                                                    policy_set = __salt__['boto_elb.set_listener_policy'](
                                                            name=name,
                                                            port=port,
                                                            policies=list(expected_policies_by_listener.get(port, [])),
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 day to fix
                                            salt/states/boto_elb.py on lines 1206..1227

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

                                                if attrs_to_set:
                                                    if __opts__['test']:
                                                        ret['comment'] = 'ELB {0} set to have attributes set.'.format(name)
                                                        ret['result'] = None
                                                        return ret
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 2 other locations - About 1 day to fix
                                            salt/states/boto_iam_role.py on lines 336..351
                                            salt/states/boto_iam_role.py on lines 722..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 154.

                                            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

                                                if subnet_names:
                                                    subnets = []
                                                    for i in subnet_names:
                                                        r = __salt__['boto_vpc.get_resource_id']('subnet', name=i, region=region,
                                                                                                 key=key, keyid=keyid, profile=profile)
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 day to fix
                                            salt/states/boto_asg.py on lines 442..455

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

                                            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

                                                            for tag in all_tag_changes:
                                                                ret['changes']['new']['tags'][tag] = tags[tag]
                                                                if 'tags' in lb:
                                                                    if lb['tags']:
                                                                        if tag in lb['tags']:
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 7 hrs to fix
                                            salt/states/boto_secgroup.py on lines 753..758

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 118.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                    if to_disable:
                                                        disabled = __salt__['boto_elb.disable_availability_zones'](
                                                                name, to_disable, region, key, keyid, profile)
                                                        if disabled:
                                                            msg = 'Disabled availability zones on {0} ELB.'
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 6 hrs to fix
                                            salt/states/boto_elb.py on lines 734..744

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

                                            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

                                                if to_create:
                                                    created = __salt__['boto_elb.create_listeners'](name, to_create,
                                                                                                    region, key, keyid,
                                                                                                    profile)
                                                    if created:
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 6 hrs to fix
                                            salt/states/boto_elb.py on lines 910..919

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

                                            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

                                                        if created:
                                                            ret['changes'].setdefault(policy_name, {})['new'] = policy_name
                                                            comment = "Policy {0} was created on ELB {1}".format(
                                                                    policy_name, name)
                                                            ret['comment'] = '  '.join([ret['comment'], comment])
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 4 hrs to fix
                                            salt/states/boto_elb.py on lines 1238..1246

                                            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

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

                                                        if deleted:
                                                            ret['changes'].setdefault(policy_name, {})['old'] = policy_name
                                                            comment = "Policy {0} was deleted from ELB {1}".format(
                                                                    policy_name, name)
                                                            ret['comment'] = '  '.join([ret['comment'], comment])
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 4 hrs to fix
                                            salt/states/boto_elb.py on lines 1173..1181

                                            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

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

                                                            if tags_to_add:
                                                                msg = 'The following tag{0} set to be added: {1}.'.format(
                                                                        ('s are' if len(tags_to_add.keys()) > 1 else ' is'),
                                                                        ', '.join(tags_to_add.keys()))
                                                                ret['comment'] = ' '. join([ret['comment'], msg])
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 2 other locations - About 4 hrs to fix
                                            salt/states/boto_secgroup.py on lines 721..726
                                            salt/states/boto_secgroup.py on lines 727..732

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

                                            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

                                                    if to_enable:
                                                        attached = __salt__['boto_elb.attach_subnets'](name, to_enable,
                                                                                                       region, key, keyid,
                                                                                                       profile)
                                                        if attached:
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 3 hrs to fix
                                            salt/states/boto_elb.py on lines 902..909

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

                                            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

                                                    if to_enable:
                                                        enabled = __salt__['boto_elb.enable_availability_zones'](
                                                                name, to_enable, region, key, keyid, profile)
                                                        if enabled:
                                                            ret['comment'] = 'Enabled availability zones on {0} ELB.'.format(name)
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 3 hrs to fix
                                            salt/states/boto_elb.py on lines 954..962

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

                                            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

                                                        if __opts__['test']:
                                                            msg = 'The following tag{0} set to be removed: {1}.'.format(
                                                                    ('s are' if len(tags_to_remove) > 1 else ' is'), ', '.join(tags_to_remove))
                                                            ret['comment'] = '  '.join([ret['comment'], msg])
                                                            ret['result'] = None
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 3 hrs to fix
                                            salt/states/boto_secgroup.py on lines 693..697

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

                                            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

                                                ret.update({'changes': salt.utils.dictupdate.update(ret['changes'], _ret['changes']),
                                                            'comment': '  '.join([ret['comment'], _ret['comment']])})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 5 other locations - About 2 hrs to fix
                                            salt/states/boto_elb.py on lines 406..407
                                            salt/states/boto_elb.py on lines 414..415
                                            salt/states/boto_elb.py on lines 434..435
                                            salt/states/boto_elb.py on lines 441..442
                                            salt/states/boto_elb.py on lines 456..457

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

                                                ret.update({'changes': salt.utils.dictupdate.update(ret['changes'], _ret['changes']),
                                                            'comment': '  '.join([ret['comment'], _ret['comment']])})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 5 other locations - About 2 hrs to fix
                                            salt/states/boto_elb.py on lines 406..407
                                            salt/states/boto_elb.py on lines 414..415
                                            salt/states/boto_elb.py on lines 434..435
                                            salt/states/boto_elb.py on lines 449..450
                                            salt/states/boto_elb.py on lines 456..457

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

                                                    ret.update({'changes': salt.utils.dictupdate.update(ret['changes'], _ret['changes']),
                                                                'comment': '  '.join([ret['comment'], _ret['comment']])})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 5 other locations - About 2 hrs to fix
                                            salt/states/boto_elb.py on lines 414..415
                                            salt/states/boto_elb.py on lines 434..435
                                            salt/states/boto_elb.py on lines 441..442
                                            salt/states/boto_elb.py on lines 449..450
                                            salt/states/boto_elb.py on lines 456..457

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

                                                            ret.update({'changes': salt.utils.dictupdate.update(ret['changes'], _ret['changes']),
                                                                        'comment': '  '.join([ret['comment'], _ret['comment']])})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 5 other locations - About 2 hrs to fix
                                            salt/states/boto_elb.py on lines 406..407
                                            salt/states/boto_elb.py on lines 414..415
                                            salt/states/boto_elb.py on lines 441..442
                                            salt/states/boto_elb.py on lines 449..450
                                            salt/states/boto_elb.py on lines 456..457

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

                                                ret.update({'changes': salt.utils.dictupdate.update(ret['changes'], _ret['changes']),
                                                            'comment': '  '.join([ret['comment'], _ret['comment']])})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 5 other locations - About 2 hrs to fix
                                            salt/states/boto_elb.py on lines 406..407
                                            salt/states/boto_elb.py on lines 414..415
                                            salt/states/boto_elb.py on lines 434..435
                                            salt/states/boto_elb.py on lines 441..442
                                            salt/states/boto_elb.py on lines 449..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 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 6 locations. Consider refactoring.
                                            Open

                                                ret.update({'changes': salt.utils.dictupdate.update(ret['changes'], _ret['changes']),
                                                            'comment': '  '.join([ret['comment'], _ret['comment']])})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 5 other locations - About 2 hrs to fix
                                            salt/states/boto_elb.py on lines 406..407
                                            salt/states/boto_elb.py on lines 434..435
                                            salt/states/boto_elb.py on lines 441..442
                                            salt/states/boto_elb.py on lines 449..450
                                            salt/states/boto_elb.py on lines 456..457

                                            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

                                                if 'connecting_settings' in attributes:
                                                    cs = attributes['connecting_settings']
                                                    _cs = _attributes['connecting_settings']
                                                    if cs['idle_timeout'] != _cs['idle_timeout']:
                                                        attrs_to_set.append('connecting_settings')
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 2 hrs to fix
                                            salt/states/boto_elb.py on lines 799..803

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

                                            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

                                                if 'cross_zone_load_balancing' in attributes:
                                                    czlb = attributes['cross_zone_load_balancing']
                                                    _czlb = _attributes['cross_zone_load_balancing']
                                                    if czlb['enabled'] != _czlb['enabled']:
                                                        attrs_to_set.append('cross_zone_load_balancing')
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 2 hrs to fix
                                            salt/states/boto_elb.py on lines 810..814

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

                                            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

                                                            if _tag not in tags.keys():
                                                                if _tag not in tags_to_remove:
                                                                    tags_to_remove.append(_tag)
                                                            else:
                                                                if tags[_tag] != lb['tags'][_tag]:
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 hr to fix
                                            salt/states/boto_secgroup.py on lines 685..691

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

                                            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

                                                            if not _ret:
                                                                ret['result'] = False
                                                                msg = 'Error attempting to set tags.'
                                                                ret['comment'] = '  '.join([ret['comment'], msg])
                                                                return ret
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 hr to fix
                                            salt/states/boto_secgroup.py on lines 744..748

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

                                            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 'old' not in ret['changes']:
                                                                ret['changes'] = salt.utils.dictupdate.update(ret['changes'], {'old': {'tags': {}}})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 2 other locations - About 1 hr to fix
                                            salt/states/boto_elb.py on lines 1351..1352
                                            salt/states/boto_elb.py on lines 1353..1354

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 52.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                            if 'new' not in ret['changes']:
                                                                ret['changes'] = salt.utils.dictupdate.update(ret['changes'], {'new': {'tags': {}}})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 2 other locations - About 1 hr to fix
                                            salt/states/boto_elb.py on lines 1325..1326
                                            salt/states/boto_elb.py on lines 1351..1352

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 52.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                            if 'old' not in ret['changes']:
                                                                ret['changes'] = salt.utils.dictupdate.update(ret['changes'], {'old': {'tags': {}}})
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 2 other locations - About 1 hr to fix
                                            salt/states/boto_elb.py on lines 1325..1326
                                            salt/states/boto_elb.py on lines 1353..1354

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 52.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                for b in backends:
                                                    for p in b.get('policies', []):
                                                        if p not in policy_names:
                                                            raise SaltInvocationError('Backend {0} on ELB {1} refers to '
                                                                    'undefined policy '
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 hr to fix
                                            salt/states/boto_elb.py on lines 1045..1049

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

                                            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

                                                for l in listeners:
                                                    for p in l.get('policies', []):
                                                        if p not in policy_names:
                                                            raise SaltInvocationError('Listener {0} on ELB {1} refers to '
                                                                    'undefined policy {2}.'.format(l['elb_port'], name, p))
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 hr to fix
                                            salt/states/boto_elb.py on lines 1052..1057

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

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                    info["attributes"]["description"] = name + " " + info["attributes"]["description"]
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 2 other locations - About 1 hr to fix
                                            salt/states/boto_asg.py on lines 784..784
                                            salt/states/boto_dynamodb.py on lines 633..633

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

                                                for l in listeners:
                                                    expected_policies_by_listener[l['elb_port']] = set(
                                                            [cnames_by_name[p] for p in l.get('policies', [])])
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 hr to fix
                                            salt/states/boto_elb.py on lines 1108..1110

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

                                            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

                                                for b in backends:
                                                    expected_policies_by_backend[b['instance_port']] = set(
                                                            [cnames_by_name[p] for p in b.get('policies', [])])
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 hr to fix
                                            salt/states/boto_elb.py on lines 1092..1094

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

                                            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

                                                            for _tag in tags_to_remove:
                                                                ret['changes']['old']['tags'][_tag] = lb['tags'][_tag]
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 1 other location - About 1 hr to fix
                                            salt/states/boto_secgroup.py on lines 717..718

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

                                            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 results.get("changes", {}) != {}:
                                                        ret["changes"][info["name"]] = results["changes"]
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 2 other locations - About 1 hr to fix
                                            salt/states/boto_asg.py on lines 815..816
                                            salt/states/boto_dynamodb.py on lines 664..665

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

                                                    created = __salt__['boto_elb.create'](name=name,
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 7 other locations - About 50 mins to fix
                                            salt/states/boto3_route53.py on lines 222..222
                                            salt/states/boto_cloudwatch_event.py on lines 153..153
                                            salt/states/boto_cloudwatch_event.py on lines 229..229
                                            salt/states/boto_route53.py on lines 474..474
                                            salt/states/cron.py on lines 349..350
                                            salt/states/mount.py on lines 1117..1128
                                            salt/states/ssh_known_hosts.py on lines 163..163

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

                                            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

                                                for port, policies in six.iteritems(expected_policies_by_listener):
                                                    if policies != actual_policies_by_listener.get(port, set()):
                                                        listeners_to_update.add(port)
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 3 other locations - About 45 mins to fix
                                            salt/states/boto_elb.py on lines 1132..1134
                                            salt/states/boto_elb.py on lines 1137..1139
                                            salt/states/boto_elb.py on lines 1140..1142

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

                                                for port, policies in six.iteritems(actual_policies_by_backend):
                                                    if policies != expected_policies_by_backend.get(port, set()):
                                                        backends_to_update.add(port)
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 3 other locations - About 45 mins to fix
                                            salt/states/boto_elb.py on lines 1129..1131
                                            salt/states/boto_elb.py on lines 1132..1134
                                            salt/states/boto_elb.py on lines 1137..1139

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

                                                for port, policies in six.iteritems(expected_policies_by_backend):
                                                    if policies != actual_policies_by_backend.get(port, set()):
                                                        backends_to_update.add(port)
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 3 other locations - About 45 mins to fix
                                            salt/states/boto_elb.py on lines 1129..1131
                                            salt/states/boto_elb.py on lines 1132..1134
                                            salt/states/boto_elb.py on lines 1140..1142

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

                                                for port, policies in six.iteritems(actual_policies_by_listener):
                                                    if policies != expected_policies_by_listener.get(port, set()):
                                                        listeners_to_update.add(port)
                                            Severity: Major
                                            Found in salt/states/boto_elb.py and 3 other locations - About 45 mins to fix
                                            salt/states/boto_elb.py on lines 1129..1131
                                            salt/states/boto_elb.py on lines 1137..1139
                                            salt/states/boto_elb.py on lines 1140..1142

                                            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

                                            There are no issues that match your filters.

                                            Category
                                            Status