3 ms·
Very interesting! We built something very similar a few years ago for visualizing code complexity (or other metrics) over large code bases, it's also open-sourc
by ThePhysicist 8y ago
Very interesting! We built something very similar a few years ago for visualizing code complexity (or other metrics) over large code bases, it's also open-source:
http://quantifiedcode.github.io/code-is-beautiful/ http://quantifiedcode.github.io/code-is-beautiful/
Here's e.g. the cityscape visualization of the Django codebase:
http://quantifiedcode.github.io/code-is-beautiful/code-city/ http://quantifiedcode.github.io/code-is-beautiful/code-city/
We also did some 2D versions of the same graphs, which are often a bit easier to interact with.
- auto 8y agoThis is really neat, does your team/you actually use this in a meaningful way? Take a snapshot of a project occasionally to get an idea of whether it's getting unwieldy, etc.?
- ThePhysicist 8y agoWe offered this as part of our SaaS product (now retired, https://github.com/quantifiedcode/quantifiedcode https://github.com/quantifiedcode/quantifiedcode). The data was generated using a tool called "checkmate" (https://github.com/quantifiedcode/checkmate https://github.com/quantifiedcode/checkmate), which produced various metrics grouped by directory for each git commit of a project (in an efficient way). This data was then used to generate the visualizations. An example for the data generated by checkmate can be found here: http://quantifiedcode.github.io/code-is-beautiful/data/django_complexity.json http://quantifiedcode.github.io/code-is-beautiful/data/djang... For a given git commit, checkmate only re-analyzed the files that changed and then recomputed all metrics on the fly using the new and existing file revisions, which would take only a few seconds to minutes even for very large projects.
- olex 8y agoWe actually use our similar tool (see my reply to parent comment) in a typical CI/CD pipeline. The generated output can be visualized and browsed anytime. The tool can visualize differences between different analysis states, which makes it very useful to demonstrate progress as a project grows, especially on pre-existing codebases that are refactored/rebuilt.
- olex 8y agoNice! We also have an internal tool for this that was somewhat recently open-sourced: https://github.com/MaibornWolff/codecharta https://github.com/MaibornWolff/codecharta. It's been quite useful in several projects I've been on, especially when used on legacy codebases to visualize improvement as a refactoring/rebuild project progresses.
- ThePhysicist 8y agoThanks for sharing this, it looks very nice and polished!
- jonahx 8y agoI love this. Do you happen to know if there's anything similar for ruby?
- ThePhysicist 8y agoIn theory you can use it for other languages as well, you'd "just" need to implement an analyzer for that language using checkmate. Currently we do not actively develop this project so I'm not able to help you with this, will be happy to provide guidance on the process if you want to implement it yourself.