Cyclomatic complexity is too high in method build. (6)
def build(self):
"""
Wrapper to the NB-Generator build handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method clean. (6)
def clean(self):
"""
Wrapper to the NB-Generator clean handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method run. (6)
def run(self):
"""
Wrapper to the NB-Generator run handler
:returns: Returns the combined stdout - stderr of the executed command
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
def __init__(self, nb_gen_base_dir, test_config, controller, sbemu,
log_level="DEBUG"):
"""Create an NB-generator object. Options from JSON input file
:param nb_gen_base_dir: emulator base directory
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring.
def __init__(self, nb_gen_base_dir, test_config, controller, sbemu,
Function clean
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def clean(self):
"""
Wrapper to the NB-Generator clean 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):
"""
Wrapper to the NB-Generator run handler
:returns: Returns the combined stdout - stderr of the executed command
Function build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def build(self):
"""
Wrapper to the NB-Generator 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 nb_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 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 4 locations. Consider refactoring.
def _error_handling(self, error_message, error_num=1):
"""
Handles custom errors of nb_emulator
: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:
logging.info('Cleaning NB-Generator.')
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.build_hnd]):
raise(IOError(
There are no issues that match your filters.