File oftraf.py
has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Cyclomatic complexity is too high in method clean. (6)
def clean(self):
"""
Wrapper to the oftraf monitor clean handler
:raises IOError: if the handler does not exist on the remote host
Cyclomatic complexity is too high in method stop. (6)
def stop(self):
""" Wrapper to the oftraf monitor stop handler
:raises IOError: if the handler does not exist on the remote host
:raises oftraf_exceptions.OftrafStopError: if stop process fails
Cyclomatic complexity is too high in method start. (6)
def start(self):
"""
Wrapper to the oftraf monitor start handler. Initializes the REST
interface of oftraf and listen of traffic on controller Southbound
interface
Cyclomatic complexity is too high in method build. (6)
def build(self):
"""
Wrapper to the oftraf monitor build handler
:raises IOError: if the handler does not exist on the remote host
Function clean
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def clean(self):
"""
Wrapper to the oftraf monitor clean handler
:raises IOError: if the handler does not exist on the remote host
Function build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def build(self):
"""
Wrapper to the oftraf monitor build handler
:raises IOError: if the handler does not exist on the remote host
Function start
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def start(self):
"""
Wrapper to the oftraf monitor start handler. Initializes the REST
interface of oftraf and listen of traffic on controller Southbound
interface
Function stop
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def stop(self):
""" Wrapper to the oftraf monitor stop handler
:raises IOError: if the handler does not exist on the remote host
:raises oftraf_exceptions.OftrafStopError: if stop process fails
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 4 locations. Consider refactoring.
def _error_handling(self, error_message, error_num=1):
"""
Handles custom errors of oftraf
:param error_message: message of the handled error
Similar blocks of code found in 4 locations. Consider refactoring.
if not util.netutil.isfile(self.ip, self.ssh_port,
self.ssh_user, self.ssh_pass,
[clean_hnd]):
raise(IOError(
'{0} clean handler does not exist'.
Similar blocks of code found in 4 locations. Consider refactoring.
if not util.netutil.isfile(self.ip,
self.ssh_port,
self.ssh_user,
self.ssh_pass,
[build_hnd]):
Similar blocks of code found in 4 locations. Consider refactoring.
if not util.netutil.isfile(self.ip, self.ssh_port,
self.ssh_user, self.ssh_pass,
[start_hnd]):
raise(IOError(
'{0} start handler does not exist'.
Similar blocks of code found in 4 locations. Consider refactoring.
if not util.netutil.isfile(self.ip, self.ssh_port,
self.ssh_user, self.ssh_pass,
[stop_hnd]):
raise(IOError(
'{0} stop handler does not exist'.
Similar blocks of code found in 4 locations. Consider refactoring.
if exit_status == 0:
logging.info("[Oftraf] Successful stopping")
else:
raise(stress_test.oftraf_exceptions.OftrafStopError(
'Stop process exited with non zero exit code. '
Similar blocks of code found in 4 locations. Consider refactoring.
if exit_status == 0:
logging.info("[OFTraf] Successful building")
else:
raise(stress_test.oftraf_exceptions.OftrafBuildError(
'Build process exited with non zero exit code. '
Similar blocks of code found in 4 locations. Consider refactoring.
if exit_status == 0:
logging.info("[Oftraf] Successful starting")
else:
raise(stress_test.oftraf_exceptions.OftrafStartError(
'Start process exited with non zero exit code. '
Similar blocks of code found in 4 locations. Consider refactoring.
if exit_status == 0:
logging.info("[Oftraf] Successful cleaning")
else:
raise(stress_test.oftraf_exceptions.OftrafCleanError(
'clean process exited with non zero exit code. '
There are no issues that match your filters.