You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This addresses the maintainer's concern about finding matching within
the same scan report.
Problem:
If findings 100 and 101 in the same report have identical hash_codes,
in a real import finding 101 would match against finding 100 (which was
just saved to the DB). In the previous dry_run implementation, this match
would not occur since finding 100 was never saved, leading to inaccurate
statistics.
Solution:
1. Track new findings in-memory during dry_run (self.dry_run_new_findings)
2. Updated match_new_finding_to_existing_finding() to check both:
- Database findings (existing behavior)
- In-memory findings from current scan (new for dry_run)
3. Split matching logic into helper methods:
- _get_db_matches(): Query database for matches
- _get_in_memory_matches(): Check in-memory findings (dry_run only)
4. When a new finding is created in dry_run, add it to the tracking list
Result:
Dry run now accurately simulates deduplication within the same scan report,
providing statistics that match what would actually happen in a real import.
This makes the dry_run feature much more reliable for previewing imports.
Updated documentation to reflect that this limitation has been resolved.
0 commit comments