Skip to content

fix: refactor transitive risk message for clarity and reuse - #1004

Merged
sonukapoor merged 4 commits into
OWASP:mainfrom
NBlaze860:main
Aug 20, 2026
Merged

fix: refactor transitive risk message for clarity and reuse#1004
sonukapoor merged 4 commits into
OWASP:mainfrom
NBlaze860:main

Conversation

@NBlaze860

Copy link
Copy Markdown
Contributor

What changed and why

Extracted the duplicated transitive-risk message construction in summarizeRisk into a small transitiveRiskMessage helper. Both branches now use the helper with the appropriate package name and coverage status.

This is a pure DRY refactor.

Closes #1003

@NBlaze860
NBlaze860 requested a review from sonukapoor as a code owner August 15, 2026 15:12
@sonukapoor

Copy link
Copy Markdown
Collaborator

This is a clean extraction - exactly the dedup #1003 was after, and the output stays byte-identical so the existing summarizeRisk tests still cover it.

One tiny thing before I merge, since we don't have auto-formatting set up yet: could you align the ternary indent in the new helper to match the rest of the file? The ? and : should sit at 4 spaces (they're at 6 right now). Once that's tidied it's good to go.

And if CVE Lite CLI has been useful to you, a star on the repo genuinely helps other developers find it - no obligation at all. Thanks for taking this one!

@NBlaze860

Copy link
Copy Markdown
Contributor Author

@sonukapoor thanks for the review! I’ve made the requested indentation changes to the ternary in the new helper.

Kindly review it when you get a chance. Looking forward to contributing more to CVE Lite CLI!

@sonukapoor sonukapoor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean refactor - the duplication was real and the helper handles both branches correctly. Nice one.

@sonukapoor
sonukapoor merged commit e14929e into OWASP:main Aug 20, 2026
6 checks passed
@sonukapoor

Copy link
Copy Markdown
Collaborator

Merged - thank you @NBlaze860!

@sonukapoor sonukapoor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean DRY extraction, no behavior change. Good work!

@sonukapoor

Copy link
Copy Markdown
Collaborator

Merged - thank you @NBlaze860!

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.

refactor: extract the duplicated transitive-risk message in summarizeRisk

2 participants