File monitor.py
has 971 lines of code (exceeds 250 allowed). Consider refactoring.
Function monitor_thread_active
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
def monitor_thread_active(self):
"""
This monitor function is used from south bound active mtcbench \
tests to put into gevent queue the results during test running
"""
Cyclomatic complexity is too high in method monitor_thread_active. (8)
def monitor_thread_active(self):
"""
This monitor function is used from south bound active mtcbench \
tests to put into gevent queue the results during test running
"""
Function monitor_thread_idle
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
def monitor_thread_idle(self, boot_start_time):
"""
This monitor function is used from south bound idle mtcbench \
tests to put into gevent queue the results during test running
Function monitor_thread_idle_scalability
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
def monitor_thread_idle_scalability(self, boot_start_time):
"""
This monitor function is used from both idle scalability multinet tests
tests to put into gevent queue the results during test running
Cyclomatic complexity is too high in method monitor_thread_idle. (7)
def monitor_thread_idle(self, boot_start_time):
"""
This monitor function is used from south bound idle mtcbench \
tests to put into gevent queue the results during test running
Cyclomatic complexity is too high in method monitor_thread_idle_scalability. (7)
def monitor_thread_idle_scalability(self, boot_start_time):
"""
This monitor function is used from both idle scalability multinet tests
tests to put into gevent queue the results during test running
Cyclomatic complexity is too high in method monitor_run. (7)
def monitor_run(self, reference_results=None, sample_id=None,
boot_start_time=None):
"""
This monitor function is used from both south bound active and idle \
multinet tests to get the results from gevent queue
Function monitor_thread_active
has 29 lines of code (exceeds 25 allowed). Consider refactoring.
def monitor_thread_active(self):
"""
This monitor function is used from active scalability multinet tests
to put the results into gevent queue
"""
Function monitor_thread_idle_stability
has 28 lines of code (exceeds 25 allowed). Consider refactoring.
def monitor_thread_idle_stability(self, reference_results, sample_id):
"""
This monitor function is used from idle stability multinet tests \
to put the results into gevent queue
Function __poll_flows_ds_confirm
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def __poll_flows_ds_confirm(self, expected_flows):
"""
Monitors operational DS until the expected number of flows are found
or the deadline is reached.
Function __poll_flows_ds
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def __poll_flows_ds(self, t_start, expected_flows):
"""
Monitors operational DS from the time the transmission starts from NB
towards the controller until the expected number of flows are
found or the deadline is reached.
Function __poll_flows_switches
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def __poll_flows_switches(self, t_start, expected_flows):
"""
Monitors installed flows into switches of Multinet from the first REST
request, until the expected number of flows are found or the deadline
is reached.
Function monitor_results_add
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
def monitor_results_add(self, add_controller_time,
results_thread, total_failed_flows):
"""
This monitor function is used to create the result dictionary during \
an add flows action
Function monitor_run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def monitor_run(self, reference_results=None, sample_id=None,
boot_start_time=None):
"""
This monitor function is used from both south bound active and idle \
multinet tests to get the results from gevent queue
Function monitor_results_add
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def monitor_results_add(self, add_controller_time,
results_thread, total_failed_flows):
"""
This monitor function is used to create the result dictionary during \
an add flows action
Similar blocks of code found in 2 locations. Consider refactoring.
if (time.time() - t_discovery_start) > \
self.nbgen.flows_ds_discovery_deadline:
logging.info('[NB_emulator] [Poll_flows thread] Deadline of '
'{0} seconds passed'
.format(self.nbgen.flows_ds_discovery_deadline))
Similar blocks of code found in 2 locations. Consider refactoring.
if (time.time() - t_discovery_start) > \
self.nbgen.flows_ds_discovery_deadline:
logging.info('[NB_emulator] [Poll_flows_confirm thread] '
' Deadline of {0} seconds passed'
.format(self.flows_ds_discovery_deadline))
Similar blocks of code found in 3 locations. Consider refactoring.
if results_thread['end_to_end_flows_operation_time'] != -1:
results['end_to_end_installation_rate'] = \
float(self.nbgen.total_flows) / \
results_thread['end_to_end_flows_operation_time']
else:
Similar blocks of code found in 3 locations. Consider refactoring.
if results_thread['switch_operation_time'] != -1:
results['add_switch_rate'] = \
float(self.nbgen.total_flows) / \
results_thread['switch_operation_time']
else:
Similar blocks of code found in 3 locations. Consider refactoring.
if results_thread['confirm_time'] != -1:
results['add_confirm_rate'] = \
float(self.nbgen.total_flows) / results_thread['confirm_time']
else:
results['add_confirm_rate'] = -1
Similar blocks of code found in 2 locations. Consider refactoring.
if (time.time() - t_discovery_start) > \
self.nbgen.flows_ds_discovery_deadline:
logging.info('[NB_emulator] [Poll_flows_switches thread] '
'Deadline of {0} seconds passed'
.format(self.flows_ds_discovery_deadline))
Similar blocks of code found in 8 locations. Consider refactoring.
results['tcp_of_out_packets_per_sec'] = \
(abs(float(oftraf_monitor_results['tcp_of_out_traffic'][0])) -
reference_results['tcp_of_out_traffic'][0]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['of_in_packets_per_sec'] = \
(abs(float(oftraf_monitor_results['of_in_traffic'][0])) -
reference_results['of_in_traffic'][0]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['tcp_of_out_bytes_per_sec'] = \
(abs(float(oftraf_monitor_results['tcp_of_out_traffic'][1])) -
reference_results['tcp_of_out_traffic'][1]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['of_in_bytes_per_sec'] = \
(abs(float(oftraf_monitor_results['of_in_traffic'][1])) -
reference_results['of_in_traffic'][1]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['tcp_of_in_bytes_per_sec'] = \
(abs(float(oftraf_monitor_results['tcp_of_in_traffic'][1])) -
reference_results['tcp_of_in_traffic'][1]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['of_out_bytes_per_sec'] = \
(abs(float(oftraf_monitor_results['of_out_traffic'][1])) -
reference_results['of_out_traffic'][1]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['of_out_packets_per_sec'] = \
(abs(float(oftraf_monitor_results['of_out_traffic'][0])) -
reference_results['of_out_traffic'][0]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['tcp_of_in_packets_per_sec'] = \
(abs(float(oftraf_monitor_results['tcp_of_in_traffic'][0])) -
reference_results['tcp_of_in_traffic'][0]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['of_in_packets_per_sec'] = \
float(oftraf_monitor_results['of_in_traffic'][0]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['tcp_of_in_bytes_per_sec'] = \
float(oftraf_monitor_results['tcp_of_in_traffic'][1]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['of_out_packets_per_sec'] = \
float(oftraf_monitor_results['of_out_traffic'][0]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['of_in_bytes_per_sec'] = \
float(oftraf_monitor_results['of_in_traffic'][1]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['of_out_bytes_per_sec'] = \
float(oftraf_monitor_results['of_out_traffic'][1]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['tcp_of_out_packets_per_sec'] = \
float(oftraf_monitor_results['tcp_of_out_traffic'][0]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['tcp_of_out_bytes_per_sec'] = \
float(oftraf_monitor_results['tcp_of_out_traffic'][1]) / traffic_gen_ms
Similar blocks of code found in 8 locations. Consider refactoring.
results['tcp_of_in_packets_per_sec'] = \
float(oftraf_monitor_results['tcp_of_in_traffic'][0]) / traffic_gen_ms
There are no issues that match your filters.