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

Basic PoC for callgraph generation #7

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Basic PoC for callgraph generation #7

wants to merge 5 commits into from

Conversation

OmkarPh
Copy link
Contributor

@OmkarPh OmkarPh commented Jan 10, 2025

Fixes #3

I'm using // as separator for namespaces. Please suggest anything else if get any collision with any programming language's syntax features

I've not put example python files under fixtures to just keep the namespaces (starts with fileName) short when debugging
Also, some things like 'init' , '.' for base identifier are still present, need to generalise those
Also, there's a lot of debug residue, will get it cleaned up once we finalise on the approach

Try -

cd examples/plugin/callgraph

# works
go run main.go -dir testScopes.py
go run main.go -dir testNestedFn.py
go run main.go -dir testObjAssignment.py
# here, we have a false positive, if an identifier was assigned to two different classes
# it doesn't just show latest assignment, but all of them, need to discuss on this more
# eg. if x=ClassA() and then x=ClassB() is conditionally assigned (can't evaluate dynamic if elses),
# then its better to have all possibilities ?

# this doesn't work -
go run main.go -dir testFnAssignment.py
# here, xyz() resolves to both foo() and bar()

go run main.go -dir testClass.py
# partially works, but higher order 'func' isn't taken care of
# also, "Hello, World!".encode('utf-8') isn't taken care of

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Plugin for Single Source File Call Graph Construction
1 participant