github / github/codeql

False positive py/uninitialized-local-variable

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

説明

**Description of the false positive**

**Code samples or links to source code**

```python
class Foo:
def foo(self, a, b, c=0):
start = 0
visible = not (a == b and c)
end = start if visible else None
return end

```

CodeQL Version: 2.18.3

Alert : Local variable 'visible' may be used before it is initialized.

I suspect that the issue is caused by EssaVariable being unable to locate the assignment statement for the variable visible, but I'm not sure how to modify the ql statement.

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

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

調査の方向性

Review the py/uninitialized-local-variable query and its EssaVariable handling against the supplied Python sample. Confirm that the false alert about visible no longer appears for this code while the intended uninitialized-local-variable detection remains intact.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
security
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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