github / github/codeql

LGTM.com - false positive - py/unreachable-statement

Offen
#6,848 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
false-positive
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

**Description of the false positive**

LGTM gives an alert about unreachable code, but this code *is* reachable and I can easily trigger the print statement on the line LGTM says is unreachable, by running it as
```sh
touch a.c
submit -u https://team:team@www.domjudge.org/demoweb -c nwerc18 a.c
```

I don't have much experience with Python and this code was written by another developer in our project. My only hunch is that the global `num_warnings` variable is imported in the local scope in `warn_user()` and maybe this is not detected properly?

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

https://lgtm.com/projects/g/DOMjudge/domjudge/snapshot/2f8248424c1572f48216d68a451004e6e2d30d00/files/submit/submit?sort=name&dir=ASC&mode=heatmap#x6c8458ef33745fdc:1

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.