File sbemu.py
has 800 lines of code (exceeds 250 allowed). Consider refactoring.
Cyclomatic complexity is too high in method get_switches. (8)
def get_switches(self, new_ssh_conn=None):
"""
Wrapper to the Multinet SB-Emulator get_switches handler
:param new_ssh_conn: an SSH client connection object
Cyclomatic complexity is too high in method get_flows. (8)
def get_flows(self, new_ssh_conn=None):
"""
Wrapper to the Multinet SB-Emulator get_flows handler
:param new_ssh_conn: an SSH client connection object
Cyclomatic complexity is too high in method build. (6)
def build(self):
"""
Wrapper to the SB-Emulator build handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method __generate_config. (6)
def __generate_config(self, cntrl_of_port, cntrl_ip):
"""
Generates a new json configuration file for multinet, according to the
configuration values that are passed as parameters.
Cyclomatic complexity is too high in method run. (6)
def run(self, ctrl_ip, ctrl_sb_port, prefix='[MTCBench.run_handler]',
lines_queue=None, print_flag=True, block_flag=True,
getpty_flag=False):
"""
Wrapper to the MTCBench SB-Emulator run handler
Cyclomatic complexity is too high in method clean. (6)
def clean(self):
"""
Wrapper to the SB-Emulator clean handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method __parse_output. (6)
def __parse_output(self, multinet_handler_name, multinet_output):
"""
Gets the console output of a multinet handler and extracts the
aggregated result from all workers, as a numeric value.
(Helper function)
Cyclomatic complexity is too high in method start_topos. (6)
def start_topos(self):
"""
Wrapper to the Multinet SB-Emulator start_topos handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method generate_traffic. (6)
def generate_traffic(self):
"""
Wrapper to the Multinet SB-Emulator traffic_gen handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method deploy. (6)
def deploy(self, cntrl_ip, cntrl_of_port):
"""
Wrapper to the Multinet SB-Emulator deploy handler
:param cntrl_ip: The IP of the Controller.
Cyclomatic complexity is too high in method init_topos. (6)
def init_topos(self):
"""
Wrapper to the Multinet SB-Emulator init_topos handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method stop_topos. (6)
def stop_topos(self):
"""
Wrapper to the Multinet SB-Emulator stop_topos handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method cleanup. (6)
def cleanup(self):
"""
Wrapper to the Multinet SB-Emulator cleanup handler
:raises IOError: if the handler does not exist on the remote host
Function get_switches
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def get_switches(self, new_ssh_conn=None):
"""
Wrapper to the Multinet SB-Emulator get_switches handler
:param new_ssh_conn: an SSH client connection object
Function get_flows
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def get_flows(self, new_ssh_conn=None):
"""
Wrapper to the Multinet SB-Emulator get_flows handler
:param new_ssh_conn: an SSH client connection object
Function run
has 7 arguments (exceeds 4 allowed). Consider refactoring.
def run(self, ctrl_ip, ctrl_sb_port, prefix='[MTCBench.run_handler]',
Function clean
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def clean(self):
"""
Wrapper to the SB-Emulator clean handler
:raises IOError: if the handler does not exist on the remote host
Function build
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def build(self):
"""
Wrapper to the SB-Emulator build handler
:raises IOError: if the handler does not exist on the remote host
Function run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def run(self, ctrl_ip, ctrl_sb_port, prefix='[MTCBench.run_handler]',
lines_queue=None, print_flag=True, block_flag=True,
getpty_flag=False):
"""
Wrapper to the MTCBench SB-Emulator run handler
Function generate_traffic
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def generate_traffic(self):
"""
Wrapper to the Multinet SB-Emulator traffic_gen handler
:raises IOError: if the handler does not exist on the remote host
Function start_topos
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def start_topos(self):
"""
Wrapper to the Multinet SB-Emulator start_topos handler
:raises IOError: if the handler does not exist on the remote host
Function init_topos
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def init_topos(self):
"""
Wrapper to the Multinet SB-Emulator init_topos 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 Multinet SB-Emulator cleanup handler
:raises IOError: if the handler does not exist on the remote host
Function deploy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def deploy(self, cntrl_ip, cntrl_of_port):
"""
Wrapper to the Multinet SB-Emulator deploy handler
:param cntrl_ip: The IP of the Controller.
Function stop_topos
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def stop_topos(self):
"""
Wrapper to the Multinet SB-Emulator stop_topos handler
:raises IOError: if the handler does not exist on the remote host
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def __init__(self, sb_emu_base_dir, test_config):
"""
Initialize the creation of an Multinet SB emulator object.
Inherits from SBEmu class.
Similar blocks of code found in 5 locations. Consider refactoring.
def generate_traffic(self):
"""
Wrapper to the Multinet SB-Emulator traffic_gen handler
:raises IOError: if the handler does not exist on the remote host
Similar blocks of code found in 5 locations. Consider refactoring.
def init_topos(self):
"""
Wrapper to the Multinet SB-Emulator init_topos handler
:raises IOError: if the handler does not exist on the remote host
Similar blocks of code found in 5 locations. Consider refactoring.
def stop_topos(self):
"""
Wrapper to the Multinet SB-Emulator stop_topos handler
:raises IOError: if the handler does not exist on the remote host
Similar blocks of code found in 5 locations. Consider refactoring.
def cleanup(self):
"""
Wrapper to the Multinet SB-Emulator cleanup handler
:raises IOError: if the handler does not exist on the remote host
Similar blocks of code found in 5 locations. Consider refactoring.
def start_topos(self):
"""
Wrapper to the Multinet SB-Emulator start_topos 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 emulator 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 4 locations. Consider refactoring.
def _error_handling(self, error_message, error_num=1):
"""
Handles custom errors of sb emulators
:param error_message: message of the handled error
Similar blocks of code found in 2 locations. Consider refactoring.
def __del__(self):
"""
Method called when object is destroyed
"""
try:
Similar blocks of code found in 2 locations. Consider refactoring.
if exit_status == 0:
logging.info("[Multinet] Successful got switches")
return self.__parse_output('get_switches_topology_handler',
cmd_output)
else:
Similar blocks of code found in 2 locations. Consider refactoring.
if exit_status == 0:
logging.info("[Multinet] Successful got flows")
return self.__parse_output('get_flows_topology_handler',
cmd_output)
else:
There are no issues that match your filters.