`A8-5-2`: Reports a violation even for correctly initialized variables as per the rule
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia con la query CodeQL che implementa la regola A8-5-2 e riproduci l’esempio C++ segnalato. Traccia l’euristica che analizza gli spazi bianchi attorno all’inizializzazione, quindi verifica che le variabili inizializzate correttamente con le parentesi graffe, come a, ret e bbb, non vengano più segnalate, mentre le violazioni effettive continuino a essere rilevate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Affected rules
- A8-5-2
Description
This rule reports violation for the following code (which is correct as per the rule).
Example
void example_function() {
const int32_t a {array[i]};
int32_t ret {0};
myclass01 bbb {6};
}
The reason seems to be the limitation mentioned in the query that CodeQL doesn't store this syntactic information about the form of initialization in the database. The heuristic implemented in the query to check for the violation doesn't work for the above code snippet because of the presence of a whitespace between the variable name and the initialization.
- 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 74/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
DavidAnson/markdownlint-cli2#940 ·
-
Claiming namespace Londopy Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
EclipseFdn/open-vsx.org#13385 · 1 commento ·
-
bug ci good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100