Blog / Rescue

How we audit a codebase before taking it over

When someone asks us to take over a project, the first thing we do is find out what is actually there. Not what the last developer said, not what the screenshots show, but what the code does. This is the process, in the order we run it.

1. Gather every account

Before reading any code, we list every service the product depends on: domain, hosting, database, repository, email and SMS providers, payment gateways, app store accounts, analytics. For each one, who owns the account and who has access. Half of a rescue is often access, and finding a gap here first saves days later.

2. Build it from scratch

We clone the repository onto a clean machine and try to build and run it using only what is written down. If it does not build, that is finding number one, and it tells you a lot: the project depends on something that exists only on someone’s laptop.

3. Read the data model

The database structure is the hardest thing to change later, so it decides whether a project can be rescued cheaply. We look at how users, money, orders and permissions are stored, whether the relationships make sense, and whether the data matches what the code expects. A sound data model under messy code is good news. A broken data model under neat code is not.

4. Follow the money

If the product takes payments, we trace one payment end to end: checkout, gateway, webhook, ledger or balance, payout, refund. We look for the classic failures: amounts taken from the request body, duplicates checked in code instead of the database, balances edited rather than recorded, no reconciliation.

5. Security

We check for secrets in the code and its history, how passwords are stored, how sessions and permissions work, whether users can see each other’s data by changing an ID in a URL, and whether dependencies have known vulnerabilities.

6. Tests and deployment

Are there tests, and do they pass? How does code get from a laptop to the live server? Is there a staging copy? Are there backups, and has anyone restored one?

7. Check it against what was promised

We compare what works with what the client was told would work. Features that look finished on screen but do nothing underneath are common, and the client deserves to know.

8. Write it down

The report lists every finding with its severity, the evidence, what it costs the business, and a fix with a cost range. It ends with a recommendation: rescue, partial rebuild or full rebuild, with the numbers behind it.

We describe the code, not the person who wrote it. You need facts to decide, not someone to blame.

Rescue or rebuild?

Rescue usually wins when the data model is sound and the problems are in the layers above it. Rebuild usually wins when the data model is wrong, there are no tests and every change breaks something, or the code depends on tools nobody maintains. Even a rebuild keeps a lot: the design, the content, the lessons about what customers actually use, and often the data itself.

This audit is available on its own as a fixed-price code audit. You keep the report whatever you decide.

Where this comes from. We do this work for clients. See software rescue.

Questions about this post? Email contact@naxfront.com. Nancy reads every one.

WhatsApp