Files
codeql/python/ql/test/query-tests/Statements/unreachable/global.py
Taus 5d4db3af15 Python: Extend unreachable statement test
Adds a test demostrating the false positive observed by andersfugmann.

Note that this does not change the `.expected` file, and so the tests
will fail. This is expected.
2022-01-05 16:45:38 +00:00

11 lines
191 B
Python

# FP involving global variables modified in a different scope
i = 0
def update_i():
global i
i = i + 1
update_i()
if i > 0:
print("i is greater than 0") # FP: This is reachable