Code Counter: Measure Productivity by Lines and Commits
What it is
Code Counter is a lightweight tool that analyzes a codebase to report lines of code and commit activity, combining those metrics to help estimate developer productivity and project momentum.
Key features
- Lines of code (LOC): Counts physical and/or logical lines across languages, with filters for file types and directories.
- Commit analysis: Aggregates commits per author, per file, and over time (daily/weekly/monthly).
- Combined metrics: Correlates LOC changes with commits to show productivity trends (e.g., LOC added per commit, churn rate).
- Filters & aggregation: Group by repository, branch, author, language, or time range.
- Export & integration: CSV/JSON exports and CI/CD or Git hook integration for automated reports.
- Visualizations: Time-series charts, heatmaps, and tables for quick insights.
Typical metrics reported
- Total LOC, LOC added, LOC removed
- Commits, commits per author, commits per file
- LOC per commit, average commit size, churn rate (added+removed)
- Active days, peak contribution periods, file-level hotspots
Use cases
- Monitoring team velocity and identifying bottlenecks.
- Assessing impact of refactors or feature work.
- Generating lightweight developer reports for retrospectives.
- Tracking language or file-type growth over time.
Limitations & cautions
- LOC and commit counts are crude proxies for productivity; they don’t measure design quality, bug fixes, or non-code work.
- Results can be skewed by bulk formatting changes, autogenerated files, or large merges—use filters to exclude these.
- Interpretation requires context (task complexity, code review time, pair programming).
Quick setup (typical)
- Point Code Counter at a Git repository (local path or remote clone).
- Configure include/exclude patterns and time range.
- Run analysis to generate reports and optionally export or publish to a dashboard.
If you want, I can produce a sample report layout, example CLI commands, or a short README section for integrating Code Counter into CI.