Skip to content

Fix benchmark handling for scanners without rule names - #356

Open
deep-sengupta wants to merge 2 commits into
Samsung:mainfrom
deep-sengupta:fix-ruleless-scanner-results
Open

deep-sengupta wants to merge 2 commits into
Samsung:mainfrom
deep-sengupta:fix-ruleless-scanner-results

Conversation

@deep-sengupta

Copy link
Copy Markdown
Contributor

Summary

  • Handle scanner findings that do not provide a CredData rule name.
  • Avoid creating invalid metadata rows with an empty category.
  • Preserve existing rule-based matching behavior.
  • Add regression tests for rule-less detections, missing metadata, duplicate findings, and existing rule-based matching.

Problem

Some scanner adapters pass a file path and line number to check_line_from_meta() without providing a rule name. The method can attempt to create a MetaRow with an empty Category, which may raise a ValueError.

Solution

Handle rule-less detections explicitly and defer metadata-row creation until it is needed. Keep metadata validation unchanged, define consistent matching and counting behavior for findings without rule names, and use a non-empty fallback category when saving new metadata in fix mode.

Testing

  • Rule-less scanner regression tests pass.
  • Existing unit tests pass.
  • Rule-based matching behavior remains unchanged.
  • git diff --check passes.

@deep-sengupta
deep-sengupta requested a review from a team as a code owner October 27, 2026 08:14
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.

1 participant