github / github/codeql

LGTM.com - false positive - unused import + eval

未關閉
#2,292 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
false-positive Python
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

**Description of the false positive**

The import is not unused. If I delete it, I get the error

```
Traceback (most recent call last):
File "examples/bootstrap.py", line 53, in
app.layout = html.Div([navbar.run(), body.run()])
File "/Users/jks/code/htexpr/htexpr/htexpr.py", line 88, in run
return eval(self.code, {**frame.f_globals, **frame.f_locals, **bindings})
File "", line 1, in
NameError: name 'dcc' is not defined
```

The point of this liibrary is that it compiles strings into Python code objects, which are then evaluated. This is probably difficult to analyze statically without executing the code, so I wouldn't assign a high priority to this, but since the page asked me to report false positives, here goes.

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

https://lgtm.com/projects/g/jkseppan/htexpr/snapshot/4e3172505e73dfbb54169f9906460b17b5a10260/files/examples/bootstrap.py?sort=name&dir=ASC&mode=heatmap#x64fc00e52918b221:1

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。