DEV Community

Apaksh
Apaksh

Posted on

The Code Review Checklist Every Engineering Team Needs

Let me be blunt: most code reviews are theatre. Someone glances at the diff, clicks "Approve," and moves on. Then three weeks later, the team is debugging a production incident that would have been caught by a five-minute checklist. I've been on both sides of that failure, and this is the checklist I built to make sure it never happens again.

This covers functionality, security, performance, maintainability, and documentation -- 10 phases of review that catch critical issues before they reach production. Whether you're reviewing a pull request or establishing code review standards across your team, this guide ensures nothing falls through the cracks.

Phase 1: Initial Assessment & Scope

  • Review PR/MR title and description -- Unclear descriptions lead to misaligned reviews and wasted time (CRITICAL)
  • Verify branch name follows team conventions -- Consistent naming prevents confusion and aids searchability
  • Check that PR is linked to relevant issues/tickets -- Traceability is essential for project tracking and accountability
  • Confirm scope is reasonable for single PR -- Large PRs are harder to review, delay merges, and increase bug risk
  • Verify no unrelated changes are included -- Scope creep makes it impossible to trace issues to specific changes (CRITICAL)
  • Check that code is based on current main/master -- Stale branches risk merge conflicts and outdated dependencies
  • Identify any files that shouldn't be changed -- Accidental changes to config, lock files, or binaries cause production issues (CRITICAL)

Phase 2: Functionality & Logic

  • Understand the intended functionality -- You can't review code you don't understand; ask questions
  • Verify logic implements the requirements correctly -- The code may work but not do what was actually requested (CRITICAL)
  • Check for edge cases and boundary conditions -- Off-by-one errors, null checks, and empty collections cause production incidents (CRITICAL)
  • Look for infinite loops or recursion issues -- Stack overflow and hung processes take down systems (CRITICAL)
  • Verify error handling for all operations -- Unhandled exceptions crash applications; check try/catch blocks (CRITICAL)
  • Confirm exception types are specific, not generic -- Catching Exception or BaseException masks real problems
  • Check for missing null/empty checks -- NullPointerException is the most common production bug (CRITICAL)
  • Verify return values are used or intentionally ignored -- Ignoring return values often indicates logic errors
  • Look for TODO, FIXME, or XXX comments -- These indicate incomplete work that shouldn't be merged (CRITICAL)
  • Verify control flow is clear and not unnecessarily complex -- Complex logic is hard to test, debug, and maintain
  • Check that loops terminate correctly -- Infinite loops with no exit conditions halt systems (CRITICAL)

Phase 3: Security Vulnerabilities

  • Scan for hardcoded credentials or secrets -- Exposed secrets lead to unauthorized access and data breaches (CRITICAL)
  • Check for SQL injection vulnerabilities -- Always use parameterized queries; string concatenation is dangerous (CRITICAL)
  • Verify no direct user input is executed -- Code injection (command, code, template) is catastrophic (CRITICAL)
  • Check authentication and authorization logic -- Broken access control is in OWASP top 10 (CRITICAL)
  • Look for sensitive data in logs or error messages -- PII, tokens, and passwords in logs are security breaches (CRITICAL)
  • Verify cryptographic operations use approved algorithms -- Custom or deprecated crypto is vulnerable to attacks (CRITICAL)
  • Check for proper use of HTTPS/TLS -- Unencrypted transmission exposes sensitive data
  • Verify input validation and sanitization -- All external input can be malicious; validate everything (CRITICAL)
  • Check for XXE (XML External Entity) vulnerabilities -- XML parsing without safeguards allows file access attacks
  • Look for CSRF protection on state-changing operations -- Unprotected forms allow cross-site attacks
  • Verify no debugging code left in production paths -- Debug code exposes internals and creates backdoors (CRITICAL)
  • Check permissions on temporary files or directories -- World-readable temp files leak sensitive data

Phase 4: Performance & Scalability

  • Check for N+1 query problems -- Queries in loops cause exponential database load (CRITICAL)
  • Verify database queries are indexed appropriately -- Full table scans cause performance degradation
  • Look for unnecessary data fetches or loops -- Loading more data than needed wastes memory and bandwidth
  • Check for missing caching opportunities -- Redundant computation drains resources
  • Verify no blocking operations in async/event code -- Blocking calls in async code freeze the event loop (CRITICAL)
  • Check algorithm complexity (O(n), O(n^2), etc.) -- Quadratic algorithms fail at scale
  • Look for memory leaks (event listeners, references) -- Unreleased resources eventually cause out-of-memory errors (CRITICAL)
  • Verify large collections aren't held longer than needed -- Retained data structures cause garbage collection pauses
  • Check for unnecessary regex operations -- Complex regex against large strings is CPU-intensive

Phase 5: Code Quality & Maintainability

  • Verify code follows team style guide -- Consistency aids readability; inconsistent code confuses reviewers
  • Check variable and function names are clear -- Unclear names require comments; comments can drift from code
  • Confirm functions have single responsibility -- Functions doing multiple things are hard to test and debug
  • Verify function/method length is reasonable -- Functions >50 lines are hard to understand and test
  • Check for code duplication (DRY principle) -- Duplicated code causes inconsistent bugs and high maintenance cost
  • Look for magic numbers or strings -- Named constants explain intent better than numbers
  • Verify comments explain WHY, not WHAT -- Code shows what it does; comments should explain business logic
  • Check for dead or unreachable code -- Dead code confuses maintainers and creates false test coverage
  • Verify imports are used -- Unused imports clutter code and slow compilation
  • Look for overly complex conditional logic -- Nested ifs should be refactored into guard clauses or helper functions

Phase 6: Testing & Test Coverage

  • Verify new code has unit tests -- Untested code breaks unexpectedly in production (CRITICAL)
  • Check test names clearly describe what they test -- Good test names are documentation
  • Confirm tests cover happy path -- Obvious cases must work correctly
  • Verify edge cases and error conditions are tested -- Bugs hide in boundary conditions (CRITICAL)
  • Look for brittle tests (overly specific mocks) -- Tests that break with minor refactors waste time
  • Check that tests are deterministic -- Flaky tests undermine confidence in the entire test suite (CRITICAL)
  • Verify no test data relies on external systems -- Tests dependent on APIs or databases are slow and unreliable
  • Confirm mocks/stubs are appropriate -- Over-mocking tests the mock, not the code
  • Check test readability (Arrange/Act/Assert) -- Hard to understand tests don't catch regressions
  • Verify code coverage hasn't decreased -- Coverage gaps accumulate over time

Phase 7: Dependencies & Compatibility

  • Check for new or updated dependencies -- Vulnerable dependencies are security risks (CRITICAL)
  • Verify dependency versions are locked appropriately -- Version mismatches cause "works on my machine" bugs
  • Look for deprecated API usage -- Deprecated code breaks in future versions
  • Confirm no breaking changes to public APIs -- Breaking changes require major version bumps (CRITICAL)
  • Check backward compatibility if needed -- Incompatible changes break downstream consumers
  • Verify node/Python/runtime versions are compatible -- Version mismatches cause cryptic failures in production

Phase 8: Documentation & Communication

  • Verify code changes are documented -- Undocumented changes confuse future maintainers
  • Check README or docs are updated if needed -- Docs that don't match code cause wasted debugging time
  • Confirm API changes have proper documentation -- Consumers need to know how to use new/changed APIs
  • Look for clear commit messages -- Good commit messages aid debugging via git blame
  • Verify no sensitive information in comments -- Code comments are visible to everyone with repo access (CRITICAL)

Phase 9: Deployment & Operations

  • Check if migrations or schema changes are included -- Database changes need rollback plans (CRITICAL)
  • Verify configuration changes are documented -- Ops teams need to know about new env variables
  • Look for any breaking changes to APIs/endpoints -- Breaking changes need coordinated deployments (CRITICAL)
  • Confirm feature flags are used for risky changes -- Flags allow safe rollback if issues arise
  • Check if monitoring/logging was added -- New features should be observable in production
  • Verify no hardcoded environment-specific values -- Hardcoded config paths/URLs break across environments (CRITICAL)

Phase 10: Final Sign-Off

  • All blocking issues have been addressed -- Don't approve with open critical comments (CRITICAL)
  • Confirm you would support this code in production -- If you wouldn't debug it at 3am, don't approve it
  • Request changes, request review, or approve -- Use platform features correctly; unclear status blocks merges (CRITICAL)
  • Add specific comments if requesting changes -- Vague feedback frustrates developers
  • Acknowledge good code with praise -- Recognition motivates quality contributions

Review Speed Tips

  • 5 min review -- Focus on Phase 1 + CRITICAL items
  • 15 min review -- All CRITICAL items + sample of IMPORTANT items
  • 30+ min review -- Complete checklist for high-risk areas (auth, payments, data access)

Anti-Patterns to Avoid

  • Approving without actually running/testing the code
  • Requesting changes on style only when logic is more important
  • Letting PRs sit for weeks without review
  • Rubber-stamping changes from senior developers
  • Reviews longer than 30 minutes (sign of too-large PR)

Pro Tip: Use this checklist as your team's standard. Consistency compounds -- after 2-3 weeks, these reviews become faster and catch more issues because everyone knows what's coming.

If you found this useful, share it with a colleague who needs it. Subscribe for more developer resources every week.


Want the full resource?

Code Review Checklist — $5.99 on Gumroad

Get the complete, downloadable version. Perfect for bookmarking, printing, or sharing with your team.

Get it now on Gumroad →


If you found this useful, drop a ❤️ and follow for more developer resources every week.

Top comments (0)