Quality Code Metrics Explained

Boaz Dremer Updated by Boaz Dremer

Quality Code Metrics Explained

  1. Change Sequence Size - 

In change sequence size we measure the number of “hunks” that are changed in each commit on average. A Hunk is a sequence of lines that are common to both states of the file compared. A high number of hunks changed means that many areas in the file were changed which adds to the risk level of the commit. It is recommended to change a limited “area” of the file in each commit and not make changes to multiple areas in a single commit.

  1. Change Effectiveness - 

In change effectiveness, we measure the ratio between the actual code that was merged to the base branch to the sum of the code changes "aggregated" during the development process (in each commit) When this number is low this means that much of the code that the team/person is writing is not being eventually merged. That can indicate a high rate of bugs, bad methodology, poor understanding of the feature requirements, and more.

  1. Comments Ratio - 

In comments ratio, we measure the ratio between in-code documentation and comments to the actual lines of code. So, for example, if in a single file there are 50 lines of code and 5 lines of comment the ratio is 0.1. A high comments ratio allows an easier hand-off of tasks between different devs and it allows the new dev to easily understand the code in the file and continue to work on it.

  1. UX Ratio

In UX Ratio we measure the total number of UX related code of the total code changes during the relevant time period. The code that is considered UX code is one of the following: 

'HTML', 'CSS', 'Sass', 'JSX', 'Ruby HTML','Vuejs Component'

  1. DevOps Ratio

In DevOps Ratio we measure the total number of DevOps related code of the total code changes during the relevant time period. The code that is considered DevOps code is one of the following: 

'Ant', 'Bourne Again Shell', 'Bourne Shell', 'C Shell', 'CMake', 'DOS Batch', 'Dockerfile', 'Korn Shell', 'MSBuild script', 'Perl', 'PowerShell', 'YAML', 'make', 'zsh'

How did we do?

Understanding Code Changes

Contact