[Python] False positive py/unreachable-statement with global variable
オープン
bug
false-positive
Python
- 主要言語
- CodeQL
- スター
- 10.1k
- フォーク
- 2.1k
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 141
説明
**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
コントリビューションガイド
評価
この issue はまだ評価されていません。