Skip to content

Commit edd8c04

Browse files
improve logging
1 parent 93382b0 commit edd8c04

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

dojo/finding/deduplication.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def match_hash_candidate(new_finding, candidates_by_hash):
359359
if new_finding.hash_code is None:
360360
return None
361361
possible_matches = candidates_by_hash.get(new_finding.hash_code, [])
362-
deduplicationLogger.debug(f"Found {len(possible_matches)} findings with same hash_code, ids={[(c.id, c.hash_code) for c in possible_matches]}")
362+
deduplicationLogger.debug(f"Finding {new_finding.id}: Found {len(possible_matches)} findings with same hash_code, ids={[(c.id, c.hash_code) for c in possible_matches]}")
363363

364364
for candidate in possible_matches:
365365
if not _is_candidate_older(new_finding, candidate):
@@ -377,7 +377,7 @@ def match_unique_id_candidate(new_finding, candidates_by_uid):
377377
return None
378378

379379
possible_matches = candidates_by_uid.get(new_finding.unique_id_from_tool, [])
380-
deduplicationLogger.debug(f"Found {len(possible_matches)} findings with same unique_id_from_tool, ids={[(c.id, c.unique_id_from_tool) for c in possible_matches]}")
380+
deduplicationLogger.debug(f"Finding {new_finding.id}: Found {len(possible_matches)} findings with same unique_id_from_tool, ids={[(c.id, c.unique_id_from_tool) for c in possible_matches]}")
381381
for candidate in possible_matches:
382382
if not _is_candidate_older(new_finding, candidate):
383383
deduplicationLogger.debug("UID: newer candidate, skipping dedupe.")
@@ -393,11 +393,11 @@ def match_uid_or_hash_candidate(new_finding, candidates_by_uid, candidates_by_ha
393393
# Combine UID and hash candidates and walk oldest-first
394394
uid_list = candidates_by_uid.get(new_finding.unique_id_from_tool, []) if new_finding.unique_id_from_tool is not None else []
395395
hash_list = candidates_by_hash.get(new_finding.hash_code, []) if new_finding.hash_code is not None else []
396-
deduplicationLogger.debug("UID_OR_HASH: uid_list ids=%s hash_list ids=%s", [c.id for c in uid_list], [c.id for c in hash_list])
396+
deduplicationLogger.debug("Finding %s: UID_OR_HASH: uid_list ids=%s hash_list ids=%s", new_finding.id, [c.id for c in uid_list], [c.id for c in hash_list])
397397
combined_by_id = {c.id: c for c in uid_list}
398398
for c in hash_list:
399399
combined_by_id.setdefault(c.id, c)
400-
deduplicationLogger.debug("UID_OR_HASH: combined candidate ids (sorted)=%s", sorted(combined_by_id.keys()))
400+
deduplicationLogger.debug("Finding %s: UID_OR_HASH: combined candidate ids (sorted)=%s", new_finding.id, sorted(combined_by_id.keys()))
401401
for candidate_id in sorted(combined_by_id.keys()):
402402
candidate = combined_by_id[candidate_id]
403403
if not _is_candidate_older(new_finding, candidate):

0 commit comments

Comments
 (0)