Example against Flutter codebase, looking 3 months back: https://grand-horse-a19d0e.netlify.app/
This tool was built to visualize technical debt - find and track refactoring candidates.
It represents Dart classes as blocks, focusing on two dimensions for each:
- size (lines of code) - represented as block size
- change frequency (number of commits that changed it in the last 3 months) - represented as color intensity
Refactoring candidates could be big blocks with strong color. These classes usually do not respect single-responsibility principle and have too many responsibilities and reasons to change.
In the example Attached you can find how it looks being run against the Flutter codebase.
This is inspired by the book Your Code as a Crime Scene which I highly recommend.
Run instructions:
git clone https://github.com/madicd/codelens.git
dart pub global activate -spath codelens
cd <APP_TO_ANALYZE_PATH>
codelens lib # generates self-contained index.html
open index.htmlNow open index.html in your browser to see the visualization. The file is self-contained and includes all necessary data and visualization code.
- It only supports Git repositories. Other version control systems are not supported.
- If you want to change the time period, you need to change the
getCommitCountsmethod. It is hardcoded to 3 months. - It only supports Dart. Other programming languages are not supported.