github / github/codeql

Python FP when using multiple decorators on class function

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

説明

In https://lgtm.com/projects/g/dials/dials/snapshot/5c386da2f97d98b7ec80e34cec0cbf894fce6a36/files/util/filter_reflections.py?sort=name&dir=ASC&mode=heatmap#L288 a function is defined as:
```python
class X:
@staticmethod
@seconddecorator
def function(parameter):
```

Due to the presence of the decorator `@seconddecorator` the type of `parameter` is inferred to be instances of `X`. This is of course not true due to the `@staticmethod` decorator being present.
This can then lead to false positives on operations on `parameter` further down the line.

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

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

評価

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

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

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