Enhancement: add support for suppressing CodeQL alerts on the next line
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Es werden keine Dateien oder Tests genannt. Beginne damit, die Verarbeitung von Kommentaren zu Code-Identifier-Abweichungen und die Logik zur Unterdrückung von CodeQL-Warnungen zu lokalisieren; vergleiche, wie das Verhalten von clang-tidy für NOLINTNEXTLINE dargestellt wird. Als erledigt gilt, wenn eine dokumentierte Unterdrückungssyntax für die nächste Zeile für das vorgeschlagene Beispiel funktioniert, ohne bestehende Kommentare in derselben Zeile zu beeinträchtigen, und beide Formen abgedeckt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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) {
...
}
- Vorherrschende Sprache
- CodeQL
- Sterne
- 227
- Forks
- 82
- Ø Merge
- 6 T. 7 Std.
- Gemergte PRs (30 T.)
- 9
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Offenfalse positive/false negative
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
github/codeql-coding-standards#1175 ·
Alle Issues in github/codeql-coding-standards
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
canonical/paas-charm#368 · 1 Kommentar ·
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
palladius/rails8-app-on-gcp#142 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
StevenBlack/hosts#3256 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
corsairdev/corsair#1764 ·
-
oblt-aw/detector/security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100