Lines of Code or LoC
Total Lines of Code (LOC) changed and is the sum of LOC added and LOC deleted in the selected time period. This number is computed for each active user by aggregating the diff LOC across all their PRs. For users with no PRs this metric will be zero.
Computation of the metric
- The codebase is analysed (VCS diffs) to find the total numbers of lines added within the chosen timeframe.
- The same process is then used to determine the number of lines deleted within the chosen timeframe as well.
- Both the values are added to give LOC. (LOC added + LOC deleted)
Dashboards where this metric is used
- Dev Metric Grid
- Dev Summary
- Dev Throughput
Use cases of this metric
- By tracking the total lines of code changed by individual developers or teams over time, managers can gain insights into productivity levels.
- Code review processes can benefit from using LOC changed as a metric to assess the impact of code changes. Reviewers can prioritize their efforts by focusing on changes with a significant number of lines of code added or deleted. This helps streamline the review process and ensure that critical changes receive appropriate attention.
- Monitoring the total lines of code changed can help identify problematic areas within the codebase.
- Measuring LOC as the only/key metric is fraught with risk and will encourage bad behaviour.
- Monitoring the total lines of code changed can help identify what kind of code change the team is doing within a given sprint / time period
- The code churn computation relies on LOC diffs & identity code change patterns over a period of time