Skip to content

ScoringSystem.get() and compute() return NotImplementedError instead of raising it #2552

Backlog

Description

@sc-lacanlale

ScoringSystem.compute(), ScoringSystem.get(), and EPSSScoringSystem.compute() in vulnerabilities/severity_systems.py (lines 39, 42, 230) use return NotImplementedError instead of raise NotImplementedError.

All four callers of ScoringSystem.get() (vulnerabilities/models.py:493-504, vulnerabilities/views.py:548-557 and 711-720, and vulnerabilities/api.py:268-276) catch NotImplementedError. Because get() returns the exception class (which is truthy), unsupported scoring systems bypass except NotImplementedError and append <class 'NotImplementedError'> to severity_vectors.

Expected behavior: ScoringSystem.compute(), ScoringSystem.get(), and EPSSScoringSystem.compute() raise NotImplementedError so callers skip unsupported systems as intended.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions