Plandek Academy logo

Ultimate Guide – 7

Download the Ultimate Guide

Table of Contents

Metrics

7. Code Metrics

There are a myriad of potential code and code quality metrics. We focus here on code metrics that best reflect the process of writing code and, therefore, can improve the effectiveness of that process.

Commits Count

This metric considers the speed and agility of the engineering team as it tracks the volume and frequency of commits. It tracks the volume of code commits made to any branch based on the date of the commit. As well as seeing the total number of commits over time, you can also analyse the frequency and size of commits by engineers and repositories.

Pull Request Count

Pull requests are at the heart of software development, and this metric allows you to gain key insight into your team’s behaviour around this practice. Being able to cross-reference this data with Jira/Azure enables you to understand how this behaviour is distributed across stories, tasks and bugs.

Commit Hotspots

Many tools enable you to track high levels of activity in your code base, but Plandek enables you to distinguish whether this activity is related to work on stories, bugs or other issue types within your workflow management tool. Now, you can quickly identify where you’re addressing technical debt or iterating new functionality quickly.

Ticket Complexity

Many teams rely on anecdotal information about where levels of complexity lie in the code base, especially when building new functionality. With ticket complexity, you can quickly cross-reference critical repository activity with your workflow management tools to identify which stories, bugs, tech debt, etc., are resulting in higher-risk behaviours.

Two important metrics that track the quality of the engineering process are Commits without a Pull Request and Commits without a Ticket Reference. Both metrics are important from an infosec and process integrity point of view.

Commits without a Pull Request

This metric tracks the percentage of code commits that have occurred (tracked by team and individual) for which there is no assigned Pull Request – hence, the code has been committed without peer review. Most organisations will view this as a major infosec breach, but it is a surprisingly common occurrence.

Commits without a Ticket Reference

This metric tracks code commits that have no assigned workflow management (e.g. Jira) ticket reference. This makes it impossible to trace issues in the code base back to the ticket in question. Root cause analysis becomes much easier if effective tracking of ticket references is in place.