Currently, I am refactoring the code that I work on and I wanted to see how the different modules depend on each other. Doxygen generates graphs of how individual functions and routines call each other, which is pretty nifty, but it doesn’t seem to do it for the modules. Looking into how doxygen generates these graphs, I found out it uses the graphviz package, in particular dot.

Dot is a very simple language used to describe graphs. Wikipedia has some nice examples.

I wrote a short python function to crudely extract the module dependencies from my code and put them into a dot graph:

Writing the output of this function to a file and running dot on it produces lovely images like this:

messy graph

…I’m not sure if my refactoring is making it better or worse.