Skip to content

feat(scanner): add finding deduplication to ResultAggregator - #89

Open
Senthemodder wants to merge 1 commit into
VeridionLabs:mainfrom
Senthemodder:fix/issue-20-result-deduplication
Open

feat(scanner): add finding deduplication to ResultAggregator#89
Senthemodder wants to merge 1 commit into
VeridionLabs:mainfrom
Senthemodder:fix/issue-20-result-deduplication

Conversation

@Senthemodder

Copy link
Copy Markdown

Fixes #20

Summary

Adds result deduplication to ResultAggregator for findings targeting the same file, line range, and vulnerability category.

Changes

  • Implemented deduplicateFindings() on ResultAggregator:
    • Groups findings by ${filePath}:${lineStart}:${lineEnd}:${category} (with fallback to pluginId when category is absent).
    • Prioritizes findings by severity rank: CRITICAL > HIGH > MEDIUM > LOW > GAS > INFORMATIONAL.
    • On equal severity, retains the finding with higher confidence.
  • Updated summarize() to compute summary totals and severity breakdowns over deduplicated results.
  • Added optional category property to FindingResult in @veridion/scanner-types and @veridion/shared.
  • Authored comprehensive test suite in packages/scanner-core/src/result-aggregator.test.ts verifying duplicate retention, severity prioritization, confidence tie-breaking, distinct location handling, and summary metrics.

Verification

  • pnpm --filter @veridion/scanner-core test: 21/21 passed (16 deduplication tests + 5 registry tests).
  • pnpm --filter @veridion/scanner-core typecheck: 0 errors.
  • pnpm --filter @veridion/scanner-core lint: 0 warnings.
  • Full workspace verification: 39/39 turbo tasks passed.

@Kami-no-san

Copy link
Copy Markdown
Contributor

Good Day, @Senthemodder Please fix failing CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scanner: Add result deduplication to ResultAggregator

2 participants