intracom-telecom-sdn/nstat

View on GitHub
util/unittests/test_plot_json.py

Summary

Maintainability
C
1 day
Test Coverage

Showing 7 of 7 total issues

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

def test_multi_scatter(self):
"""
Checks the multy_scatter() method of util/plot_json.py
It checks the case of invalid json input.
"""
Severity: Major
Found in util/unittests/test_plot_json.py and 5 other locations - About 1 hr to fix
util/unittests/test_plot_json.py on lines 17..29
util/unittests/test_plot_json.py on lines 31..44
util/unittests/test_plot_json.py on lines 46..59
util/unittests/test_plot_json.py on lines 76..89
util/unittests/test_plot_json.py on lines 91..105

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

def test_errorbar(self):
"""Checks the errorbar() method of util/plot_json.py.
It checks the case of invalid json input.
"""
with self.assertRaises(KeyError):
Severity: Major
Found in util/unittests/test_plot_json.py and 5 other locations - About 1 hr to fix
util/unittests/test_plot_json.py on lines 31..44
util/unittests/test_plot_json.py on lines 46..59
util/unittests/test_plot_json.py on lines 61..74
util/unittests/test_plot_json.py on lines 76..89
util/unittests/test_plot_json.py on lines 91..105

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

def test_multi_errorbar(self):
"""
Checks the multi_errorbar() function of util/plot_json.py.
It checks the case of invalid json input.
"""
Severity: Major
Found in util/unittests/test_plot_json.py and 5 other locations - About 1 hr to fix
util/unittests/test_plot_json.py on lines 17..29
util/unittests/test_plot_json.py on lines 31..44
util/unittests/test_plot_json.py on lines 46..59
util/unittests/test_plot_json.py on lines 61..74
util/unittests/test_plot_json.py on lines 91..105

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

def test_scatter(self):
"""
Checks the scatter() method of util/plot_json.py.
It checks the case of invalid json input.
"""
Severity: Major
Found in util/unittests/test_plot_json.py and 5 other locations - About 1 hr to fix
util/unittests/test_plot_json.py on lines 17..29
util/unittests/test_plot_json.py on lines 31..44
util/unittests/test_plot_json.py on lines 61..74
util/unittests/test_plot_json.py on lines 76..89
util/unittests/test_plot_json.py on lines 91..105

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

def test_errorbar_connected(self):
"""Checks the errorbar_connected() method of
util/plot_json.py. It checks the case of invalid json input.
"""
with self.assertRaises(KeyError):
Severity: Major
Found in util/unittests/test_plot_json.py and 5 other locations - About 1 hr to fix
util/unittests/test_plot_json.py on lines 17..29
util/unittests/test_plot_json.py on lines 46..59
util/unittests/test_plot_json.py on lines 61..74
util/unittests/test_plot_json.py on lines 76..89
util/unittests/test_plot_json.py on lines 91..105

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

def test_multi_errorbar_connected(self):
"""
Method that checks the multi_errorbar_connected() function of
util/plot_json.py. It checks the case of invalid json input.
"""
Severity: Major
Found in util/unittests/test_plot_json.py and 5 other locations - About 1 hr to fix
util/unittests/test_plot_json.py on lines 17..29
util/unittests/test_plot_json.py on lines 31..44
util/unittests/test_plot_json.py on lines 46..59
util/unittests/test_plot_json.py on lines 61..74
util/unittests/test_plot_json.py on lines 76..89

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

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