Where the 400-line pull request rule came from, and what the newer data says
A common online rule says pull requests should stay under 400 lines, but tracing it leads to a 2006 study by SmartBear, a code review tool vendor, run with a Cisco team. That study reviewed about 2,500 reviews covering 3.2 million lines of code, finding defect density dropped once reviews exceeded roughly 200 lines. The original research measured reviewer effectiveness rather than how risky a change was, and it reflects a single team, product, and pre-commit tooling setup. Newer vendor benchmarks from LinearB and Graphite offer different size guidance, with Graphite suggesting a median of about 50 lines, and the two sets of figures measure different parts of the same distribution. Both sources sell tools that track these metrics, so the numbers are best treated as a starting point rather than a fixed rule.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in