github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.61k stars 1.52k forks source link

LGTM.com - false positive, cyclic import of standard library io #9727

Open GavinHuttley opened 2 years ago

GavinHuttley commented 2 years ago

Description of the false positive

Within the project module cogent3.util.io, importing from the standard library io is incorrectly labelled as a cyclic import.

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

https://lgtm.com/projects/g/cogent3/cogent3/snapshot/5a0681419073defd215a681e1e6f15affcca38e0/files/src/cogent3/util/io.py?sort=name&dir=ASC&mode=heatmap#x3f884baea6ca5fdd:1

aibaars commented 2 years ago

Thanks for reporting. I think you're right. The analysis seems to confuse the cogent3.util.io and the io library.

ilevkivskyi commented 2 years ago

This issue also affects mypy, where it probably confuses mypy.types with stdlib types, see example (note there are also some legitimate errors in that and other files, but errors related to imports from typing, enums etc are all false positives).