intracom-telecom-sdn/nstat

View on GitHub
util/unittests/test_netutil.py

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 2 total issues

Function setUpClass has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def setUpClass(cls):
"""Prepares the setup environment for testing methods
ssh_connect_or_return, copy_to_target, make_remote_file_executable,
ssh_run_command. The method assumes that a VM of certain ip,
username, password is up. This method also creates a temporary file
Severity: Minor
Found in util/unittests/test_netutil.py - About 35 mins to fix

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

if __name__ == '__main__':
SUITE_NETUTILTEST = unittest.TestLoader().loadTestsFromTestCase(NetUtilTest)
unittest.TextTestRunner(verbosity=2).run(SUITE_NETUTILTEST)
Severity: Major
Found in util/unittests/test_netutil.py and 4 other locations - About 1 hr to fix
util/unittests/test_file.py on lines 116..119
util/unittests/test_plot_json.py on lines 107..110
util/unittests/test_process.py on lines 190..193
util/unittests/test_stats.py on lines 46..49

There are no issues that match your filters.

Category
Status