github / github/codeql

LGTM.com - false positive - unused import in `try` statement

Aberta
#9,652 1 comentário 0 reações 0 responsáveis Ver no GitHub
false-positive Python
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**

`Unused import` reported, when the import is in a `try` statement to check the availability of a package, which determines the tests to be run afterwards. May be good if imports in a `try` statement are excempt from such a report.

**URL to the alert on the project page on LGTM.com**

https://lgtm.com/projects/g/hyperspy/hyperspy/snapshot/508d6caf0efc5c0a258c67f5c2ecab8a977c413e/files/hyperspy/conftest.py#x4aef4cf8f643dffd:1

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start with the LGTM alert URL and the referenced hyperspy/conftest.py location to understand the try-statement import pattern. Then locate the corresponding unused-import query and its tests in CodeQL. Done means the intentional availability-check import is no longer reported while genuine unused imports remain detected.

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

Avaliação

Stack de tecnologia
python
Domínio
devtools
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.