Enhancement: add support for suppressing CodeQL alerts on the next line
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Non sono indicati file o test. Inizia individuando la gestione dei commenti sulle deviazioni degli identificatori del codice e la logica di soppressione degli avvisi CodeQL; confronta come viene rappresentato il comportamento di clang-tidy per NOLINTNEXTLINE. Il lavoro è completo quando una sintassi documentata di soppressione della riga successiva funziona per l'esempio proposto senza interrompere i commenti esistenti sulla stessa riga, con una copertura per entrambe le forme.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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) {
...
}
- Lingua principale
- CodeQL
- Stelle
- 227
- Fork
- 82
- Merge medio
- 6g 7h
- PR unite (30g)
- 9
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Apertafalse positive/false negative
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
github/codeql-coding-standards#1175 ·
Tutte le issue di github/codeql-coding-standards
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
sipyourdrink-ltd/bernstein#6191 ·
-
security severity:low track:open-source
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
[addtool] DeepZero Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
gwen001/offsectools_www#2055 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
WalletConnect/actions#112 ·