Share My Creation B4X Call Graph Visualization Tool 🚀

I have been developing an innovative application in B4J that generates call graphs for B4X source code. While still a work in progress, this tool is already capable of analyzing a single bas/b4x module, creating a "dotfile", and utilizing Graphviz to produce insightful visual representations of function calls.

This application aims to streamline code analysis, enhance debugging efficiency, and provide developers with a clearer understanding of function dependencies.

Curious to see it in action? Here's a sample graph generated by the current implementation.

codesort.jpg
 

Sandman

Expert
Licensed User
Longtime User
Very nice, I've been considering doing this exact thing (also using Graphviz) for ages. Glad you did it before me! :)

Do you include callsub in the graph? And have you considered drawing events (basically determined by having an underscore in the sub name) in a different style?
 

epiCode

Active Member
Licensed User
Do you include callsub in the graph? And have you considered drawing events (basically determined by having an underscore in the sub name) in a different style?
Yes callsub is tracked
Yes events are also tracked [like in the example image above]
Basically every sub line that follows [Private/Public] Sub {name} is tracked.
However currently it does not follow code execution, instead, it just tracks what subs are called from what sub [irrespective of their execution order]
For code execution I guess @Mashiane has recently posted something which follows code execution using logs.
 

Sandman

Expert
Licensed User
Longtime User
Yes, I can see that events are tracked, I just meant that it's possible to make the event subs visually distinct. (Perhaps it's only me that would find it interesting to have them represented differently.)

Do you plan on releasing the source for the tool at some point?
 

Mariano Ismael Castro

Active Member
Licensed User
I also have something similar. I plan to publish the source code but haven't been able to finish it. If anyone is interested, I can show you the progress.
I've attached an image of what the PyWrapper module from the PyBridge library looks like.
In addition to Graphviz, I also use PlantUML.
 

Attachments

  • PyWrapper.png
    PyWrapper.png
    351.7 KB · Views: 89
Last edited:
Top