`DCL53-CPP`: Reports non syntactically ambiguous object declarations
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Commencez par LocalConstructorInitializedObjectHidesIdentifier.ql et son cas de test existant, puis comparez les résultats de la requête pour les exemples S1(g1), S1 g2(), S1 g3, S1 g4{}, S1 g5(1) et S1 g6{1}. Le travail est terminé lorsque la requête DCL53-CPP signale les déclarations non conformes sans les faux positifs listés, ou lorsque la limitation de parsing restante est documentée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Affected rules
DCL53-CPP
Description
LocalConstructorInitializedObjectHidesIdentifier.ql currently identifies variable declarations that call a constructor and hide an outer scope variable. However, this does not fully capture the cases covered by this vexing parsing situation, which is looking for S1(g1).
The following additions to the query could help address this problem:
v.getInitializer().getExpr().(ConstructorCall).getNumberOfArguments() = 0 and
not v.getInitializer().isBraced()
However this would still flag S1 g3; below - as we don't currently have a record of where the brackets were during parsing.
Example
This modification of the test case highlights the problems:
int g1 = 0;
int g2 = 0;
int g3 = 0;
int g4 = 0;
int g5 = 0;
int g6 = 0;
void f1() {
S1(g1); // NON_COMPLIANT
S1 g2(); // NON_COMPLIANT
S1 g3; // COMPLIANT[FALSE_POSITIVE]
S1 g4{}; // COMPLIANT[FALSE_POSITIVE]
S1 g5(1); // COMPLIANT[FALSE_POSITIVE]
S1 g6{1}; // COMPLIANT[FALSE_POSITIVE]
}
- Langage dominant
- CodeQL
- Étoiles
- 227
- Forks
- 82
- Merge moyen
- 6 j 7 h
- PR mergées (30 j)
- 9
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/codeql-coding-standards
-
false positive/false negative Stardard-MISRA-C++
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
github/codeql-coding-standards#1172 ·
-
Difficulty-Low false positive/false negative false-negative Impact-Low Standard-MISRA-C
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulty-Medium false positive/false negative false-positive Impact-Medium Standard-CERT-C
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
github/codeql-coding-standards#1200 ·
-
`RULE-0-0-1`: "unreachable statement" false positives due to over-pruning of the control-flow graph Ouvertefalse positive/false negative
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
github/codeql-coding-standards#1190 ·
-
false positive/false negative
Difficulté 3/5 1-2 jours Accessibilité débutants 65/100
github/codeql-coding-standards#1175 ·
Toutes les issues de github/codeql-coding-standards
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
use-agent-os/agent-os#3314 ·
-
[aw] Upgrade available Ouverteagentic-workflows
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
githubnext/rig#534 ·
-
Implement GitHub Issue templates Ouvertedocumentation low-priority templates
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
jesseray718/openroot#87 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
-
Add PR Default Description(s) Ouverteenhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
ReedClanton/NixOS#41 ·