top | item 40635705

Show HN: Visualize the complexity of a Golang codebase with a 3D force graph

1 points| gabimtme | 1 year ago |dep-tree-explorer.vercel.app

Hi HN!

I want to share a project for which Golang support was just added:

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 Golang codebase entrypoint, typically `main.go`, it will parse the file and gather other files in which this file depends on (by resolving function names, types, etc...)

It will recursively perform this operation with all the dependant files, until the full graph with all the source files is formed.

It will render the graph using a force-directed layout, and all the source 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:

- Docker compose: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F...

- Ollama: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F...

- Gin: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F...

- Go's crypto std: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F...

- CockroachDB SQL parser: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F...

- Ethereum: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F...

- Dep Tree: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F...

Hope you find this interesting!

1 comment

order

ETH_start|1 year ago

The links seem to be dead?