[Python] False positive py/unreachable-statement with global variable
- Lingua principale
- CodeQL
- Stelle
- 10.1k
- Fork
- 2.1k
- Merge medio
- 2g 15h
- PR unite (30g)
- 141
Descrizione
**Description of the false positive**
A global variable is set (`t = None`) at the top of the file. Cleanup code checks `if t is not None`, and LGTM marks the code inside this branch unreachable. However, there is a method containing a `global t` statement, allowing it to reassign the global variable, which it does.
#1268 appears to be similar, but with the `nonlocal` statement in place of `global`.
**URL to the alert on the project page on LGTM.com**
https://lgtm.com/projects/g/h5py/h5py/snapshot/9722123a723cd6299d1f7470e0f789080ec18e23/files/examples/threading_example.py?sort=name&dir=ASC&mode=heatmap#xe2a68c5ef5581699:1
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.