3 ms·
Does Pysa require the code to be fully type hinted? or will it work on non-type hinted code also?
by dkarp 6y ago
Does Pysa require the code to be fully type hinted? or will it work on non-type hinted code also?
- sinancepel 6y agoPysa will try to analyze all functions regardless of whether they have type hints, but it work better if the function under consideration is typed. Namely, without type hints, it won't be able to pick up on tainted method calls or attribute accesses. However, regular function calls, etc. and standard data structures like dicts and lists should still be tracked normally.
- gbleaney 6y agoIn addition to what Sinan said, we've had success running on fully untyped codebases. These are you some strategies that you can use to get results on untyped codebases: https://pyre-check.org/docs/pysa-coverage.html https://pyre-check.org/docs/pysa-coverage.html Types will definitely make Pysa find more issues, but you don't need 100% coverage, or really more than the minimal coverage described in that doc I linked, to start finding some issues.