scottrogowski / code2flow

Pretty good call graphs for dynamic languages
MIT License
3.92k stars 286 forks source link

Graph to display multiple calls to same method #92

Open NovoLearn opened 9 months ago

NovoLearn commented 9 months ago

Hi there, I was wondering if it is possible for code2flow to illustrate each sequential call to the same method. Scenario: My python code has funtion main() which is called if name == 'main' main() calls function my_func() 3 three times (each time with a different arg value), based on the condition of a boolean variable being True Currently, the call graph shows my_func() being called once from main() Is there a way to indicate the number of times that my_func() was called by main, in the call graph?

NicolaasJKotze commented 9 months ago

This will be quite useful in cases where a tester makes use of grey box testing strategies to determine possible risks and support them to design specific tests.

NovoLearn commented 9 months ago

My use case is really about understanding existing code and flow that has been written by one or more people. code2flow is so fast (so fast) and intuive to use, I'm really happy to have discoverd it. There are a lot of tools out there at varying degrees of completeness and, importantly, currency!

@NicolaasJKotze that's very interesting. You've now got me thinking about how that might compliment parametrized unit test functions (but also potentially break things due to recursion/load!)