# What source code analysis reveals that documents do not

Source: https://techduediligence.co/insights/source-code-analysis-due-diligence/

A data room describes software in documents: diagrams, policies, asset lists and management answers. Source code analysis reads the software itself and its history, which record what was actually done. The differences between the two are usually the findings that matter.

## Key points

- Treat documents as claims, and the code and its history as the evidence against which to test them.
- Use the commit history to establish who wrote the software, then compare that list with the signed IP assignments.
- Ask what is tested, what is abandoned and what came from elsewhere, since none of it appears in a document.
- Insist that the analysis states its coverage, so that you know which repositories were read and which were not.

## Why documents and code diverge

Documents are written at one moment, by someone with a purpose, and they describe how things are meant to be. Code changes every working day. Nobody needs to be dishonest for the two to drift apart, and the managers who answer questions in technical due diligence often do not know the detail.

A repository is more than the current files. The version control system, usually Git, keeps every change ever made, with its author, its date and a description. That history is a working record, created as a by-product of building the product. It is difficult to alter convincingly after the fact.

| What the documents say | What the code and history can show |
|---|---|
| "All IP is owned by the company" | Every person who contributed, to be matched against signed assignments |
| "Comprehensive automated testing" | Which modules have tests, and whether they run and pass |
| "Five products" | Which repositories are active and which were last touched years ago |
| "We use open source responsibly" | Every component and its license, including copied files |
| "No known security issues" | Credentials stored in the code, components with published vulnerabilities |

## Who wrote what

The history lists every contributor. Set beside the employment and contractor agreements, it shows whether everyone who wrote material code also assigned the rights in it to the company. A contractor who wrote the billing module in 2019 and never signed an assignment is a gap in the chain of title, whatever the disclosure letter says.

The same list shows other things: contributions from email addresses at another company, an outside agency nobody mentioned, and work dated before the company was incorporated, which may belong to a founder personally or to a former employer. It also shows concentration: a core module written almost entirely by one person, who may or may not still be there.

The legal analysis is covered in [IP chain of title](/insights/ip-chain-of-title-software/). This article is general information and not legal advice. Ownership rules differ by jurisdiction, and counsel should be consulted.

## What is tested, and what is abandoned

"Tested" in a document can mean many things. The code shows which parts have automated tests, whether those tests run on every change, and whether they pass. It is common to find thorough tests around recent features and none around the old module that calculates what customers are charged.

Abandonment is equally visible:

- Modules that have not been touched in years while the product changed around them.
- A migration started and never finished, so that the old and the new mechanism both remain live.
- Features switched off for every customer and still carried in the code.
- A repository listed as a product in the asset schedule whose last change was three years ago.

This affects what the buyer is paying for. A product that is no longer developed is a different asset from one that is, and code that nobody dares to delete is a maintenance cost.

## What was copied

Most software contains code its team did not write, and most of that is declared. The project's manifest files list the open-source libraries it uses, and an analysis turns them into a software bill of materials (SBOM): an inventory of every component with its version and license.

Less visible is code copied directly into the company's own files: a source file lifted from an open-source project, sometimes with the license notice removed, a function pasted from a public forum, code brought from a previous job, or code produced by an AI assistant, which may resemble its training material. Comparison against known public code and analysis of how the code was written can find these.

Each has consequences for licenses and for ownership. Some open-source licenses attach conditions to distribution of the product that contains them, as explained in [open-source license risk in M&A](/insights/open-source-license-risk-m-and-a/).

## What code analysis cannot tell you

It does not show whether customers value the product, how the system behaves under real load, or why a decision was taken. It says nothing about systems that were not provided. An analysis of three repositories out of seven is silent on the other four, which is why coverage must be stated.

Automated tools also over-report. A license flagged in a testing tool that never ships to customers is not a problem. Neither is a "secret" that turns out to be a placeholder in sample code. A person has to separate the findings that matter from the noise, as set out in [automated scans and expert review](/insights/automated-vs-expert-due-diligence/).

Finally, sellers are rightly careful with source code. Analysis does not require handing the code to the buyer. It can be read by a neutral party in a controlled environment, with the findings shared and the code kept where it is.

## What it does to price and terms

Findings from code are specific, and specific findings can be negotiated. A missing assignment becomes a document to be signed before closing. A component under an unsuitable license becomes a replacement with a cost. A credential found in the history becomes an action to rotate it and check for misuse.

Code analysis also makes warranties checkable. A seller's statement that it owns the software, or that the product contains no code under certain licenses, can be tested before signing instead of being litigated afterward.

## How we approach it

Our premise is that the evidence is in the code and the contracts, and [our technology](/technology/) reads both. The seller connects repositories, infrastructure and contracts to a data room. Within a target of 72 hours from the room being ready to scan, the Automated Scan Report covers software composition and license compliance with a full SBOM, security scanning for vulnerabilities and secrets, an architecture map, code quality metrics, IP chain-of-title analysis and GenAI code provenance. In our standard engagement an in-house analyst then verifies the findings and removes false positives.

Every claim in the report cites a finding, every finding opens its source material, and each section states what was examined and what was not. The chain-of-title and provenance results are analysis, not legal advice.

The analysis runs in Codekeeper's private environment, in sandboxes with no network egress. Nothing is sent to AI vendors and nothing is used for training. The [security page](/security/) gives the detail.

## Questions we are asked

### Does the buyer get to see the source code?

That is for the parties to agree. In our process, access is read-only and scoped by role, and every view, download and scan is recorded in an audit trail both sides can see.

### Can a seller clean up the history before a sale?

History can be rewritten, but the result tends to show: a repository whose record begins abruptly a few months ago invites the question it was meant to avoid. Fixing real problems and disclosing them is the better course.

### What if the seller will not connect its repositories?

Where a seller only uploads files, we scan what is there and the report states its coverage, so both sides see what was not examined. A readiness score shows what is still missing for a fuller report.
