Guide
Inheriting a codebase: how to assess it in your first two weeks
A practical plan for the first two weeks with a codebase you did not write: get it running, map it, find where the risk is, and decide what to stabilise before you change anything.
1Get it running
Whether you have taken over from a departed developer, an acquired team or an agency, the first job is the same: understand what you have before you change it. Most painful rewrites start with someone deciding too early that the old code was the problem.
- Build it from a clean checkout, following only the README. Every step that is missing or wrong is something the next person will hit too. Fix the README as you go.
- Run the tests, and record the real number that pass. It is your baseline.
- Deploy it to a test environment yourself. If only one person has ever done a release, that is your first risk.
2Map it
- The modules and how they depend on each other. Draw it, even roughly. Arrows that go both ways mark the places where a change spreads.
- Every way in: routes, APIs, jobs, queues and scripts. Anything that runs on a schedule is easy to forget until it fails.
- Every outside service the code calls. Find the accounts, who owns them, and who gets the bill.
- Where the important logic lives. Usually a handful of files do most of the work. Read those properly and skim the rest.
3Find where the risk is
Risk is not spread evenly. Look for the places where size, change and knowledge overlap:
- Hotspots
- Files that are both large and changed often. Git history gives you this in minutes, and it tells you where bugs will keep coming from.
- Single authors
- Code that only one person has ever touched. If they have gone, that code is now nobody's, and it deserves tests before changes.
- Missing tests
- Especially around money, permissions and data deletion. Add a test before you touch any of these, not after.
- Swallowed errors
- Catch blocks that log nothing or carry on as if all went well. They hide the failures you most need to see.
4Check the secrets and the data
- Search the code and its history for keys, passwords and tokens. Rotate anything you find, whoever you inherited it from.
- Find where each secret the running system uses is actually stored, and who else can read it.
- Find the data: what is stored, where, how it is backed up, and whether a restore has ever been tested. Do one yourself.
- Check what personal information the system holds against what the privacy policy says it holds.
5Decide before you change it
With the map and the risks in front of you, sort the work into three piles:
- Stabilise now
- Rotated secrets, a tested restore, monitoring that tells you when it breaks, and tests around the riskiest logic. None of this changes what the system does.
- Improve as you go
- Split the worst hotspot when you next have to change it. Small, tested steps beat a planned refactor that never gets scheduled.
- Rewrite, rarely
- Only a part you now understand, whose problems you can name, and only when improving it in place would cost more. A rewrite of code you do not understand repeats its mistakes without its fixes.
6Write it down
Write down what you learned while it is fresh: an architecture overview with a diagram, the list of outside services and who owns each account, how to build, test and deploy, and the risks you found with what you did about them. It is the handover you wish you had been given.
7Where Repo Review fits
Repo Review reads the repository and reports on these points in a form a non-specialist can act on: a health verdict, seven ratings out of ten each with its weakest point, and the findings that matter, every claim checked against the source and read by an architect before it is released. The Snapshot is free, one per repository, and runs in about five minutes. The Full Audit (A$149 a repository at launch) works through every criterion and adds the risk register, a remediation roadmap, the architecture document with diagrams, and key-person, dependency and licence analysis.
For an inherited codebase the Full Audit is the useful one: its architecture document maps the modules, entry points and outside services with diagrams generated from the code, its symbol index links every function to its source, and it corrects the README against the code as a patch.
It reads the code, not the running system. It does not test production, scan your cloud accounts or replace a penetration test, and it says where the repository cannot answer a question (a backup that lives in a hosting console, for example). The code is not kept: the copy taken for a report is deleted as soon as the run ends.
See an architecture document on a real project: crewAI or Excalidraw.