Enhancement: add support for suppressing CodeQL alerts on the next line
還沒有人認領這個 Issue。
評估
研究方向
未指定檔案或測試。首先定位程式碼識別碼偏差註解的處理方式以及 CodeQL 警示抑制邏輯;比較 clang-tidy 的 NOLINTNEXTLINE 行為是如何表示的。完成標準是:針對所提議的範例,文件化的下一行抑制語法能夠正常運作,同時不破壞現有的同列註解,並且兩種形式都具有涵蓋。
由索引模型根據 Issue 內容生成。
描述
Currently code-identifier comments of a deviation are required to be on the same line as the CodeQL alert it refers to, which can cause code-formatters (clang-format etc.) to break very long lines into multiple lines that may require further position adjustment from the user for the deviation comments.
Therefore, a feature for suppressing CodeQL alerts on the NEXT line would be inevitable in the future, similar to clang-tidys NOLINTNEXTLINE` feature.
Current State:
Lets say there is a function with a return type that generates a CodeQL alert which should be ignored by a deviation comment:
ReturnTypeGeneratesAnAlert MyLongFunction(ParamType1 p1, ParamType2 p2, ParamType3 p3) { // DeviationCommentForReturnType
...
}
Due to the line length limit, clang-format may reformat the line into:
ReturnTypeGeneratesAnAlert
MyLongFunction(ParamType1 p1, ParamType2 p2, ParamType3 p3) { // DeviationCommentForReturnType
...
}
which needs to be manually repositioned to the following way by the user (otherwise the CodeQL alert will be re-triggered):
ReturnTypeGeneratesAnAlert // DeviationCommentForReturnType
MyLongFunction(ParamType1 p1, ParamType2 p2, ParamType3 p3) {
...
}
Proposed Solution:
Introduce NOCODEQLNEXTLINE or similar feature for suppressing CodeQL alerts on the next line:
// NOCODEQLNEXTLINE(DeviationCommentForReturnType)
ReturnTypeGeneratesAnAlert MyLongFunction(ParamType1 p1, ParamType2 p2, ParamType3 p3) {
...
}
- 主要語言
- CodeQL
- 星號
- 227
- 分支
- 82
- 平均合併
- 6 天 7 小時
- 30 天內合併 PR
- 9
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/codeql-coding-standards 的其他 Issue
-
false positive/false negative Stardard-MISRA-C++
難度 2/5 1-3 小時 新手友好度 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
難度 2/5 1-3 小時 新手友好度 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
難度 4/5 3-5 天 新手友好度 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph 未關閉false positive/false negative
難度 4/5 3-5 天 新手友好度 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
難度 3/5 1-2 天 新手友好度 65/100
github/codeql-coding-standards#1175 ·
查看 github/codeql-coding-standards 的全部 Issue
相似的 Issue
-
blocklist removal
難度 2/5 1-3 小時 新手友好度 65/100
MetaMask/eth-phishing-detect#296544 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
Azure/azure-functions-docker#1257 ·
-
area:proxy bug security severity:low track:open-source
難度 2/5 1-3 小時 新手友好度 75/100
-
bug server
難度 2/5 1-3 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 70/100
bytedance/UI-TARS-desktop#2009 · 1 則留言 ·