π Visualize code evolution over time with interactive animated graphs
Analyzes the evolution of code composition across your git repository's history by running scc (default, ~10x faster) or cloc on every commit. Generates beautiful, interactive HTML visualizations showing how your codebase has grown and changed.
π Try it online at analyze.devd.ca β Analyze public repositories server-side, no installation required!
- π Full History Analysis - Processes every commit chronologically
- β‘ Incremental Updates - Only analyzes new commits (100x faster re-runs!)
- π¨ Interactive Visualization - Beautiful animated HTML with custom Canvas renderer
- π Live Graph - Real-time line graph showing language evolution
- π― Smart Sorting - Languages maintain consistent positions for easy tracking
- π¦ Self-Contained - Single HTML file, no server required
- π Fast - Smart caching and incremental processing
- π§ Flexible - Choose between scc (fast) or cloc (thorough)
- β‘ scc Support - Default to scc for ~10x faster analysis
- π΅ Audio Sonification - Hear your code evolution (experimental)
- π Enhanced Metrics - Complexity and bytes data (with scc)
- π§ Tool Selection - Choose scc or cloc via
--counterflag - β±οΈ Performance Tracking - Detailed timing and throughput metrics
- Node.js v16 or higher
- scc (recommended, default) or cloc:
- git - For repository cloning
Option 1: Use npx (Recommended - No Installation)
# Run directly with npx
npx @slepp/code-evolution https://github.com/facebook/reactOption 2: Install Globally
npm install -g @slepp/code-evolution
code-evolution https://github.com/facebook/reactOption 3: Clone from GitHub
git clone https://github.com/slepp/code-evolution.git
cd code-evolution
node analyze.mjs https://github.com/facebook/react# Analyze a repository (uses scc by default)
npx @slepp/code-evolution https://github.com/facebook/react
# Use cloc instead of scc
npx @slepp/code-evolution https://github.com/facebook/react ./output --counter cloc
# Specify output directory
npx @slepp/code-evolution https://github.com/torvalds/linux ./linux-analysis
# Update existing analysis (incremental - super fast!)
npx @slepp/code-evolution https://github.com/facebook/react ./react-analysisTwo files are generated in the output directory:
data.json- Complete analysis data (schema v2.2 with metadata)visualization.html- Interactive visualization (open in any browser)
The generated HTML includes:
- π Live Graph (right panel) - High-performance Canvas line graph showing language trends
- π Statistics Table (left panel) - Detailed per-language metrics
- β―οΈ Playback Controls - Play/pause, step through commits, adjust speed
- π¨ Color Coding - Consistent colors across table and graph
- π Delta Tracking - Shows +/- changes from previous commit
- β¨οΈ Keyboard Shortcuts - Space, arrows, Home for quick navigation
Blazing fast incremental updates:
# First run: analyzes all 1000 commits (~15 minutes)
npx @slepp/code-evolution https://github.com/large-project/repo ./output
# Later: only analyzes 10 new commits (~10 seconds!)
npx @slepp/code-evolution https://github.com/large-project/repo ./output
# β Found existing data (1000 commits)
# π Incremental mode: found 10 new commits
# β‘ Analysis complete (9.2s)Performance:
- 100x+ faster for small updates
- Perfect for CI/CD pipelines
- Daily dashboard updates in seconds
Visualize how your project evolved over time - see when languages were added, refactored, or removed.
Generate up-to-date code metrics automatically:
# .github/workflows/metrics.yml
name: Update Code Metrics
on:
schedule:
- cron: '0 0 * * *' # Daily
jobs:
metrics:
runs-on: ubuntu-latest
steps:
- run: npx @slepp/code-evolution https://github.com/$REPO ./metrics
# Deploy to GitHub Pages, S3, etc.Track code evolution across multiple projects:
for repo in frontend backend mobile; do
npx @slepp/code-evolution "https://github.com/org/$repo" "./metrics/$repo"
doneDocument transitions like "migrated from JavaScript to TypeScript" with visual proof.
Choose between scc (fast) or cloc (thorough):
# Use scc (default, recommended)
npx @slepp/code-evolution <repo-url> <output-dir>
# Use cloc (traditional, more language mappings)
npx @slepp/code-evolution <repo-url> <output-dir> --counter clocTool Comparison:
- scc: Succinct Code Counter (Go), ~10x faster, includes complexity & bytes
- cloc: Count Lines of Code (Perl), traditional, broader language support
Both provide: files, code lines, blank lines, comment lines
# Ignore existing data and regenerate from scratch
npx @slepp/code-evolution <repo-url> <output-dir> --force-fullUseful when:
- Upgrading counter tool versions
- Changing exclusion patterns
- Switching between scc and cloc
Edit analyze.mjs line 238 to modify excluded directories:
const EXCLUDE_DIRS = ['node_modules', '.git', 'dist', 'build', 'target', 'pkg', '.venv', 'venv', '__pycache__', '.pytest_cache', '.mypy_cache', 'vendor'];- Space - Play/Pause
- β - Next commit
- β - Previous commit
- Home - Reset to first commit
The analyzer uses schema v2.2 with enhanced metadata:
Note: Tool version (v0.10.0) is separate from data schema version (v2.2). Schema version indicates the format of data.json output.
{
"schema_version": "2.2",
"metadata": {
"repository_url": "https://github.com/user/repo",
"analyzed_at": "2024-01-30T12:34:56Z",
"total_commits": 1245,
"total_duration_seconds": 876.45,
"counter_tool": "scc",
"counter_version": "3.x",
"last_commit_hash": "abc123...",
"last_commit_date": "2024-01-30"
},
"results": [ /* per-commit data */ ],
"allLanguages": [ /* sorted by prevalence */ ]
}Run the included test suite:
./test.shTests include:
- β Prerequisite checking
- β Full analysis on test repository
- β JSON structure validation
- β Output file generation
- β Cleanup verification
Contributions welcome! Areas for improvement:
- Branch selection support
- Diff mode visualization (velocity/churn)
- Multiple output formats (CSV, Excel)
- Language complexity metrics
- File-level drill-down
- Comparison mode (repo A vs repo B)
See CONTRIBUTING.md for guidelines.
Apache 2.0 License - see LICENSE for details.
- Issues: GitHub Issues
- Releases: GitHub Releases
| Repository Size | First Run | Update (10 commits) | Update (0 commits) |
|---|---|---|---|
| Small (~250 commits) | 2.4s | 0.06s | 0.06s |
| Medium (~1,500 commits) | 17s | 0.08s | 0.08s |
| Large (6,000+ commits) | 1m 13s | 0.26s | 0.19s |
| Repository Size | First Run | Update (10 commits) | Update (0 commits) |
|---|---|---|---|
| Small (~250 commits) | 22s | ~0.5s | ~0.5s |
| Medium (~1,500 commits) | 2m 51s | ~1s | ~1s |
| Large (6,000+ commits) | ~12m | ~2s | ~2s |
Tested on: Ubuntu 25.04, AMD Ryzen 9 7950X (32 cores), NVMe SSD, scc v3.6.0, cloc v2.04
- Daily Updates: Use incremental mode for fast daily metrics
- Version Control: Commit
data.jsonto track historical changes - Large Repos: Consider weekly analysis for 10k+ commit repos
- CI/CD: Incremental updates complete in seconds - perfect for automation
- Sharing: The HTML visualization is self-contained - just send the file!