Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LGTM.com - false positive - unused import + eval #2292

Open
jkseppan opened this issue Nov 10, 2019 · 0 comments
Open

LGTM.com - false positive - unused import + eval #2292

jkseppan opened this issue Nov 10, 2019 · 0 comments

Comments

@jkseppan
Copy link

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 <module>
    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 "<unknown>", line 1, in <module>
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

@tausbn tausbn added the Python label Nov 13, 2019
@tausbn tausbn self-assigned this Nov 13, 2019
@tausbn tausbn changed the title LGTM.com - false positive LGTM.com - false positive - unused import + eval Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants