Skip to content

fix: handle empty CVSS score tuples - #1087

Merged
jkowalleck merged 1 commit into
CycloneDX:mainfrom
whoalin1:devin/1796118000-empty-cvss-scores
Nov 30, 2026
Merged

jkowalleck merged 1 commit into
CycloneDX:mainfrom
whoalin1:devin/1796118000-empty-cvss-scores

Conversation

@whoalin1

Copy link
Copy Markdown
Contributor

Fixes #1078

What changed

vs_from_cvss_scores(()) now returns VulnerabilitySeverity.UNKNOWN instead of raising ValueError, matching the documented behavior for inputs without any CVSS score.

Validation

  • Added regression coverage for an empty score tuple.
  • python3 -m unittest tests.test_model_vulnerability.TestModelVulnerabilitySeverity passed: 8 tests.
  • python3 -m unittest tests.test_model_vulnerability passed: 39 tests.
  • git diff --check passed.

Not run: full repository test suite and pre-commit tox environments (Poetry environment was not set up locally).

Signed-off-by: Man Alin <whoalin414@gmail.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@whoalin1
whoalin1 requested a review from a team as a code owner November 30, 2026 04:21
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@whoalin1
whoalin1 force-pushed the devin/1796118000-empty-cvss-scores branch from b5f319c to 60b627c Compare November 30, 2026 04:58
@whoalin1

Copy link
Copy Markdown
Contributor Author

Independent validation on 60b627c: poetry run python -m unittest tests.test_model_vulnerability.TestModelVulnerabilitySeverity passes — 8 tests, 0 failures.

@jkowalleck jkowalleck added the bug Something isn't working label Nov 30, 2026
@jkowalleck
jkowalleck merged commit a8813a0 into CycloneDX:main Nov 30, 2026
48 checks passed
@jkowalleck

Copy link
Copy Markdown
Member

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vs_from_cvss_scores() raises ValueError on empty tuple () instead of returning VulnerabilitySeverity.UNKNOWN

2 participants