diff --git a/.travis.yml b/.travis.yml index 286243c..94df0a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ install: script: - nosetests --with-coverage --cover-package=stegano + - mypy --ignore-missing-imports --follow-imports skip --check-untyped-defs stegano/ after_success: - coveralls diff --git a/stegano/steganalysis/statistics.py b/stegano/steganalysis/statistics.py index d3e622e..60ff72f 100644 --- a/stegano/steganalysis/statistics.py +++ b/stegano/steganalysis/statistics.py @@ -37,16 +37,17 @@ def steganalyse(img): """ encoded = img.copy() width, height = img.size - colours = Counter() + colours_counter = Counter() # type: Counter[int] for row in range(height): for col in range(width): r, g, b = img.getpixel((col, row)) - colours[r] += 1 + colours_counter[r] += 1 - most_common = colours.most_common(10) - dict_colours = OrderedDict(sorted(list(colours.items()), key=lambda t: t[1])) + most_common = colours_counter.most_common(10) + dict_colours = OrderedDict(sorted(list(colours_counter.items()), + key=lambda t: t[1])) - colours = 0 + colours = 0 # type: float for colour in list(dict_colours.keys()): colours += colour colours = colours / len(dict_colours)