saltstack/salt

View on GitHub
salt/modules/boto_vpc.py

Summary

Maintainability
F
3 wks
Test Coverage

File boto_vpc.py has 2343 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

.. versionadded:: 2014.7.0
Severity: Major
Found in salt/modules/boto_vpc.py - About 6 days to fix

    Function describe_route_tables has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    def describe_route_tables(route_table_id=None, route_table_name=None,
                             vpc_id=None,
                             tags=None, region=None, key=None, keyid=None,
                             profile=None):
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function describe_route_table has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def describe_route_table(route_table_id=None, route_table_name=None,
                             tags=None, region=None, key=None, keyid=None,
                             profile=None):
        '''
        Given route table properties, return route table details if matching table(s) exist.
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function create_route has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def create_route(route_table_id=None, destination_cidr_block=None,
                     route_table_name=None, gateway_id=None,
                     internet_gateway_name=None,
                     instance_id=None, interface_id=None,
                     vpc_peering_connection_id=None, vpc_peering_connection_name=None,
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function _create_network_acl_entry has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def _create_network_acl_entry(network_acl_id=None, rule_number=None, protocol=None,
                                  rule_action=None, cidr_block=None, egress=None,
                                  network_acl_name=None, icmp_code=None, icmp_type=None,
                                  port_range_from=None, port_range_to=None, replace=False,
                                  region=None, key=None, keyid=None, profile=None):
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function _find_nat_gateways has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_nat_gateways(nat_gateway_id=None, subnet_id=None, subnet_name=None, vpc_id=None, vpc_name=None,
                           states=('pending', 'available'),
                           region=None, key=None, keyid=None, profile=None):
        '''
        Given gateway properties, find and return matching nat gateways
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def delete_nat_gateway(nat_gateway_id,
                           release_eips=False, region=None,
                           key=None, keyid=None, profile=None,
                           wait_for_delete=False, wait_for_delete_retries=5):
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def subnet_exists(subnet_id=None, name=None, subnet_name=None, cidr=None,
                      tags=None, zones=None, region=None, key=None, keyid=None,
                      profile=None):
        '''
        Check if a subnet exists.
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def _get_resource(resource, name=None, resource_id=None, region=None,
                      key=None, keyid=None, profile=None):
        '''
        Get a VPC resource based on resource type and name or id.
        Cache the id if name was provided.
    Severity: Minor
    Found in salt/modules/boto_vpc.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 _create_resource has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def _create_resource(resource, name=None, tags=None, region=None, key=None,
                         keyid=None, profile=None, **kwargs):
        '''
        Create a VPC resource. Returns the resource id if created, or False
        if not created.
    Severity: Minor
    Found in salt/modules/boto_vpc.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 describe_subnets has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def describe_subnets(subnet_ids=None, subnet_names=None, vpc_id=None, cidr=None,
                         region=None, key=None, keyid=None, profile=None):
        '''
        Given a VPC ID or subnet CIDR, returns a list of associated subnets and
        their details. Return all subnets if VPC ID or CIDR are not provided.
    Severity: Minor
    Found in salt/modules/boto_vpc.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 create_network_acl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def create_network_acl(vpc_id=None, vpc_name=None, network_acl_name=None,
                           subnet_id=None, subnet_name=None, tags=None,
                           region=None, key=None, keyid=None, profile=None):
        '''
        Given a vpc_id, creates a network acl.
    Severity: Minor
    Found in salt/modules/boto_vpc.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 request_vpc_peering_connection has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def request_vpc_peering_connection(requester_vpc_id=None, requester_vpc_name=None,
                                       peer_vpc_id=None, peer_vpc_name=None, name=None,
                                       peer_owner_id=None, peer_region=None, region=None,
                                       key=None, keyid=None, profile=None, dry_run=False):
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.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 route_exists has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def route_exists(destination_cidr_block, route_table_name=None, route_table_id=None,
                     gateway_id=None, instance_id=None, interface_id=None, tags=None,
                     region=None, key=None, keyid=None, profile=None, vpc_peering_connection_id=None):
        '''
        Checks if a route exists.
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def _get_subnet_explicit_route_table(subnet_id, vpc_id, conn=None, region=None, key=None, keyid=None, profile=None):
        '''
        helper function to find subnet explicit route table associations
    
        .. versionadded:: 2016.11.0
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function _delete_resource has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def _delete_resource(resource, name=None, resource_id=None, region=None,
                         key=None, keyid=None, profile=None, **kwargs):
        '''
        Delete a VPC resource. Returns True if successful, otherwise False.
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function _get_id has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def _get_id(vpc_name=None, cidr=None, tags=None, region=None, key=None,
                keyid=None, profile=None):
        '''
        Given VPC properties, return the VPC id if a match is found.
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.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 describe_vpcs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def describe_vpcs(vpc_id=None, name=None, cidr=None, tags=None,
                      region=None, key=None, keyid=None, profile=None):
        '''
        Describe all VPCs, matching the filter criteria if provided.
    
    
    Severity: Minor
    Found in salt/modules/boto_vpc.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 _find_resources has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_resources(resource, name=None, resource_id=None, tags=None,
                        region=None, key=None, keyid=None, profile=None):
        '''
        Get VPC resources based on resource type and name, id, or tags.
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.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 _find_vpcs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_vpcs(vpc_id=None, vpc_name=None, cidr=None, tags=None,
                   region=None, key=None, keyid=None, profile=None):
    
        '''
        Given VPC properties, find and return matching VPC ids.
    Severity: Minor
    Found in salt/modules/boto_vpc.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 peering_connection_pending_from_vpc has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def peering_connection_pending_from_vpc(conn_id=None, conn_name=None, vpc_id=None,
                                            vpc_name=None, region=None, key=None,
                                            keyid=None, profile=None):
        '''
        Check if a VPC peering connection is in the pending state, and requested from the given VPC.
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def delete(vpc_id=None, name=None, vpc_name=None, tags=None,
               region=None, key=None, keyid=None, profile=None):
        '''
        Given a VPC ID or VPC name, delete the VPC.
    
    
    Severity: Minor
    Found in salt/modules/boto_vpc.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 associate_route_table has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def associate_route_table(route_table_id=None, subnet_id=None,
                              route_table_name=None, subnet_name=None,
                              region=None, key=None, keyid=None,
                              profile=None):
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function delete_network_acl_entry has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def delete_network_acl_entry(network_acl_id=None, rule_number=None, egress=None,
                                 network_acl_name=None, region=None, key=None, keyid=None,
                                 profile=None):
        '''
        Deletes a network acl entry.
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function create_nat_gateway has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def create_nat_gateway(subnet_id=None,
                           subnet_name=None, allocation_id=None,
                           region=None, key=None, keyid=None, profile=None):
        '''
        Create a NAT Gateway within an existing subnet. If allocation_id is
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function _find_subnets has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_subnets(subnet_name=None, vpc_id=None, cidr=None, tags=None, conn=None):
        '''
        Given subnet properties, find and return matching subnet ids
        '''
    
    
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function associate_network_acl_to_subnet has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def associate_network_acl_to_subnet(network_acl_id=None, subnet_id=None,
                                        network_acl_name=None,
                                        subnet_name=None, region=None,
                                        key=None, keyid=None, profile=None):
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def delete_internet_gateway(internet_gateway_id=None,
                                internet_gateway_name=None,
                                detach=False, region=None,
                                key=None, keyid=None, profile=None):
        '''
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def describe(vpc_id=None, vpc_name=None, region=None, key=None,
                 keyid=None, profile=None):
        '''
        Given a VPC ID describe its properties.
    
    
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def disassociate_network_acl(subnet_id=None, vpc_id=None, subnet_name=None, vpc_name=None,
                                 region=None, key=None, keyid=None, profile=None):
        '''
        Given a subnet ID, disassociates a network acl.
    
    
    Severity: Minor
    Found in salt/modules/boto_vpc.py - About 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    def _maybe_name_route_table(conn, vpcid, vpc_name):
        route_tables = conn.get_all_route_tables(filters={'vpc_id': vpcid})
        if not route_tables:
            log.warning('no default route table found')
            return
    Severity: Minor
    Found in salt/modules/boto_vpc.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

                            for tagitem in item.get(inkey, []):
                                route_table[outkey][tagitem.get('Key')] = tagitem.get('Value')
                        else:
    Severity: Major
    Found in salt/modules/boto_vpc.py - About 45 mins to fix

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

      def create_dhcp_options(domain_name=None, domain_name_servers=None, ntp_servers=None,
                              netbios_name_servers=None, netbios_node_type=None,
                              dhcp_options_name=None, tags=None, vpc_id=None, vpc_name=None,
                              region=None, key=None, keyid=None, profile=None):
          '''
      Severity: Minor
      Found in salt/modules/boto_vpc.py - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

      def replace_route(route_table_id=None, destination_cidr_block=None,
                        route_table_name=None, gateway_id=None,
                        instance_id=None, interface_id=None,
                        region=None, key=None, keyid=None, profile=None,
                        vpc_peering_connection_id=None):
      Severity: Minor
      Found in salt/modules/boto_vpc.py - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

      def get_subnet_association(subnets, region=None, key=None, keyid=None,
                                 profile=None):
          '''
          Given a subnet (aka: a vpc zone identifier) or list of subnets, returns
          vpc association.
      Severity: Minor
      Found in salt/modules/boto_vpc.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

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

      def create_internet_gateway(internet_gateway_name=None, vpc_id=None,
                                  vpc_name=None, tags=None, region=None, key=None,
                                  keyid=None, profile=None):
          '''
          Create an Internet Gateway, optionally attaching it to an existing VPC.
      Severity: Minor
      Found in salt/modules/boto_vpc.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 {'associated': False, 'error': __utils__['boto.get_error'](e)}
      Severity: Major
      Found in salt/modules/boto_vpc.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return {'exists': False}
        Severity: Major
        Found in salt/modules/boto_vpc.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return {'created': True, 'id': ret.get('NatGatewayId')}
          Severity: Major
          Found in salt/modules/boto_vpc.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return {'vpc': _r}
            Severity: Major
            Found in salt/modules/boto_vpc.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return {'vpc': None}
              Severity: Major
              Found in salt/modules/boto_vpc.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return {'created': False,
                Severity: Major
                Found in salt/modules/boto_vpc.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

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

                    Avoid too many return statements within this function.
                    Open

                            return {'created': False, 'error': __utils__['boto.get_error'](e)}
                    Severity: Major
                    Found in salt/modules/boto_vpc.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return _create_resource('route', route_table_id=route_table_id,
                      Severity: Major
                      Found in salt/modules/boto_vpc.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return {'created': False, 'error': __utils__['boto.get_error'](e)}
                        Severity: Major
                        Found in salt/modules/boto_vpc.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return {'created': False, 'error': __utils__['boto.get_error'](e)}
                          Severity: Major
                          Found in salt/modules/boto_vpc.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return {'created': False, 'error': __utils__['boto.get_error'](e)}
                            Severity: Major
                            Found in salt/modules/boto_vpc.py - About 30 mins to fix

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

                              def _key_remap(key, keys, item):
                                  elements_list = []
                                  for r_item in item.get(key, []):
                                      element = {}
                                      for r_outkey, r_inkey in six.iteritems(keys):
                              Severity: Minor
                              Found in salt/modules/boto_vpc.py - About 25 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                              def get_dhcp_options(dhcp_options_name=None, dhcp_options_id=None,
                                                   region=None, key=None, keyid=None, profile=None):
                                  '''
                                  Return a dict with the current values of the requested DHCP options set
                              
                              
                              Severity: Minor
                              Found in salt/modules/boto_vpc.py - About 25 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                              def _key_iter(key, keys, item):
                                  elements_list = []
                                  for r_item in getattr(item, key):
                                      element = {}
                                      for r_key in keys:
                              Severity: Minor
                              Found in salt/modules/boto_vpc.py - About 25 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                              def is_peering_connection_pending(conn_id=None, conn_name=None, region=None,
                                                                key=None, keyid=None, profile=None):
                                  '''
                                  Check if a VPC peering connection is in the pending state.
                              
                              
                              Severity: Minor
                              Found in salt/modules/boto_vpc.py - About 25 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                              def delete_vpc_peering_connection(conn_id=None, conn_name=None, region=None,
                                                                key=None, keyid=None, profile=None, dry_run=False):
                                  '''
                                  Delete a VPC peering connection.
                              
                              
                              Severity: Minor
                              Found in salt/modules/boto_vpc.py - About 25 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                              def delete_route(route_table_id=None, destination_cidr_block=None,
                                               route_table_name=None, region=None, key=None,
                                               keyid=None, profile=None):
                                  '''
                                  Deletes a route.
                              Severity: Minor
                              Found in salt/modules/boto_vpc.py - About 25 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                              def _maybe_set_tags(tags, obj):
                                  if tags:
                                      # Not all objects in Boto have an 'add_tags()' method.
                                      try:
                                          obj.add_tags(tags)
                              Severity: Minor
                              Found in salt/modules/boto_vpc.py - About 25 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                              def delete_network_acl(network_acl_id=None, network_acl_name=None, disassociate=False,
                                                     region=None, key=None, keyid=None, profile=None):
                                  '''
                                  Delete a network acl based on the network_acl_id or network_acl_name provided.
                              
                              
                              Severity: Minor
                              Found in salt/modules/boto_vpc.py - About 25 mins to fix

                              Cognitive Complexity

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

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

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

                              Further reading

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

                                  if not vpcs:
                                      return False
                                  elif len(vpcs) > 1:
                                      raise SaltInvocationError('Found more than one ID for the VPC peering '
                                                                'connection ({0}). Please call this function '
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 3159..3166

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if not vpcs:
                                      return False
                                  elif len(vpcs) > 1:
                                      raise SaltInvocationError('Found more than one ID for the VPC peering '
                                                                'connection ({0}). Please call this function '
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 3085..3092

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

                              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 r.get('created') and vpc_id:
                                          conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
                                          conn.associate_dhcp_options(r['id'], vpc_id)
                                          log.info(
                                              'Associated options %s to VPC %s',
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 1153..1158

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 73.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if r.get('created') and vpc_id:
                                          conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
                                          conn.attach_internet_gateway(r['id'], vpc_id)
                                          log.info(
                                              'Attached internet gateway %s to VPC %s',
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 1568..1573

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 73.

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

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

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

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

                              Refactorings

                              Further Reading

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

                              def route_table_exists(route_table_id=None, name=None, route_table_name=None,
                                                     tags=None, region=None, key=None, keyid=None, profile=None):
                                  '''
                                  Checks if a route table exists.
                              
                              
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 2 other locations - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 1674..1694
                              salt/modules/boto_vpc.py on lines 1796..1816

                              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

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

                              def dhcp_options_exists(dhcp_options_id=None, name=None, dhcp_options_name=None,
                                                      tags=None, region=None, key=None, keyid=None, profile=None):
                                  '''
                                  Check if a dhcp option exists.
                              
                              
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 2 other locations - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 1796..1816
                              salt/modules/boto_vpc.py on lines 2092..2110

                              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

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

                              def network_acl_exists(network_acl_id=None, name=None, network_acl_name=None,
                                                     tags=None, region=None, key=None, keyid=None,
                                                     profile=None):
                                  '''
                                  Checks if a network acl exists.
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 2 other locations - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 1674..1694
                              salt/modules/boto_vpc.py on lines 2092..2110

                              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

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

                                      if nat_gateway_subnet_id:
                                          gws = describe_nat_gateways(subnet_id=nat_gateway_subnet_id,
                                                                   region=region, key=key, keyid=keyid, profile=profile)
                                          if not gws:
                                              return {'created': False,
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 2346..2352

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

                              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 nat_gateway_subnet_name:
                                          gws = describe_nat_gateways(subnet_name=nat_gateway_subnet_name,
                                                                   region=region, key=key, keyid=keyid, profile=profile)
                                          if not gws:
                                              return {'created': False,
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 3 hrs to fix
                              salt/modules/boto_vpc.py on lines 2354..2360

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if vpc_id or vpc_name:
                                          vpc_id = check_vpc(vpc_id, vpc_name, region, key, keyid, profile)
                                          if not vpc_id:
                                              return {'created': False,
                                                      'error': {'message': 'VPC {0} does not exist.'.format(vpc_name or vpc_id)}}
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 2 hrs to fix
                              salt/modules/boto_vpc.py on lines 1144..1148

                              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

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

                                      if vpc_id or vpc_name:
                                          vpc_id = check_vpc(vpc_id, vpc_name, region, key, keyid, profile)
                                          if not vpc_id:
                                              return {'created': False,
                                                      'error': {'message': 'VPC {0} does not exist.'.format(vpc_name or vpc_id)}}
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 2 hrs to fix
                              salt/modules/boto_vpc.py on lines 1556..1560

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

                                  try:
                                      vpc_ids = _find_vpcs(vpc_id=vpc_id, vpc_name=name, cidr=cidr, tags=tags,
                                                           region=region, key=key, keyid=keyid, profile=profile)
                                  except BotoServerError as err:
                                      boto_err = __utils__['boto.get_error'](err)
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 2 other locations - About 2 hrs to fix
                              salt/modules/boto_vpc.py on lines 717..725
                              salt/modules/boto_vpc.py on lines 953..960

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

                              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

                                  try:
                                      conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
                                      vpc_id = check_vpc(vpc_id, vpc_name, region, key, keyid, profile)
                                  except BotoServerError as err:
                                      boto_err = __utils__['boto.get_error'](err)
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 2 other locations - About 2 hrs to fix
                              salt/modules/boto_vpc.py on lines 588..596
                              salt/modules/boto_vpc.py on lines 953..960

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

                              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

                                  try:
                                      subnets = conn.get_all_subnets(**filter_parameters)
                                  except BotoServerError as err:
                                      boto_err = __utils__['boto.get_error'](err)
                                      if boto_err.get('aws', {}).get('code') == 'InvalidSubnetID.NotFound':
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 2 other locations - About 2 hrs to fix
                              salt/modules/boto_vpc.py on lines 588..596
                              salt/modules/boto_vpc.py on lines 717..725

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  elif subnet_id:
                                      if not _get_resource('subnet', resource_id=subnet_id,
                                                           region=region, key=key, keyid=keyid, profile=profile):
                                          return {'created': False,
                                                  'error': {'message': 'Subnet {0} does not exist.'.format(subnet_id)}}
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1357..1368

                              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

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

                                      if subnet_name:
                                          subnet_id = _get_resource_id('subnet', subnet_name,
                                                                   region=region, key=key,
                                                                   keyid=keyid, profile=profile)
                                          if not subnet_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1740..1744

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

                                      if route_table_name:
                                          route_table_id = _get_resource_id('route_table', route_table_name,
                                                                            region=region, key=key,
                                                                            keyid=keyid, profile=profile)
                                          if not route_table_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2403..2410

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if internet_gateway_name:
                                          gateway_id = _get_resource_id('internet_gateway', internet_gateway_name,
                                                                        region=region, key=key,
                                                                        keyid=keyid, profile=profile)
                                          if not gateway_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2403..2410
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if subnet_name:
                                          subnet_id = _get_resource_id('subnet', subnet_name,
                                                                       region=region, key=key,
                                                                       keyid=keyid, profile=profile)
                                          if not subnet_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2403..2410
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if route_table_name:
                                      route_table_id = _get_resource_id('route_table', route_table_name,
                                                                        region=region, key=key,
                                                                        keyid=keyid, profile=profile)
                                      if not route_table_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2403..2410
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if vpc_peering_connection_name:
                                          vpc_peering_connection_id = _get_resource_id('vpc_peering_connection', vpc_peering_connection_name,
                                                                                       region=region, key=key,
                                                                                       keyid=keyid, profile=profile)
                                          if not vpc_peering_connection_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2403..2410
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if network_acl_name:
                                      network_acl_id = _get_resource_id('network_acl', network_acl_name,
                                                                        region=region, key=key,
                                                                        keyid=keyid, profile=profile)
                                      if not network_acl_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2403..2410
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if route_table_name:
                                          route_table_id = _get_resource_id('route_table', route_table_name,
                                                                            region=region, key=key,
                                                                            keyid=keyid, profile=profile)
                                          if not route_table_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2403..2410
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  try:
                                      if route_table_name:
                                          route_table_id = _get_resource_id('route_table', route_table_name,
                                                                            region=region, key=key,
                                                                            keyid=keyid, profile=profile)
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if subnet_name:
                                      subnet_id = _get_resource_id('subnet', subnet_name,
                                                                   region=region, key=key,
                                                                   keyid=keyid, profile=profile)
                                      if not subnet_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2207..2213
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2403..2410
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if subnet_name:
                                      subnet_id = _get_resource_id('subnet', subnet_name,
                                                                   region=region, key=key,
                                                                   keyid=keyid, profile=profile)
                                      if not subnet_id:
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1843..1849
                              salt/modules/boto_vpc.py on lines 1850..1856
                              salt/modules/boto_vpc.py on lines 1894..1900
                              salt/modules/boto_vpc.py on lines 2218..2224
                              salt/modules/boto_vpc.py on lines 2322..2328
                              salt/modules/boto_vpc.py on lines 2330..2336
                              salt/modules/boto_vpc.py on lines 2338..2344
                              salt/modules/boto_vpc.py on lines 2403..2410
                              salt/modules/boto_vpc.py on lines 2444..2450

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if tags:
                                      for tag_name, tag_value in six.iteritems(tags):
                                          filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_ec2.py on lines 583..585
                              salt/modules/boto_ec2.py on lines 673..675
                              salt/modules/boto_secgroup.py on lines 576..578
                              salt/modules/boto_vpc.py on lines 399..401
                              salt/modules/boto_vpc.py on lines 507..509
                              salt/modules/boto_vpc.py on lines 788..790
                              salt/modules/boto_vpc.py on lines 828..830
                              salt/modules/boto_vpc.py on lines 2149..2151
                              salt/modules/boto_vpc.py on lines 2505..2507

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if tags:
                                      for tag_name, tag_value in six.iteritems(tags):
                                          filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_ec2.py on lines 583..585
                              salt/modules/boto_ec2.py on lines 673..675
                              salt/modules/boto_secgroup.py on lines 576..578
                              salt/modules/boto_vpc.py on lines 399..401
                              salt/modules/boto_vpc.py on lines 507..509
                              salt/modules/boto_vpc.py on lines 788..790
                              salt/modules/boto_vpc.py on lines 947..949
                              salt/modules/boto_vpc.py on lines 2149..2151
                              salt/modules/boto_vpc.py on lines 2505..2507

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if tags:
                                      for tag_name, tag_value in six.iteritems(tags):
                                          filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_ec2.py on lines 583..585
                              salt/modules/boto_ec2.py on lines 673..675
                              salt/modules/boto_secgroup.py on lines 576..578
                              salt/modules/boto_vpc.py on lines 399..401
                              salt/modules/boto_vpc.py on lines 788..790
                              salt/modules/boto_vpc.py on lines 828..830
                              salt/modules/boto_vpc.py on lines 947..949
                              salt/modules/boto_vpc.py on lines 2149..2151
                              salt/modules/boto_vpc.py on lines 2505..2507

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if tags:
                                          for tag_name, tag_value in six.iteritems(tags):
                                              filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_ec2.py on lines 583..585
                              salt/modules/boto_ec2.py on lines 673..675
                              salt/modules/boto_secgroup.py on lines 576..578
                              salt/modules/boto_vpc.py on lines 399..401
                              salt/modules/boto_vpc.py on lines 507..509
                              salt/modules/boto_vpc.py on lines 788..790
                              salt/modules/boto_vpc.py on lines 828..830
                              salt/modules/boto_vpc.py on lines 947..949
                              salt/modules/boto_vpc.py on lines 2149..2151

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if tags:
                                      for tag_name, tag_value in six.iteritems(tags):
                                          filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_ec2.py on lines 583..585
                              salt/modules/boto_ec2.py on lines 673..675
                              salt/modules/boto_secgroup.py on lines 576..578
                              salt/modules/boto_vpc.py on lines 507..509
                              salt/modules/boto_vpc.py on lines 788..790
                              salt/modules/boto_vpc.py on lines 828..830
                              salt/modules/boto_vpc.py on lines 947..949
                              salt/modules/boto_vpc.py on lines 2149..2151
                              salt/modules/boto_vpc.py on lines 2505..2507

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if tags:
                                          for tag_name, tag_value in six.iteritems(tags):
                                              filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_ec2.py on lines 583..585
                              salt/modules/boto_ec2.py on lines 673..675
                              salt/modules/boto_secgroup.py on lines 576..578
                              salt/modules/boto_vpc.py on lines 399..401
                              salt/modules/boto_vpc.py on lines 507..509
                              salt/modules/boto_vpc.py on lines 828..830
                              salt/modules/boto_vpc.py on lines 947..949
                              salt/modules/boto_vpc.py on lines 2149..2151
                              salt/modules/boto_vpc.py on lines 2505..2507

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      if tags:
                                          for tag_name, tag_value in six.iteritems(tags):
                                              filter_parameters['filters']['tag:{0}'.format(tag_name)] = tag_value
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 9 other locations - About 1 hr to fix
                              salt/modules/boto_ec2.py on lines 583..585
                              salt/modules/boto_ec2.py on lines 673..675
                              salt/modules/boto_secgroup.py on lines 576..578
                              salt/modules/boto_vpc.py on lines 399..401
                              salt/modules/boto_vpc.py on lines 507..509
                              salt/modules/boto_vpc.py on lines 788..790
                              salt/modules/boto_vpc.py on lines 828..830
                              salt/modules/boto_vpc.py on lines 947..949
                              salt/modules/boto_vpc.py on lines 2505..2507

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                              def delete_dhcp_options(dhcp_options_id=None, dhcp_options_name=None,
                                                      region=None, key=None, keyid=None, profile=None):
                                  '''
                                  Delete dhcp options by id or name.
                              
                              
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 3 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 883..901
                              salt/modules/boto_vpc.py on lines 1485..1503
                              salt/modules/boto_vpc.py on lines 2074..2087

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

                              def delete_subnet(subnet_id=None, subnet_name=None, region=None, key=None,
                                                keyid=None, profile=None):
                                  '''
                                  Given a subnet ID or name, delete the subnet.
                              
                              
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 3 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 1485..1503
                              salt/modules/boto_vpc.py on lines 1619..1634
                              salt/modules/boto_vpc.py on lines 2074..2087

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

                              def delete_customer_gateway(customer_gateway_id=None, customer_gateway_name=None,
                                                          region=None, key=None, keyid=None, profile=None):
                                  '''
                                  Given a customer gateway ID or name, delete the customer gateway.
                              
                              
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 3 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 883..901
                              salt/modules/boto_vpc.py on lines 1619..1634
                              salt/modules/boto_vpc.py on lines 2074..2087

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

                              def delete_route_table(route_table_id=None, route_table_name=None,
                                                     region=None, key=None, keyid=None, profile=None):
                                  '''
                                  Deletes a route table.
                              
                              
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 3 other locations - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 883..901
                              salt/modules/boto_vpc.py on lines 1485..1503
                              salt/modules/boto_vpc.py on lines 1619..1634

                              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

                                  if peer_vpc_name:
                                      peer_vpc_id = _get_id(vpc_name=peer_vpc_name, region=region, key=key,
                                                       keyid=keyid, profile=profile)
                                      if not peer_vpc_id:
                                          return {'error': 'Could not resolve VPC name {0} to an ID'.format(peer_vpc_name)}
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 2788..2792

                              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

                                  if requester_vpc_name:
                                      requester_vpc_id = _get_id(vpc_name=requester_vpc_name, region=region, key=key,
                                                       keyid=keyid, profile=profile)
                                      if not requester_vpc_id:
                                          return {'error': 'Could not resolve VPC name {0} to an ID'.format(requester_vpc_name)}
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 1 hr to fix
                              salt/modules/boto_vpc.py on lines 2793..2797

                              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

                              try:
                                  #pylint: disable=unused-import
                                  import boto
                                  import botocore
                                  import boto.vpc
                              Severity: Major
                              Found in salt/modules/boto_vpc.py and 1 other location - About 1 hr to fix
                              salt/modules/boto_route53.py on lines 64..74

                              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

                              There are no issues that match your filters.

                              Category
                              Status