github / github/codeql

LGTM.com - Python: Call to a non-callable of class - false positive

オープン
#6,226 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
acknowledged false-positive Python
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

**Description of the false positive**

`Call to a non-callable of class` is reported for a class that does define the `__call__` method.

Given that the a callable object is any object whose class defines the `__call__` special method (https://lgtm.com/projects/g/pantsbuild/pants/snapshot/66951bf70ab4c9d9461bcb453c7fc125f27e6cdc/files/src/python/pants/util/meta.py#x1e006e0c8a342822:1), it looks like this error shouldn't be included. The business logic is somewhat complex with multiple decorators and metaclasses involved, so there is a chance the analyzer got confused. This error is reported almost a hundred times across multiple classes https://lgtm.com/projects/g/pantsbuild/pants?mode=list&lang=python&tag=&id=py%2Fcall-to-non-callable, however, the code exercising those classes runs without throwing the `TypeError`.

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

https://lgtm.com/projects/g/pantsbuild/pants/snapshot/66951bf70ab4c9d9461bcb453c7fc125f27e6cdc/files/src/python/pants/backend/python/goals/pytest_runner.py?sort=name&dir=ASC&mode=heatmap#x4b24c15bb666e688:1

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。