Repository navigation
Raise NotImplementedError in ScoringSystem.get and compute - #2553
Open
sc-lacanlale wants to merge 1 commit into
Open
sc-lacanlale wants to merge 1 commit into
sc-lacanlale wants to merge 1 commit into
Conversation
Fixes aboutcode-org#2552 Signed-off-by: Shanley Clarence <115960237+sc-lacanlale@users.noreply.github.com>
Jean-Regis-M
reviewed
Dec 3, 2026
Jean-Regis-M
left a comment
There was a problem hiding this comment.
I went through every caller of compute() and get() on main, to see whether a real raise could surprise anyone.
api.py,models.pyand both loops inviews.pyalready catchNotImplementedError. That only makes sense if the methods raise, so this matches what they expected.osv.py,osv_v2.pyandcompute_advisory_todo.pyonly callcompute()on the CVSS systems. The last one also wraps it intry/except Exception.- Migration 0032 calls it only for names ending in
_vector.
I found no caller that depended on getting the class back. I read the code and didn't run the new tests.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2552
ScoringSystem.compute(),ScoringSystem.get(), andEPSSScoringSystem.compute()usedreturn NotImplementedErrorinstead ofraise NotImplementedError, so callers catchingNotImplementedErrorreceived the truthy exception class instead of skipping unsupported scoring systems.Changes:
return NotImplementedErrortoraise NotImplementedErrorinvulnerabilities/severity_systems.py.vulnerabilities/tests/test_get_serverity.pyfor unimplementedScoringSystem,EPSS, andSSVCmethods.