codeql
codeql copied to clipboard
LGTM.com - false positive because of setter in python
Description of the false positive
If a string is passed to the aoi_model attribute of the ModelChain class, aoi_model.setter is called and assigns a function to self.aoi_model based on the string that was passed in. self.aoi_model is therefore always callable.
URL to the alert on the project page on LGTM.com
https://lgtm.com/projects/g/pvlib/pvlib-python/snapshot/9638d5facde44227b3bd9503c5b1dabb9b3e1fe7/files/pvlib/modelchain.py?sort=name&dir=ASC&mode=heatmap#x7614d2aff6b90c1b:1
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.