[Rust] Unused variable False positive
- Langage dominant
- CodeQL
- Étoiles
- 10.1k
- Forks
- 2.1k
- Merge moyen
- 2 j 15 h
- PR mergées (30 j)
- 141
Description
**Description of the false positive**
The argument is being used in the body of the function but flagged unused.
**Code samples or links to source code**
This is one specific example https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/fs.rs#L29
**URL to the alert on GitHub code scanning (optional)**
https://github.com/microsoft/windows-drivers-rs/security/code-scanning/5
However, false positives for the arguments are generated for all the methods in [this](https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/fs.rs) module and other sibling modules ([exec](https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/exec.rs), [metadata](https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/metadata.rs) and [wdk_build](https://github.com/microsoft/windows-drivers-rs/blob/main/crates/cargo-wdk/src/providers/wdk_build.rs)).
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Start with the flagged argument at crates/cargo-wdk/src/providers/fs.rs#L29 and inspect the linked CodeQL alert. Compare the usage there with the methods in the fs, exec, metadata, and wdk_build provider modules. Done means those used arguments are no longer reported as unused by code scanning.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust
- Domaine
- security
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100