File controller.py
has 866 lines of code (exceeds 250 allowed). Consider refactoring.
Cyclomatic complexity is too high in method start. (10)
def start(self):
"""
Wrapper to the controller start handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method get_oper_switches. (7)
def get_oper_switches(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_switches handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
switches of the topology, recorded in operational datastore of the \
Cyclomatic complexity is too high in method get_oper_flows. (7)
def get_oper_flows(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_flows handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
flows of the topology, recorded in operational datastore of the \
Cyclomatic complexity is too high in method check_status. (7)
def check_status(self):
"""
Wrapper to the controller status handler
:returns: the status of the controller (running = 1, not running = 0)
Cyclomatic complexity is too high in method wait_until_listens. (7)
def wait_until_listens(self, timeout_ms):
"""
Waits for controller to start listening on specified port.
:param timeout_ms: milliseconds to wait (in milliseconds).
Cyclomatic complexity is too high in method stop. (7)
def stop(self):
"""
Wrapper to the controller stop handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method get_oper_hosts. (7)
def get_oper_hosts(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_hosts handler. Makes a REST call to \
the NB interface of the controller and returns the number of hosts \
of the topology, recorded in operational datastore of the controller
Cyclomatic complexity is too high in method get_oper_links. (7)
def get_oper_links(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_links handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
links of the topology, recorded in operational datastore of the \
Cyclomatic complexity is too high in method getcontroller. (6)
def getcontroller(self):
"""
Wrapper to the get controller handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method build. (6)
def build(self):
"""
Wrapper to the controller build handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method wait_until_up. (6)
def wait_until_up(self, timeout_ms):
"""
Waits for controller status to become 1 (started).
:param timeout_ms: milliseconds to wait (in milliseconds).
Cyclomatic complexity is too high in method cleanup. (6)
def cleanup(self):
"""
Wrapper to the controller cleanup handler
:raises IOError: if the handler does not exist on the remote host
Function start
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
def start(self):
"""
Wrapper to the controller start handler
:raises IOError: if the handler does not exist on the remote host
Function stop
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def stop(self):
"""
Wrapper to the controller stop handler
:raises IOError: if the handler does not exist on the remote host
Function check_status
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def check_status(self):
"""
Wrapper to the controller status handler
:returns: the status of the controller (running = 1, not running = 0)
Function get_oper_switches
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def get_oper_switches(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_switches handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
switches of the topology, recorded in operational datastore of the \
Function get_oper_flows
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def get_oper_flows(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_flows handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
flows of the topology, recorded in operational datastore of the \
Function get_oper_links
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def get_oper_links(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_links handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
links of the topology, recorded in operational datastore of the \
Function get_oper_hosts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def get_oper_hosts(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_hosts handler. Makes a REST call to \
the NB interface of the controller and returns the number of hosts \
of the topology, recorded in operational datastore of the controller
Function wait_until_listens
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def wait_until_listens(self, timeout_ms):
"""
Waits for controller to start listening on specified port.
:param timeout_ms: milliseconds to wait (in milliseconds).
Function build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def build(self):
"""
Wrapper to the controller build handler
:raises IOError: if the handler does not exist on the remote host
Function cleanup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def cleanup(self):
"""
Wrapper to the controller cleanup handler
:raises IOError: if the handler does not exist on the remote host
Function getcontroller
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def getcontroller(self):
"""
Wrapper to the get controller handler
:raises IOError: if the handler does not exist on the remote host
Function wait_until_up
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def wait_until_up(self, timeout_ms):
"""
Waits for controller status to become 1 (started).
:param timeout_ms: milliseconds to wait (in milliseconds).
Similar blocks of code found in 4 locations. Consider refactoring.
def get_oper_switches(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_switches handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
switches of the topology, recorded in operational datastore of the \
Similar blocks of code found in 4 locations. Consider refactoring.
def get_oper_links(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_links handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
links of the topology, recorded in operational datastore of the \
Similar blocks of code found in 4 locations. Consider refactoring.
def get_oper_hosts(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_hosts handler. Makes a REST call to \
the NB interface of the controller and returns the number of hosts \
of the topology, recorded in operational datastore of the controller
Similar blocks of code found in 4 locations. Consider refactoring.
def get_oper_flows(self, new_ssh_conn=None):
"""
Wrapper to the controller oper_flows handler. Makes a REST call \
to the NB interface of the controller and returns the number of \
flows of the topology, recorded in operational datastore of the \
Similar blocks of code found in 2 locations. Consider refactoring.
def getcontroller(self):
"""
Wrapper to the get controller handler
:raises IOError: if the handler does not exist on the remote host
Similar blocks of code found in 2 locations. Consider refactoring.
def build(self):
"""
Wrapper to the controller build handler
:raises IOError: if the handler does not exist on the remote host
Similar blocks of code found in 3 locations. Consider refactoring.
def init_ssh(self):
"""
Initializes a new SSH client object, with the controller node and \
assigns it to the protected attribute _ssh_conn. If a connection \
already exists it returns a new SSH client object to the \
Similar blocks of code found in 2 locations. Consider refactoring.
try:
if not util.netutil.isfile(self.ip, self.ssh_port,
self.ssh_user, self.ssh_pass,
[self.clean_hnd]):
raise(IOError(
Similar blocks of code found in 2 locations. Consider refactoring.
def __del__(self):
"""
Method called when object is destroyed. Cleanup activities are
triggered and open connections closed
"""
Similar blocks of code found in 4 locations. Consider refactoring.
def _error_handling(self, error_message, error_num=1):
"""
Handles custom errors of controller
:param error_message: message of the handled error
There are no issues that match your filters.