Enhancement: add support for suppressing CodeQL alerts on the next line
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
No se nombran archivos ni pruebas. Empieza por localizar el manejo de los comentarios de desviación de identificadores de código y la lógica de supresión de alertas de CodeQL; compara cómo se representa el comportamiento de clang-tidy de NOLINTNEXTLINE. Se considera terminado cuando una sintaxis documentada de supresión para la línea siguiente funciona para el ejemplo propuesto sin romper los comentarios existentes en la misma línea, con cobertura para ambas formas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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) {
...
}
- Lenguaje dominante
- CodeQL
- Estrellas
- 227
- Forks
- 82
- Merge medio
- 6 d 7 h
- PR fusionados (30 d)
- 9
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Abiertofalse positive/false negative
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
github/codeql-coding-standards#1175 ·
Todos los issues de github/codeql-coding-standards
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
sipyourdrink-ltd/bernstein#6191 ·
-
security severity:low track:open-source
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[addtool] DeepZero Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
gwen001/offsectools_www#2055 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
WalletConnect/actions#112 ·