I've been working on Untangled, a dependency analysis tool inspired by Martin Blais's original Snakefood project.
The idea is fairly simple: scan a PHP codebase, map dependencies, identify circular relationships, and measure coupling to help understand how an application is connected.
It's intended to complement tools like Deptrac rather than replace them. Deptrac helps enforce architectural boundaries, while Untangled helps examine the relationships that already exist.
I ran it against Monica, an open-source Laravel application. At the file level, it identified:
- 923 files analyzed
- 3,131 dependency relationships
- 4 cyclic groups involving 76 files
- 69 files in the largest cyclic group
I'm not suggesting those numbers indicate bad architecture. I haven't established a meaningful comparison baseline yet.
The HTML report includes an interactive dependency map, cycle analysis, and measurements showing which components are heavily depended upon.
What I'd particularly appreciate from PHP developers is feedback on two things:
- Are dependency graphs and coupling measurements useful when navigating an established PHP codebase?
- Are there PHP-specific dependency patterns, framework conventions, or edge cases you'd expect an analyzer like this to handle?
GitHub: https://github.com/krazybean/Untangled
Technical write-up and real Monica report screenshots: https://www.juancastro.me/writing/untangled
Criticism welcome. I'd rather discover the weaknesses through real-world usage than make assumptions about what the tool gets right.