saltstack/salt

View on GitHub
salt/utils/openstack/neutron.py

Summary

Maintainability
F
1 wk
Test Coverage

File neutron.py has 803 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Neutron class
'''

Severity: Major
Found in salt/utils/openstack/neutron.py - About 1 day to fix

    SaltNeutron has 95 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SaltNeutron(NeutronShell):
        '''
        Class for all neutronclient functions
        '''
    
    
    Severity: Major
    Found in salt/utils/openstack/neutron.py - About 1 day to fix

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

          def update_firewall_rule(self, firewall_rule, protocol=None, action=None,
                                   name=None, description=None, ip_version=None,
                                   source_ip_address=None, destination_ip_address=None, source_port=None,
                                   destination_port=None, shared=None, enabled=None):
              '''
      Severity: Minor
      Found in salt/utils/openstack/neutron.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_ipsecpolicy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_ipsecpolicy(self, name, **kwargs):
              '''
              Creates a new IPsecPolicy
              '''
              body = {'name': name}
      Severity: Minor
      Found in salt/utils/openstack/neutron.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_ikepolicy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_ikepolicy(self, name, **kwargs):
              '''
              Creates a new IKEPolicy
              '''
              body = {'name': name}
      Severity: Minor
      Found in salt/utils/openstack/neutron.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_ipsec_site_connection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_ipsec_site_connection(self, name, ipsecpolicy,
                                           ikepolicy,
                                           vpnservice,
                                           peer_cidrs,
                                           peer_address,
      Severity: Minor
      Found in salt/utils/openstack/neutron.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_firewall_rule has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_firewall_rule(self, protocol, action, **kwargs):
              '''
              Create a new firlwall rule
              '''
              body = {'protocol': protocol, 'action': action}
      Severity: Minor
      Found in salt/utils/openstack/neutron.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 _fetch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def _fetch(resources, name_or_id):
              ret = []
              for resource in resources:
                  if resource['id'] == name_or_id:
                      return resource
      Severity: Minor
      Found in salt/utils/openstack/neutron.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 update_quota has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_quota(self, tenant_id, subnet=None, router=None,
                           network=None, floatingip=None, port=None,
                           sec_grp=None, sec_grp_rule=None):
              '''
              Update a tenant's quota
      Severity: Minor
      Found in salt/utils/openstack/neutron.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 update_router has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_router(self, router, name=None, admin_state_up=None, **kwargs):
              '''
              Updates a router
              '''
              router_id = self._find_router_id(router)
      Severity: Minor
      Found in salt/utils/openstack/neutron.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 create_network has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_network(self, name, admin_state_up=True, router_ext=None, network_type=None, physical_network=None, segmentation_id=None, shared=None, vlan_transparent=None):
              '''
              Creates a new network
              '''
              body = {'name': name,
      Severity: Minor
      Found in salt/utils/openstack/neutron.py - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          def create_ipsecpolicy(self, name, **kwargs):
              '''
              Creates a new IPsecPolicy
              '''
              body = {'name': name}
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 1 other location - About 2 days to fix
      salt/utils/openstack/neutron.py on lines 763..784

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

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

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

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

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

      Refactorings

      Further Reading

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

          def create_ikepolicy(self, name, **kwargs):
              '''
              Creates a new IKEPolicy
              '''
              body = {'name': name}
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 1 other location - About 2 days to fix
      salt/utils/openstack/neutron.py on lines 806..827

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

      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 add_interface_router(self, router, subnet):
              '''
              Adds an internal network interface to the specified router
              '''
              router_id = self._find_router_id(router)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 2 other locations - About 1 hr to fix
      salt/utils/openstack/neutron.py on lines 498..505
      salt/utils/openstack/neutron.py on lines 507..514

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

          def remove_interface_router(self, router, subnet):
              '''
              Removes an internal network interface from the specified router
              '''
              router_id = self._find_router_id(router)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 2 other locations - About 1 hr to fix
      salt/utils/openstack/neutron.py on lines 489..496
      salt/utils/openstack/neutron.py on lines 507..514

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

          def add_gateway_router(self, router, network):
              '''
              Adds an external network gateway to the specified router
              '''
              router_id = self._find_router_id(router)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 2 other locations - About 1 hr to fix
      salt/utils/openstack/neutron.py on lines 489..496
      salt/utils/openstack/neutron.py on lines 498..505

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

          def delete_network(self, network):
              '''
              Deletes the specified network
              '''
              net_id = self._find_network_id(network)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 3 other locations - About 55 mins to fix
      salt/utils/openstack/neutron.py on lines 343..349
      salt/utils/openstack/neutron.py on lines 430..436
      salt/utils/openstack/neutron.py on lines 481..487

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

      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_router(self, router):
              '''
              Delete the specified router
              '''
              router_id = self._find_router_id(router)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 3 other locations - About 55 mins to fix
      salt/utils/openstack/neutron.py on lines 343..349
      salt/utils/openstack/neutron.py on lines 391..397
      salt/utils/openstack/neutron.py on lines 430..436

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

      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(self, subnet):
              '''
              Deletes the specified subnet
              '''
              subnet_id = self._find_subnet_id(subnet)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 3 other locations - About 55 mins to fix
      salt/utils/openstack/neutron.py on lines 343..349
      salt/utils/openstack/neutron.py on lines 391..397
      salt/utils/openstack/neutron.py on lines 481..487

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

      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_port(self, port):
              '''
              Deletes the specified port
              '''
              port_id = self._find_port_id(port)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 3 other locations - About 55 mins to fix
      salt/utils/openstack/neutron.py on lines 391..397
      salt/utils/openstack/neutron.py on lines 430..436
      salt/utils/openstack/neutron.py on lines 481..487

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

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

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

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

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

      Refactorings

      Further Reading

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

          def delete_security_group(self, sec_grp):
              '''
              Deletes the specified security group
              '''
              sec_grp_id = self._find_security_group_id(sec_grp)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 5 other locations - About 45 mins to fix
      salt/utils/openstack/neutron.py on lines 680..686
      salt/utils/openstack/neutron.py on lines 741..749
      salt/utils/openstack/neutron.py on lines 786..792
      salt/utils/openstack/neutron.py on lines 829..835
      salt/utils/openstack/neutron.py on lines 872..878

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

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

          def delete_firewall_rule(self, firewall_rule):
              '''
              Deletes the specified firewall rule
              '''
              firewall_rule_id = self._find_firewall_rule_id(firewall_rule)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 5 other locations - About 45 mins to fix
      salt/utils/openstack/neutron.py on lines 600..606
      salt/utils/openstack/neutron.py on lines 680..686
      salt/utils/openstack/neutron.py on lines 741..749
      salt/utils/openstack/neutron.py on lines 786..792
      salt/utils/openstack/neutron.py on lines 829..835

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

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

          def delete_ikepolicy(self, ikepolicy):
              '''
              Deletes the specified IKEPolicy
              '''
              ikepolicy_id = self._find_ikepolicy_id(ikepolicy)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 5 other locations - About 45 mins to fix
      salt/utils/openstack/neutron.py on lines 600..606
      salt/utils/openstack/neutron.py on lines 680..686
      salt/utils/openstack/neutron.py on lines 741..749
      salt/utils/openstack/neutron.py on lines 829..835
      salt/utils/openstack/neutron.py on lines 872..878

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

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

          def delete_ipsecpolicy(self, ipseecpolicy):
              '''
              Deletes the specified IPsecPolicy
              '''
              ipseecpolicy_id = self._find_ipsecpolicy_id(ipseecpolicy)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 5 other locations - About 45 mins to fix
      salt/utils/openstack/neutron.py on lines 600..606
      salt/utils/openstack/neutron.py on lines 680..686
      salt/utils/openstack/neutron.py on lines 741..749
      salt/utils/openstack/neutron.py on lines 786..792
      salt/utils/openstack/neutron.py on lines 872..878

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

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

          def delete_vpnservice(self, vpnservice):
              '''
              Deletes the specified VPN service
              '''
              vpnservice_id = self._find_vpnservice_id(vpnservice)
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 5 other locations - About 45 mins to fix
      salt/utils/openstack/neutron.py on lines 600..606
      salt/utils/openstack/neutron.py on lines 741..749
      salt/utils/openstack/neutron.py on lines 786..792
      salt/utils/openstack/neutron.py on lines 829..835
      salt/utils/openstack/neutron.py on lines 872..878

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

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

          def delete_ipsec_site_connection(self, ipsec_site_connection):
              '''
              Deletes the specified IPsecSiteConnection
              '''
              ipsec_site_connection_id = self._find_ipsec_site_connection_id(
      Severity: Major
      Found in salt/utils/openstack/neutron.py and 5 other locations - About 45 mins to fix
      salt/utils/openstack/neutron.py on lines 600..606
      salt/utils/openstack/neutron.py on lines 680..686
      salt/utils/openstack/neutron.py on lines 786..792
      salt/utils/openstack/neutron.py on lines 829..835
      salt/utils/openstack/neutron.py on lines 872..878

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status