Skip to content
Snippets Groups Projects
Commit 005b2743 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Improve the logging of fuzzy matching.

parent 62ae0bbb
No related branches found
No related tags found
No related merge requests found
......@@ -53,16 +53,22 @@ def perform_fuzzy_matching(members1, members2):
(tlsh.diff(file1.fuzzy_hash, file2.fuzzy_hash), name2)
)
if comparisons:
comparisons.sort(key=operator.itemgetter(0))
score, name2 = comparisons[0]
logger.debug(
"fuzzy top match %s %s: %d difference score",
name1,
name2,
score,
)
if score < threshold:
yield name1, name2, score
if not comparisons:
continue
comparisons.sort(key=operator.itemgetter(0))
score, name2 = comparisons[0]
suffix = "will not compare files"
if score < threshold:
seen.add(name2)
yield name1, name2, score
suffix = "will compare files"
seen.add(name2)
logger.debug(
"Fuzzy matching %s %s (score: %d/400): %s",
name1,
name2,
score,
suffix,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment