Rethinking PR Review: A Research-Backed Approach
Back to Engineering Log
ProductResearchCode Review

Rethinking PR Review: A Research-Backed Approach

Engineering Team

What if you could see a pull request the way your brain actually processes it?

Not a flat list of files. Not an endless scroll of diffs. But a map of changes—where size tells you what matters, color tells you what's risky, and structure tells you how it all fits together.

We built it. Go ahead, try each view. We'll wait.

12 files changed

Traditional file-by-file view

@@ -1,5 +1,15 @@
-import { Router } from 'express';
+import { Router, Request, Response } from 'express';
+import { OAuth2Client } from 'google-auth-library';
+import { generateToken, verifyToken } from '../utils/jwt';
+import { createUser, findUserByEmail } from '../db/users';
const router = Router();
+const oauthClient = new OAuth2Client(process.env.GOOGLE_CLIENT_ID);
+router.post('/oauth/google', async (req: Request, res: Response) => {
+ const { credential } = req.body;
+ const ticket = await oauthClient.verifyIdToken({
+ idToken: credential,
+ audience: process.env.GOOGLE_CLIENT_ID,
... 4 more lines
@@ -0,0 +1,89 @@
+import { Request, Response, NextFunction } from 'express';
+import { verifyToken } from '../utils/jwt';
+
+export interface AuthenticatedRequest extends Request {
+ user?: {
+ id: string;
+ email: string;
+ role: 'user' | 'admin';
+ };
+}
+
+export const requireAuth = async (
+ req: AuthenticatedRequest,
+ res: Response,
... 8 more lines

Click files to expand diffs

Switch between views to see the same PR data visualized differently

This isn't just eye candy. Every pixel is backed by research.

Code Review is Broken at Scale

The last major innovation in how we see pull requests was 2018. GitHub's Suggested Changes feature. Before that, 2016's Reviews feature.

That's nearly a decade of reviewing PRs the same way—scrolling through flat file lists while codebases grew 10x larger.

Reviewers spend 60% of their time just navigating large PRs, not actually reviewing code.

Microsoft Research (Rigby & Bird)

A 47-file PR lands in your inbox. You scroll through an endless diff. Your eyes glaze over. You miss the critical change buried in file #32.

The CHID study found developers consistently miss high-risk files when presented as flat lists. We're reviewing code with tools designed for 10-file PRs in a world of 100-file PRs.

Going Back to the Research

We didn't want to guess. We went to the academic literature—papers on code comprehension, visual analytics, and defect prediction. Here's what we found.

1. Treemaps Reduce Cognitive Load

NDepend pioneered using treemaps for code metrics visualization. The insight: our brains process size and color pre-attentively—before conscious thought kicks in.

Treemaps provide a 'bird's-eye view' that helps developers quickly identify where to focus attention in large codebases.

NDepend Treemap Documentation

In our Treemap view, rectangle size = total changes. Bigger rectangles demand more review attention. You can't miss them.

2. Risk Scoring from Academia

The CHID tool research showed that three factors strongly predict defect-prone code: file churn frequency, change size, and file type.

Files changed frequently (high churn), with large modifications, in security-sensitive areas are statistically more likely to contain defects.

CHID Tool - Springer (2024)

We turned this into a formula:

  • Churn Factor (40 points) — Files touched frequently are riskier
  • Change Size (40 points) — More changes = more to review
  • File Type (20 points) — Auth files score higher than test files

The result: a 0-100 risk score. Green means low risk. Red means "look at this carefully." Toggle to "Risk" mode in the treemap above to see it in action.

3. Spatial Memory Improves Comprehension

CodeReviewMaps research found that cross-file visualization improves comprehension by 29%. When files have spatial relationships—not just a flat list—reviewers build mental models faster.

Spatial visualization of code changes improves reviewer comprehension by 29% compared to traditional list-based diff views.

CodeReviewMaps (Knuth et al.)

That's why we built the 3D view. It's not a gimmick—it's spatial memory. Folders become landmarks. Files cluster by location. Your brain remembers where things are.

Design Decisions: Research Tells You What, Taste Tells You How

Research gave us the "what." But building a usable product required hundreds of small decisions.

Why 4 Views, Not 1?

Different mental models for different tasks. Use List for quick scans when you know what you're looking for. Use Tree for understanding structure. Use Treemap for risk triage on large PRs. Use 3D for spatial exploration.

Use the right tool for the moment.

Color Means Something

Green/yellow/red isn't arbitrary. It's a consistent language across all views. Risk scores use the same gradient in treemap and tree views. Status colors (added/modified/deleted) are consistent everywhere.

Risk Gradient

Green (0-33) → Yellow (34-66) → Red (67-100). Same everywhere.

Status Colors

Green = added. Yellow = modified. Red = deleted. Blue = renamed.

Keyboard-First

Your hands shouldn't leave the keyboard during review. J/K navigation in the 3D view. Arrow keys in the treemap. And Cmd+K to open the command palette.

+K
to open command palette
Esc
NavigateSelect
6 results

Try typing "auth" or "test" to filter files

Try typing 'auth' or 'test' to filter files instantly

Keyboard Navigation

J/K to move, Enter to select, Escape to close. Vim-style efficiency.

Command Palette

Cmd+K to search files, switch views, or run commands. Instant access.

What's Next

We're not done. Here's what we're working on:

  • Git History Integration — Real churn data from your repo for smarter risk scores
  • AI-Powered Labels — "Refactored auth flow" instead of just "modified"
  • Suggested Review Order — AI-guided path through large PRs based on dependencies and risk

We shipped what we learned. Now we're learning what to ship next.

Research Sources

The papers and tools that informed this work:

Ready to review PRs like this?

Join the Waitlist