Code Audit Checklist: What to Review, in What Order, and How to Report It
A practical code audit checklist: scope, build, architecture, code quality, tests, dependencies, security, delivery and AI code, plus how to write the report.
In this article:
- What a code audit checklist is for
- Before you start: scope, access and goals
- The code audit checklist, area by area
- How to rate findings and write the report
- Common mistakes that weaken an audit
- Conclusion
What a code audit checklist is for
A code audit checklist keeps a review honest. Without one, auditors drift towards whatever they find interesting: a clever framework misuse, an ugly class, a style debate. The parts of the system that actually carry risk, such as the build nobody can reproduce or the payment flow without tests, get the same attention as everything else, or less.
A checklist does not replace judgment. It makes sure judgment is applied everywhere it matters, in a consistent order, so two audits of two systems can be compared. That matters to a CTO deciding where to invest next quarter, and even more to an investor reading a source code audit before signing.
This guide is the checklist we use as a starting point, written for engineering leaders who want to run an audit internally or check that an external one is complete. It assumes you already know which code quality metrics you care about; here the focus is on what to review and how to turn it into decisions.
Before you start: scope, access and goals
Most weak audits fail before the first line of code is read. The scope is vague, access arrives late, and nobody wrote down which decision the audit is supposed to inform.
Settle these points first:
- The decision. Refactor or rewrite, acquire or walk away, which module to modernise first, whether the team can scale. Each one changes where you look hardest.
- The scope. Which repositories, services, infrastructure code and data stores are in, and which are explicitly out.
- Access. Read access to source control with full history, CI/CD configuration, issue tracker, incident log, and a test or staging environment where the system can run.
- People. Short interviews with two or three engineers who know the system. They will tell you where the bodies are buried faster than any tool.
- Business-critical flows. A list of the flows that make or lose money: checkout, billing, onboarding, reporting. These get reviewed line by line; the rest gets sampled.
If the audit is part of an acquisition or funding round, the checklist overlaps heavily with software due diligence, but the report audience and the level of detail are different.
The code audit checklist, area by area
Work through the areas roughly in this order. The early ones are cheap and tell you where to spend time in the expensive ones.
1. Repository and build
- Can a new engineer clone the repository and produce a working build from the documented steps alone?
- Is the build reproducible, with dependency versions pinned and lock files committed?
- Are there secrets, credentials or keys committed anywhere in the history?
- Does the commit history show steady, small changes, or long-lived branches and large merges?
2. Architecture and boundaries
- Do module or service boundaries match the business domains, or does every feature touch every module?
- Where are the most heavily depended-on components, and what happens if one of them changes?
- Are there circular dependencies between modules?
- Is there shared mutable state, such as a single database schema used by several services with no clear owner?
3. Code quality and maintainability
- Run static code analysis across the whole codebase and record complexity, duplication and size per module, not only global averages.
- Join those numbers with change frequency from version control to find hotspots: code that is both complex and changed often.
- Read the top hotspots by hand. Tools find symptoms; people find causes, such as a god class or business rules duplicated across layers.
- Check error handling: are failures logged, propagated and visible, or silently swallowed?
4. Tests
- What do the tests actually cover on the business-critical flows identified during scoping?
- Do the tests assert behaviour, or do they only execute code to raise the coverage figure?
- How long does the suite take, and how often do tests fail intermittently?
- Can a developer run the relevant tests locally before pushing?
5. Dependencies and security
- List third-party libraries with known vulnerabilities and libraries that are no longer maintained.
- Check input validation, authentication and authorisation on every external entry point.
- Check how sensitive data is stored, logged and transmitted.
- Note which findings need a dedicated security test. For companies that must comply with PCI DSS at Level 1, we work with Foregenix, a QSA company approved by the PCI Security Standards Council, on penetration testing, and we fix the code and architecture issues those tests uncover.
6. Data and persistence
- Are schema changes versioned and applied through migrations, or by hand?
- Are there queries that will degrade as data grows, such as missing indexes or unbounded result sets?
- Is there a tested backup and restore procedure?
7. Delivery and operations
- How often does the team deploy, how long does a change take to reach production, and how often does a deployment cause an incident?
- Is deployment automated end to end, or does it rely on manual steps and a specific person?
- Can the team detect a failure from monitoring before a customer reports it?
- Is there a rollback path that has been used recently?
8. Documentation and knowledge
- Is there an up-to-date architecture overview, even a single diagram?
- Are important decisions recorded somewhere, for example as architecture decision records?
- Which parts of the system are understood by only one person?
9. AI-generated code
- Does the team know which parts of the codebase were written with AI assistants, and are those parts reviewed to the same standard as the rest?
- Look for duplicated logic, inconsistent patterns and plausible-looking code without tests, which are the typical traces of unreviewed generated code.
This last area is newer but no longer optional. In the 2024 DORA report, 39% of respondents said they had little or no trust in AI-generated code. An AI generated code audit is simply the same checklist applied with that risk in mind. We cover the patterns in more detail in our article on AI technical debt.
How to rate findings and write the report
A checklist produces dozens or hundreds of findings. The code audit report is where they become useful, and its value depends on how consistently they are rated.
Rate every finding on the same scale and attach three facts to it: where it is, what it puts at risk, and roughly how much effort the fix takes.
| Severity | Meaning | Typical example | Expected action |
|---|---|---|---|
| Critical | Active risk to data, money or availability | Committed production credentials, unauthenticated admin endpoint | Fix immediately, before other work |
| High | Likely to cause incidents or block planned work | Untested payment logic in a hotspot, manual deployment of a core service | Plan within the next cycle |
| Medium | Slows the team down every week | Circular dependencies, flaky test suite, duplicated business rules | Address incrementally alongside features |
| Low | Worth fixing when the code is touched anyway | Inconsistent naming, outdated comments, minor dead code | Boy scout rule, no dedicated work |
The report itself should have four parts:
- Executive summary. One page: the overall state of the system, the three to five risks that matter, and a recommendation tied to the decision defined at the start.
- Findings by area. Following the checklist structure, each finding with severity, location, evidence and suggested fix.
- Prioritised roadmap. Findings grouped into incremental steps, ordered by risk reduced per unit of effort. Our framework for prioritising technical debt works well here.
- Baseline metrics. The numbers measured during the audit, so the next review can show whether things improved.
The roadmap is what leadership will fund, so it needs to speak their language. CIOs surveyed by McKinsey reported that 10 to 20% of the technology budget dedicated to new products is diverted to resolving tech-debt issues (McKinsey, 2020). A report that shows where that money is being lost in your own system is far more persuasive than a generic quality score.
Common mistakes that weaken an audit
- Auditing only what tools can see. Static analysis is the start of a source code audit, not the whole of it. Architecture, delivery and knowledge risks never show up in a linter.
- Treating every finding as equal. A report with two hundred unranked issues gets filed and forgotten.
- Ignoring history. A snapshot hides trends. Version control and incident logs show whether the system is getting better or worse.
- Skipping the people. Engineers already know many of the problems. An audit that never talks to them rediscovers the obvious and misses the subtle.
- Recommending a rewrite by default. Most findings can be fixed incrementally, with zero downtime and reversible steps. A rewrite should be a conclusion supported by evidence, not a starting assumption.
- Using the audit to judge individuals. As soon as people expect blame, they stop sharing what they know, and the audit loses its best source of information.
Conclusion
A good code audit checklist covers the build, the architecture, the code, the tests, the dependencies, the data, the delivery pipeline, the knowledge in people’s heads and, now, the code written by AI assistants. Its value lies less in the list itself than in applying it consistently, rating findings on one scale and ending with an incremental plan tied to a real decision.
If you want this done by an independent team of senior engineers who work only on technical debt, our code audit follows this structure and ends with a prioritised, measurable roadmap. The first 30-minute call is free.