TL;DR
PyCG is a static analysis tool that efficiently generates accurate call graphs for Python programs, supporting complex features and aiding security analysis.
Contribution
It introduces a scalable, static approach for call graph generation in Python that outperforms existing tools in precision and recall.
Findings
PyCG processes thousands of lines of code in under a second.
Achieves approximately 99.2% precision and 69.9% recall.
Effectively handles Python features like modules, generators, and inheritance.
Abstract
Call graphs play an important role in different contexts, such as profiling and vulnerability propagation analysis. Generating call graphs in an efficient manner can be a challenging task when it comes to high-level languages that are modular and incorporate dynamic features and higher-order functions. Despite the language's popularity, there have been very few tools aiming to generate call graphs for Python programs. Worse, these tools suffer from several effectiveness issues that limit their practicality in realistic programs. We propose a pragmatic, static approach for call graph generation in Python. We compute all assignment relations between program identifiers of functions, variables, classes, and modules through an inter-procedural analysis. Based on these assignment relations, we produce the resulting call graph by resolving all calls to potentially invoked functions.…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
