What is Pull Request Complexity?Last Updated: October 18, 2018
For each pull request (PR), we compute a complexity metric.
On a large team, picking which PRs to review can be pretty arbitrary. Even with diligent, daily code review, it’s very difficult to know which of the 100+ commits should be selected for review. Complexity is a measure of how likely it is a particular PR will cause problems.
Here are some of the questions we ask when looking at Risk:
- How big is code change in the pull request?
- Are the changes tightly grouped or spread throughout the codebase?
- Are the changes mainly refactoring, code churn, new code or helping others?
Complexity can reach a max score of 10 - 0 being trivial and 10 very complex.
Complexity can be used to help you and your team better understand what code needs additional review before it makes its way to production.