Line |
Col. |
Type |
Symbol |
ID |
Obj |
Message |
80 |
4 |
convention |
missing-function-docstring |
C0116 |
ImageData.check_params |
Missing function or method docstring |
102 |
4 |
convention |
missing-function-docstring |
C0116 |
ImageData.set_params |
Missing function or method docstring |
110 |
4 |
convention |
missing-function-docstring |
C0116 |
ImageData.extract_params |
Missing function or method docstring |
159 |
4 |
convention |
missing-function-docstring |
C0116 |
ImageData.get_np_shape |
Missing function or method docstring |
166 |
4 |
convention |
missing-function-docstring |
C0116 |
ImageData.check_data |
Missing function or method docstring |
186 |
4 |
convention |
missing-function-docstring |
C0116 |
ImageData.init_with_data |
Missing function or method docstring |
203 |
4 |
convention |
missing-function-docstring |
C0116 |
ImageData.init_with_random |
Missing function or method docstring |
219 |
4 |
convention |
missing-function-docstring |
C0116 |
ImageData.get_image_data |
Missing function or method docstring |
378 |
0 |
convention |
missing-function-docstring |
C0116 |
compare_image |
Missing function or method docstring |
408 |
0 |
convention |
missing-function-docstring |
C0116 |
assert_image_equal |
Missing function or method docstring |
Line |
Col. |
Type |
Symbol |
ID |
Obj |
Message |
14 |
0 |
convention |
invalid-name |
C0103 |
|
Class name "DATA_TYPE" doesn't conform to PascalCase naming style |
73 |
4 |
convention |
missing-function-docstring |
C0116 |
StreamData.get_np_shape |
Missing function or method docstring |
79 |
4 |
convention |
missing-function-docstring |
C0116 |
StreamData.get_stream_data |
Missing function or method docstring |
82 |
4 |
convention |
missing-function-docstring |
C0116 |
StreamData.check_params |
Missing function or method docstring |
108 |
4 |
convention |
missing-function-docstring |
C0116 |
StreamData.set_params |
Missing function or method docstring |
116 |
4 |
convention |
missing-function-docstring |
C0116 |
StreamData.extract_params |
Missing function or method docstring |
155 |
4 |
convention |
missing-function-docstring |
C0116 |
StreamData.check_data |
Missing function or method docstring |
175 |
4 |
convention |
missing-function-docstring |
C0116 |
StreamData.init_with_data |
Missing function or method docstring |
188 |
4 |
convention |
missing-function-docstring |
C0116 |
StreamData.init_with_random |
Missing function or method docstring |
332 |
0 |
convention |
missing-function-docstring |
C0116 |
compare_stream |
Missing function or method docstring |
361 |
0 |
convention |
missing-function-docstring |
C0116 |
assert_stream_equal |
Missing function or method docstring |
Line |
Col. |
Type |
Symbol |
ID |
Obj |
Message |
33 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_set_params |
Missing function or method docstring |
60 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_extract_params |
Missing function or method docstring |
148 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_check_data |
Missing function or method docstring |
194 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_check_params |
Missing function or method docstring |
236 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_init_with_data |
Missing function or method docstring |
246 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_init_with_random |
Missing function or method docstring |
260 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_equal_method |
Missing function or method docstring |
343 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_set_get_item |
Missing function or method docstring |
373 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_save_load |
Missing function or method docstring |
498 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_image_assertions |
Missing function or method docstring |
Line |
Col. |
Type |
Symbol |
ID |
Obj |
Message |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:161
==tests.data_handlers.test_stream_data:221
self.assertIn("'channels': 3", out_parts[4])
del out_parts[4]
self.assertEqual(
"\n".join(out_parts),
"*************************************************\n" +
"Data Check Error\n" +
"*************************************************\n" +
"- Extracted Parameters:\n"
"- Set Parameters:\n" +
"None\n" +
"*************************************************"
)
self.assertFalse(
check_result,
"check_data should return False because no params were set!"
)
uut.set_params({ |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:16
==tests.data_handlers.test_stream_data:17
class Test(unittest.TestCase):
'''
Testing class for ImageData class
'''
tmp_dir = ""
@classmethod
def setUpClass(cls):
# Create temporary directory for testdata files if not jet available
cls.tmp_dir = os.path.join(drever.__path__[0], "../../tmp")
if not os.path.exists(cls.tmp_dir): # pragma: no cover
os.makedirs(cls.tmp_dir)
print("tmp directory created: " + cls.tmp_dir)
def test_set_params(self):
set_of_valid_params = [ |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.test_stream_filter:14
==tests.test_video_filter:14
class Test(unittest.TestCase):
tmp_dir = ""
@classmethod
def setUpClass(cls):
# Create temporary directory for testdata files if not jet available
cls.tmp_dir = os.path.join(drever.__path__[0], "../../tmp")
if not os.path.exists(cls.tmp_dir): # pragma: no cover
os.makedirs(cls.tmp_dir)
print("tmp directory created: " + cls.tmp_dir)
def test_default_video_filter(self):
set_of_valid_params = [ |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.test_stream_filter:40
==tests.test_video_filter:40
stimulus.init_with_random()
uut.set_input_data(stimulus)
uut.run()
self.assertEqual(
uut.get_output_data(),
stimulus,
"Data missmatch!"
)
def test_vector_dump(self):
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==drever.data_handlers.image:172
==drever.data_handlers.stream:161
if extracted_params != self.params:
print("*************************************************")
print("Data Check Error")
print("*************************************************")
print("- Extracted Parameters:")
print(extracted_params)
print("- Set Parameters:")
print(self.params)
print("*************************************************")
return False
return True
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:294
==tests.data_handlers.test_stream_data:321
uut_b.init_with_random(1)
self.assertNotEqual(
uut_a,
uut_b,
"Data missmatch!"
)
# Equality not given due missmatching image params
for params in set_of_valid_params:
with self.subTest(params=params):
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:278
==tests.data_handlers.test_stream_data:305
uut_b.init_with_random(0)
self.assertEqual(
uut_a,
uut_b,
"Data missmatch!"
)
# Equality not given due missmatching image data
for params in set_of_valid_params:
with self.subTest(params=params):
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:52
==tests.data_handlers.test_stream_data:51
]
for params in set_of_failing_params:
with self.subTest(params=params):
with self.assertRaises(AssertionError):
uut.set_params(params)
def test_extract_params(self):
set_of_tests = [
{
'params': { |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.test_stream_filter:103
==tests.test_video_filter:106
with self.assertRaises(FileNotFoundError):
uut_b.load(filename + ".tmp")
# Add empty lines to see if bypassing is working
with open(filename, 'r') as uut_a_file:
origin_content = uut_a_file.read()
uut_a_file.close()
with open(filename, 'w') as uut_a_file:
uut_a_file.write(" \n")
uut_a_file.write(origin_content)
uut_a_file.close()
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==drever.data_handlers.image:97
==drever.data_handlers.stream:103
return False
return True
def set_params(self, params):
if params is None:
self.params = None
elif self.check_params(params, True):
self.params = params
@classmethod |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:372
==tests.data_handlers.test_stream_data:391
def test_save_load(self):
def add_empty_line(filename):
with open(filename, 'r') as tmp_file:
origin_content = tmp_file.read()
tmp_file.close()
with open(filename, 'w') as tmp_file:
tmp_file.write(" \n")
tmp_file.write(origin_content)
tmp_file.close()
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:327
==tests.data_handlers.test_stream_data:354
uut_b.init_with_random(0)
# unsupported types must return NotImplemented flag
self.assertEqual(
uut_a.__eq__("Strings aren't objs from ImageData class."),
NotImplemented,
"Type missmatch!"
)
self.assertEqual(
uut_a, |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 4 files
==tests.data_handlers.test_image_data:21
==tests.data_handlers.test_stream_data:22
==tests.test_stream_filter:16
==tests.test_video_filter:16
tmp_dir = ""
@classmethod
def setUpClass(cls):
# Create temporary directory for testdata files if not jet available
cls.tmp_dir = os.path.join(drever.__path__[0], "../../tmp")
if not os.path.exists(cls.tmp_dir): # pragma: no cover
os.makedirs(cls.tmp_dir)
print("tmp directory created: " + cls.tmp_dir)
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==drever.stream_filter:18
==drever.video_filter:18
}
# Overwrite this dictionary with your default Drever algorithm parameters.
DEFAULT_PARAMS = {}
def run(self):
self._set_output_data(self.get_input_data())
@classmethod
def dump_vectors(cls, path, vectors):
vectors.save(path, False) |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:313
==tests.data_handlers.test_stream_data:340
self.assertNotEqual(
uut_a,
uut_b,
"Params missmatch!"
)
# Equality not given due missmatching class type
for params in set_of_valid_params:
with self.subTest(params=params):
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.test_stream_filter:90
==tests.test_video_filter:93
if os.path.exists(filename): # pragma: no cover
os.remove(filename)
uut.set_input_data(uut_a)
uut.dump_input_vectors(filename)
# Saving again must raise an error
with self.assertRaises(FileExistsError):
uut.dump_input_vectors(filename)
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:226
==tests.data_handlers.test_stream_data:200
for test in set_of_tests:
with self.subTest(test=test):
self.assertEqual(
uut.check_params(test["params"], False),
test["expected"],
"check_params result missmatch!"
)
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:401
==tests.test_video_filter:71
},
{
"params": {
"width": 20,
"height": 10,
"bitdepth": 16,
"channels": 3
}, |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:392
==tests.test_video_filter:62
},
{
"params": {
"width": 20,
"height": 10,
"bitdepth": 10,
"channels": 2
}, |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:383
==tests.test_video_filter:53
ppm_files = [
{
"params": {
"width": 20,
"height": 10,
"bitdepth": 8,
"channels": 1
}, |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_stream_data:463
==tests.test_stream_filter:115
uut_b.load(filename)
np.testing.assert_array_equal(
uut_b.get_stream_data(),
uut_a.get_stream_data(),
"Data Missmatch"
)
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==drever.data_handlers.image:411
==drever.data_handlers.stream:364
if result["num_errors"] < 0:
total_msg = "Image Parameter Missmatch!\n"
total_msg += msg
assert result["num_errors"] == 0, total_msg
elif result["num_errors"] > 0:
total_msg = "Image Data Missmatch!\n"
total_msg += msg
assert result["num_errors"] == 0, total_msg |
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==drever.data_handlers.image:65
==drever.data_handlers.stream:58
elif isinstance(obj["obj"], np.ndarray):
obj["data"] = obj["obj"]
else:
return NotImplemented
if not np.array_equal(objs[0]["data"], objs[1]["data"]):
return False
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_image_data:140
==tests.data_handlers.test_stream_data:146
with self.subTest(extracted=extracted, expected=test['expected']):
self.assertDictEqual(
extracted,
test['expected'],
'Extracted params missmatch!'
)
|
1 |
0 |
refactor |
duplicate-code |
R0801 |
|
Similar lines in 2 files
==tests.data_handlers.test_stream_data:402
==tests.test_stream_filter:53
txt_files = [
{
"params": {
"size": 10,
"data_width": 8,
"channels": 1
}, |
34 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_set_params |
Missing function or method docstring |
59 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_extract_params |
Missing function or method docstring |
171 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_check_params |
Missing function or method docstring |
209 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_check_data |
Missing function or method docstring |
254 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_init_with_data |
Missing function or method docstring |
261 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_init_with_random |
Missing function or method docstring |
288 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_equal_method |
Missing function or method docstring |
370 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_set_get_item |
Missing function or method docstring |
392 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_save_load |
Missing function or method docstring |
472 |
4 |
convention |
missing-function-docstring |
C0116 |
Test.test_stream_assertions |
Missing function or method docstring |