I Made a Tool for Rendering the Code Base Entropy of Rust Projects Using a 3D Force-Directed Graph
Hi everyone!
I want to share a project for which Rust support was added recently:
https://github.com/gabotechs/dep-tree
This is a tool that allows users to visualize the complexity of a code base using a 3D force-directed graph:
- It will take a Rust codebase entrypoint (typically \
src/lib.rs\\or \src/main.rs\\) and based on the \mod\\and \use\\statements it will calculate dependencies to other source files. - It will recursively crawl \
use\\and \mod\\statements gathering other source files that are being imported. - It will render the graph using a force-directed layout, and all the crawled files will be placed in a three-dimensional space simulating some attraction/repulsion forces based on the dependencies between them.
- Clean and loosely coupled codebases will tend to form clusters of nodes in the 3d space separated from each other, while tightly coupled and messy codebases will be rendered with all the nodes grouped together without clear sense of separation.
Here are some examples of rendering this graph for some well known projects:
Hope you find this interesting!