github / github/codeql

[Rust] Unused variable False positive

Aberta
#20,256 2 comentários 0 reações 0 responsáveis Ver no GitHub
false-positive
Linguagem predominante
CodeQL
Estrelas
10.1k
Forks
2.1k
Merge médio
2d 15h
PRs com merge (30d)
141

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
rust
Domínio
security
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.