intracom-telecom-sdn/nstat

View on GitHub
stress_test/test_type.py

Summary

Maintainability
F
1 wk
Test Coverage

Showing 12 of 12 total issues

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

Cyclomatic complexity is too high in method test_selector. (23)
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 by radon

Cyclomatic complexity is too high in class TestType. (8)
Open

class TestType:
"""
Creates a TestType object
"""
def __init__(self, args):
Severity: Minor
Found in stress_test/test_type.py by radon

Cyclomatic complexity is too high in method set_test_log_level. (6)
Open

def set_test_log_level(self, args):
"""
Setting log level for NSTAT experiment
 
:param args: ArgumentParser object containing user specified \
Severity: Minor
Found in stress_test/test_type.py by radon

Function set_test_log_level has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def set_test_log_level(self, args):
"""
Setting log level for NSTAT experiment
 
:param args: ArgumentParser object containing user specified \
Severity: Minor
Found in stress_test/test_type.py - About 45 mins to fix

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

elif nstat_test_type_run == 'sb_active_scalability_multinet':
if not args.bypass_test:
logging.info('[nstat] running test: {0}'.
format(nstat_test_type_run))
self.total_samples = \
Severity: Major
Found in stress_test/test_type.py and 6 other locations - About 1 day to fix
stress_test/test_type.py on lines 102..122
stress_test/test_type.py on lines 124..144
stress_test/test_type.py on lines 168..188
stress_test/test_type.py on lines 190..210
stress_test/test_type.py on lines 211..231
stress_test/test_type.py on lines 233..253

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

elif nstat_test_type_run == 'nb_active_scalability_multinet':
if not args.bypass_test:
logging.info('[nstat] running test: {0}'.
format(nstat_test_type_run))
self.total_samples = \
Severity: Major
Found in stress_test/test_type.py and 6 other locations - About 1 day to fix
stress_test/test_type.py on lines 102..122
stress_test/test_type.py on lines 124..144
stress_test/test_type.py on lines 146..166
stress_test/test_type.py on lines 168..188
stress_test/test_type.py on lines 190..210
stress_test/test_type.py on lines 211..231

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

elif nstat_test_type_run == 'sb_active_stability_mtcbench':
if not args.bypass_test:
logging.info('[nstat] running test:{0}'.
format(nstat_test_type_run))
self.total_samples = \
Severity: Major
Found in stress_test/test_type.py and 6 other locations - About 1 day to fix
stress_test/test_type.py on lines 102..122
stress_test/test_type.py on lines 146..166
stress_test/test_type.py on lines 168..188
stress_test/test_type.py on lines 190..210
stress_test/test_type.py on lines 211..231
stress_test/test_type.py on lines 233..253

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

if nstat_test_type_run == 'sb_active_scalability_mtcbench':
if not args.bypass_test:
logging.info('[nstat] running test: {0}'.
format(nstat_test_type_run))
self.total_samples = \
Severity: Major
Found in stress_test/test_type.py and 6 other locations - About 1 day to fix
stress_test/test_type.py on lines 124..144
stress_test/test_type.py on lines 146..166
stress_test/test_type.py on lines 168..188
stress_test/test_type.py on lines 190..210
stress_test/test_type.py on lines 211..231
stress_test/test_type.py on lines 233..253

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

elif nstat_test_type_run == 'sb_idle_stability_multinet':
if not args.bypass_test:
logging.info('[nstat] running test: {0}'.
format(nstat_test_type_run))
self.total_samples = \
Severity: Major
Found in stress_test/test_type.py and 6 other locations - About 1 day to fix
stress_test/test_type.py on lines 102..122
stress_test/test_type.py on lines 124..144
stress_test/test_type.py on lines 146..166
stress_test/test_type.py on lines 168..188
stress_test/test_type.py on lines 190..210
stress_test/test_type.py on lines 233..253

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

elif nstat_test_type_run == 'sb_idle_scalability_mtcbench':
if not args.bypass_test:
logging.info('[nstat] running test: {0}'.
format(nstat_test_type_run))
self.total_samples = \
Severity: Major
Found in stress_test/test_type.py and 6 other locations - About 1 day to fix
stress_test/test_type.py on lines 102..122
stress_test/test_type.py on lines 124..144
stress_test/test_type.py on lines 146..166
stress_test/test_type.py on lines 190..210
stress_test/test_type.py on lines 211..231
stress_test/test_type.py on lines 233..253

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

elif nstat_test_type_run == 'sb_idle_scalability_multinet':
if not args.bypass_test:
logging.info('[nstat] running test: {0}'.
format(nstat_test_type_run))
self.total_samples = \
Severity: Major
Found in stress_test/test_type.py and 6 other locations - About 1 day to fix
stress_test/test_type.py on lines 102..122
stress_test/test_type.py on lines 124..144
stress_test/test_type.py on lines 146..166
stress_test/test_type.py on lines 168..188
stress_test/test_type.py on lines 211..231
stress_test/test_type.py on lines 233..253
Category
Status