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

未關閉 適合新手
#2,552 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 5 天內回覆

@sc-lacanlale 已經在處理了。

開始於 2026年11月30日。

  • #2553 來自 @sc-lacanlale —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
83/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
backend, security

研究方向

閱讀 issue 中提到的三個方法對應的 vulnerabilities/severity_systems.py,接著檢查列出的呼叫端,確認它們如何處理 NotImplementedError。修改這些方法,使其如預期般引發例外,並執行與嚴重性評分和不支援系統相關的測試。當不支援的系統被略過,且例外類別未加入 severity_vectors 時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Python
星號
722
分支
364
平均合併
2 天 22 小時
30 天內合併 PR
2

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

aboutcode-org/vulnerablecode 的其他 Issue

查看 aboutcode-org/vulnerablecode 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。