intracom-telecom-sdn/nstat

View on GitHub

Showing 544 of 544 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

[('controller_name', 'Controller name'),
('controller_build_handler', 'Controller build script'),
('controller_start_handler', 'Controller start script'),
('controller_stop_handler', 'Controller stop script'),
('controller_status_handler', 'Controller status script'),
Severity: Major
Found in stress_test/report_spec_templates.py and 1 other location - About 7 hrs to fix
stress_test/report_spec_templates.py on lines 367..406

Similar blocks of code found in 2 locations. Consider refactoring.
Open

[('global_sample_id', 'Sample ID'),
('timestamp', 'Sample timestamp (seconds)'),
('date', 'Sample timestamp (date)'),
('of_out_bytes_per_sec',
'Outgoing controller throughput '
Severity: Major
Found in stress_test/report_spec_templates.py and 1 other location - About 7 hrs to fix
stress_test/report_spec_templates.py on lines 611..646

Similar blocks of code found in 2 locations. Consider refactoring.
Open

[('number_of_samples', 'Test repeats'),
('controller_name', 'Controller name'),
('controller_build_handler', 'Controller build script'),
('controller_start_handler', 'Controller start script'),
('controller_stop_handler', 'Controller stop script'),
Severity: Major
Found in stress_test/report_spec_templates.py and 1 other location - About 7 hrs to fix
stress_test/report_spec_templates.py on lines 464..494

Similar blocks of code found in 2 locations. Consider refactoring.
Open

[('global_sample_id', 'Sample ID'),
('timestamp', 'Sample timestamp (seconds)'),
('date', 'Sample timestamp (date)'),
('discovered_switches_error_code', 'Error code'),
('successful_bootup_time',
Severity: Major
Found in stress_test/report_spec_templates.py and 1 other location - About 7 hrs to fix
stress_test/report_spec_templates.py on lines 514..549

Similar blocks of code found in 4 locations. Consider refactoring.
Open

def _error_handling(self, error_message, error_num=1):
"""
Handles custom errors of sb emulators
 
:param error_message: message of the handled error
Severity: Major
Found in stress_test/sbemu.py and 3 other locations - About 6 hrs to fix
stress_test/controller.py on lines 83..105
stress_test/nbemu.py on lines 77..98
stress_test/oftraf.py on lines 49..71

Similar blocks of code found in 4 locations. Consider refactoring.
Open

def _error_handling(self, error_message, error_num=1):
"""
Handles custom errors of nb_emulator
 
:param error_message: message of the handled error
Severity: Major
Found in stress_test/nbemu.py and 3 other locations - About 6 hrs to fix
stress_test/controller.py on lines 83..105
stress_test/oftraf.py on lines 49..71
stress_test/sbemu.py on lines 74..95

Similar blocks of code found in 4 locations. Consider refactoring.
Open

def _error_handling(self, error_message, error_num=1):
"""
Handles custom errors of oftraf
 
:param error_message: message of the handled error
Severity: Major
Found in stress_test/oftraf.py and 3 other locations - About 6 hrs to fix
stress_test/controller.py on lines 83..105
stress_test/nbemu.py on lines 77..98
stress_test/sbemu.py on lines 74..95

Similar blocks of code found in 4 locations. Consider refactoring.
Open

def _error_handling(self, error_message, error_num=1):
"""
Handles custom errors of controller
 
:param error_message: message of the handled error
Severity: Major
Found in stress_test/controller.py and 3 other locations - About 6 hrs to fix
stress_test/nbemu.py on lines 77..98
stress_test/oftraf.py on lines 49..71
stress_test/sbemu.py on lines 74..95

Identical blocks of code found in 4 locations. Consider refactoring.
Open

try:
# OFTRAF preparation
# ------------------------------------------------------------------
self.of.build()
 
 
Severity: Major
Found in stress_test/test_run.py and 3 other locations - About 6 hrs to fix
stress_test/test_run.py on lines 340..406
stress_test/test_run.py on lines 459..511
stress_test/test_run.py on lines 679..840

Identical blocks of code found in 4 locations. Consider refactoring.
Open

try:
 
# Configuring controller for FLOWS_MODS
# ------------------------------------------------------------------
self.ctrl.flowmods_config()
Severity: Major
Found in stress_test/test_run.py and 3 other locations - About 6 hrs to fix
stress_test/test_run.py on lines 459..511
stress_test/test_run.py on lines 558..626
stress_test/test_run.py on lines 679..840

Identical blocks of code found in 4 locations. Consider refactoring.
Open

try:
global_sample_id = 0
for (self.sb_emu.topo_size,
self.sb_emu.topo_group_size,
self.sb_emu.topo_group_delay_ms,
Severity: Major
Found in stress_test/test_run.py and 3 other locations - About 6 hrs to fix
stress_test/test_run.py on lines 340..406
stress_test/test_run.py on lines 558..626
stress_test/test_run.py on lines 679..840

Identical blocks of code found in 4 locations. Consider refactoring.
Open

try:
self.ctrl.flowmods_config()
 
# TEST run
# ---------------------------------------------------------------
Severity: Major
Found in stress_test/test_run.py and 3 other locations - About 6 hrs to fix
stress_test/test_run.py on lines 340..406
stress_test/test_run.py on lines 459..511
stress_test/test_run.py on lines 558..626

Function test_selector has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def test_selector(self, args):
"""
Selects which test to run depending on the information coming from
the args object. nstat_test_type_run variable contains information
test_type + sb_emulator_name, necessary to select which test to run.
Severity: Minor
Found in stress_test/test_type.py - About 5 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def __del__(self):
"""
Method called when object is destroyed"""
try:
logging.info('Cleaning NB-Generator.')
Severity: Major
Found in stress_test/nbemu.py and 1 other location - About 5 hrs to fix
stress_test/sbemu.py on lines 199..213

Similar blocks of code found in 2 locations. Consider refactoring.
Open

def __del__(self):
"""
Method called when object is destroyed
"""
try:
Severity: Major
Found in stress_test/sbemu.py and 1 other location - About 5 hrs to fix
stress_test/nbemu.py on lines 261..275

Similar blocks of code found in 6 locations. Consider refactoring.
Open

def test_totam_ramb(self):
"""Test functionality of sysstats.sys_total_memory_bytes function
"""
 
var = util.sysstats.sys_total_memory_bytes()
Severity: Major
Found in util/unittests/test_sysstats.py and 5 other locations - About 5 hrs to fix
util/unittests/test_sysstats.py on lines 51..60
util/unittests/test_sysstats.py on lines 62..71
util/unittests/test_sysstats.py on lines 73..82
util/unittests/test_sysstats.py on lines 84..93
util/unittests/test_sysstats.py on lines 133..141

Similar blocks of code found in 6 locations. Consider refactoring.
Open

def test_used_ram(self):
"""Test functionality of sysstats.sys_free_ram_mb function.
"""
 
var = util.sysstats.sys_used_ram_mb()
Severity: Major
Found in util/unittests/test_sysstats.py and 5 other locations - About 5 hrs to fix
util/unittests/test_sysstats.py on lines 62..71
util/unittests/test_sysstats.py on lines 73..82
util/unittests/test_sysstats.py on lines 84..93
util/unittests/test_sysstats.py on lines 95..104
util/unittests/test_sysstats.py on lines 133..141

Similar blocks of code found in 6 locations. Consider refactoring.
Open

def test_used_ramb(self):
"""Test functionality of sysstats.sys_used_memory_bytes function
"""
 
var = util.sysstats.sys_used_memory_bytes()
Severity: Major
Found in util/unittests/test_sysstats.py and 5 other locations - About 5 hrs to fix
util/unittests/test_sysstats.py on lines 51..60
util/unittests/test_sysstats.py on lines 62..71
util/unittests/test_sysstats.py on lines 84..93
util/unittests/test_sysstats.py on lines 95..104
util/unittests/test_sysstats.py on lines 133..141

Similar blocks of code found in 6 locations. Consider refactoring.
Open

def test_free_ramb(self):
"""Test functionality of sysstats.sys_free_memory_bytes function
"""
 
var = util.sysstats.sys_free_memory_bytes()
Severity: Major
Found in util/unittests/test_sysstats.py and 5 other locations - About 5 hrs to fix
util/unittests/test_sysstats.py on lines 51..60
util/unittests/test_sysstats.py on lines 62..71
util/unittests/test_sysstats.py on lines 73..82
util/unittests/test_sysstats.py on lines 95..104
util/unittests/test_sysstats.py on lines 133..141

Similar blocks of code found in 6 locations. Consider refactoring.
Open

def test_free_ram(self):
"""Test functionality of sysstats.sys_free_ram_mb function
"""
 
var = util.sysstats.sys_free_ram_mb()
Severity: Major
Found in util/unittests/test_sysstats.py and 5 other locations - About 5 hrs to fix
util/unittests/test_sysstats.py on lines 51..60
util/unittests/test_sysstats.py on lines 73..82
util/unittests/test_sysstats.py on lines 84..93
util/unittests/test_sysstats.py on lines 95..104
util/unittests/test_sysstats.py on lines 133..141
Severity
Category
Status
Source
Language