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.52k stars 1.5k forks source link

LGTM.com - false positive with relative import #7978

Open mgrabovsky opened 2 years ago

mgrabovsky commented 2 years ago

Description of the false positive

LGTM is complaining about logging being imported both with plain import and with import ... from, but the latter is only used for a relative import of a module called logging. The standard module of the same name is only imported plainly, on the other hand.

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

https://lgtm.com/projects/g/abrt/retrace-server/snapshot/228913a00605c01b7b85f81f94b368871a429dd8/files/src/retrace/retrace_worker.py?sort=name&dir=ASC&mode=heatmap#xba03ebfb24472c08:1

aeisenberg commented 2 years ago

Indeed, this looks like a false positive. Thank you for reporting it!

Our current focus is on improving our security analysis. Because your report does not relate to a security query, we will put this on our backlog and prioritize it if we get enough reports of the same underlying issue in other projects. If you think that your report is related to our security analysis, please clarify that in a comment. Either way, we'll let you know here as soon as it's fixed!

As you might know, all of our queries are open source. If you do have an idea for a code change, we encourage you to open a pull request. GitHub Code Scanning and lgtm.com have facilities for suppressing individual alerts or disabling a query.