github / github/codeql

[Rust] Unused variable False positive

Abierto
#20,256 2 comentarios 0 reacciones 0 asignados Ver en GitHub
false-positive
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

**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)).

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
rust
Área
security
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.