Clean-code assessment · counted 29 Nov 2026
Does the code read like someone meant it?
Every project measured against ten clean-code checks — formatting, function size, control flow, file size, documented API surface, naming, debt markers, duplication, and the two gates that keep them honest in CI and pre-commit. Everything is counted from the repositories by a parser and a git reader; nothing on these pages is an opinion.
Clean code, measured. Robert C. Martin's Clean Code and Fowler's Refactoring name the smells — long function, duplicated code, misleading names, debt left in comments. Here each smell becomes a counted fact with a stated target, and where the fleet already has a gate (make fmt-check, pinned golangci-lint, lefthook), the target is the fleet's own rule. A miss is a finding, not a verdict.
How to read it
What is measured
- Seven Go checks from a real parser: 6,166 Go files and 33,562 named functions across 49 repositories — gofmt drift, function length, nesting, file length, doc comments on exported symbols, naming, exact duplicate bodies.
- Three pipeline checks for every project: debt markers counted by git grep across all code languages, the linter wired into CI, and lefthook pre-commit hygiene.
- Targets are stated, not tuned. Each threshold names its source: the fleet's own gates where they exist, Clean Code and Refactoring where they do not.
What the fleet looks like
- gofmt is totally clean: not one of the 49 Go repositories has a file that
gofmt -lwould rewrite — thefmt-checkgate holds everywhere it exists. - Zero debt markers in the comments of every code file of every project. In a fleet written by AI agents, the TODO ledger stays empty.
- Documented API surface: 92% of 32,145 exported symbols carry doc comments; the misses cluster in a few services.
- Duplication is the live smell: 833 exact function copies — the same logger constructor, the same readiness check, repeated per binary and per adapter.
Strongest signals in this run
- Median project score 90% of applicable checks met; 473 of 517 checks pass fleet-wide.
- 32 of 49 projects miss no copy-paste functions (<= 2% of named functions are exact duplicates). 11 of 49 projects miss documented api surface (>= 90% of exported symbols carry a doc comment). 1 of 58 projects miss lint wired into the pipeline (the repository’s linter runs in CI or pre-commit, not only on a willing machine).
- 58 of 58 projects run pre-commit gates through lefthook.
The ten checks
Smell → check → target. A check that does not apply to a project (no Go code, nothing to lint) is counted as n/a, never as a pass.
| Check | Characteristic | Target | Pass | Rate |
|---|---|---|---|---|
| gofmt-clean tree | Formatting (one style, machine-enforced) | 0 files gofmt would rewrite | 49 / 49 | 100% |
| Small functions | Functions (Clean Code: functions should be small) | <= 2% of named functions longer than 60 lines | 49 / 49 | 100% |
| Flat control flow | Functions (depth of nesting) | 0 functions with control flow nested deeper than 4 | 49 / 49 | 100% |
| Small files | Files (one file, one idea) | 0 non-test files over 800 lines | 49 / 49 | 100% |
| Documented API surface | Comments (the API contract in godoc) | >= 90% of exported symbols carry a doc comment | 38 / 49 | 78% |
| Idiomatic names | Meaningful names (Go conventions) | 0 exported names with underscores | 49 / 49 | 100% |
| No debt markers | Hygiene (the ledger in the code) | 0 debt markers | 58 / 58 | 100% |
| No copy-paste functions | Duplication (Refactoring: Duplicated Code) | <= 2% of named functions are exact duplicates | 17 / 49 | 35% |
| Lint wired into the pipeline | Governance (the gate, not the intention) | the repository’s linter runs in CI or pre-commit, not only on a willing machine | 57 / 58 | 98% |
| Pre-commit hygiene | Governance (the fastest gate) | lefthook pre-commit runs the fast gates before a commit exists | 58 / 58 | 100% |
Every project, check by check
✓ meets the target, ✗ misses it, · not applicable. The last columns count applicable checks passed, the clean share, and link to the project's architecture assessment.
| Project | gofmt | Funcs | Nesting | Files | Docs | Names | Debt | Dup | Lint | Hooks | Pass | Clean | Architecture |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| WES bounded contexts · 14 projects | |||||||||||||
| amr-fleet-control | pass | pass | pass | pass | fail | pass | pass | pass | pass | pass | 9 / 10 | 90 | architecture ↗ |
| asrs-control | pass | pass | pass | pass | fail | pass | pass | pass | pass | pass | 9 / 10 | 90 | architecture ↗ |
| exception-management | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| fulfillment-execution | pass | pass | pass | pass | fail | pass | pass | fail | pass | pass | 8 / 10 | 80 | architecture ↗ |
| labor-performance | pass | pass | pass | pass | fail | pass | pass | fail | pass | pass | 8 / 10 | 80 | architecture ↗ |
| material-flow-control | pass | pass | pass | pass | fail | pass | pass | pass | pass | pass | 9 / 10 | 90 | architecture ↗ |
| network-fulfillment | pass | pass | pass | pass | fail | pass | pass | fail | pass | pass | 8 / 10 | 80 | architecture ↗ |
| network-inventory-planning | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| order-management | pass | pass | pass | pass | fail | pass | pass | fail | pass | pass | 8 / 10 | 80 | architecture ↗ |
| process-path-management | pass | pass | pass | pass | fail | pass | pass | fail | pass | pass | 8 / 10 | 80 | architecture ↗ |
| task-interleaving | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| warehouse-planning | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| wes-work-planning | pass | pass | pass | pass | fail | pass | pass | fail | pass | pass | 8 / 10 | 80 | architecture ↗ |
| workforce-management | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| Storefront bounded contexts · 6 projects | |||||||||||||
| checkout | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| customer-payments | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| pricing | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| product-content | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| product-discovery | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| shopping-cart | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| Retail-network bounded contexts · 12 projects | |||||||||||||
| customer-ordering | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| customer-returns | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| delivery-promise | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| last-mile-delivery | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| linehaul-transportation | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| node-performance | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| node-topology | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| offer-availability | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| order-sourcing | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| seller-inbound | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| shipping-and-tracking | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| vendor-connectivity | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| WMS bounded contexts · 10 projects | |||||||||||||
| dock-scheduling | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| facility-layout | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| inbound-receiving | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| inventory-storage | pass | pass | pass | pass | fail | pass | pass | pass | pass | pass | 9 / 10 | 90 | architecture ↗ |
| outbound-shipping | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| pick-face-replenishment | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| product-master | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| returns-processing | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| slotting-optimization | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| yard-management | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| Platform, harness and docs · 10 projects | |||||||||||||
| e2e-tests | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| ecosystem | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | fail | pass | 2 / 3 | 67 | architecture ↗ |
| equipment-emulator | pass | pass | pass | pass | fail | pass | pass | pass | pass | pass | 9 / 10 | 90 | architecture ↗ |
| iqvo-assets-control | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| payment-provider-simulator | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| provisioning | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | pass | pass | 3 / 3 | 100 | architecture ↗ |
| warehouse-docs | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | pass | pass | 3 / 3 | 100 | architecture ↗ |
| warehouse-harness-template | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| warehouse-infra | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | pass | pass | 3 / 3 | 100 | architecture ↗ |
| warehouse-ops-agent | pass | pass | pass | pass | pass | pass | pass | fail | pass | pass | 9 / 10 | 90 | architecture ↗ |
| Frontends and BFFs · 6 projects | |||||||||||||
| landing-page | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | pass | pass | 3 / 3 | 100 | architecture ↗ |
| storefront-bff | pass | pass | pass | pass | pass | pass | pass | pass | pass | pass | 10 / 10 | 100 | architecture ↗ |
| storefront-web | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | pass | pass | 3 / 3 | 100 | architecture ↗ |
| warehouse-console | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | pass | pass | 3 / 3 | 100 | architecture ↗ |
| warehouse-floor-client | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | pass | pass | 3 / 3 | 100 | architecture ↗ |
| warehouse-ui-kit | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | pass | not applicable | pass | pass | 3 / 3 | 100 | architecture ↗ |
Method, sources and blind spots
Where the numbers come from
- A Go parser (
scripts/cleancode_scan.go, stdlib only) reads an extractedgit archiveof each repository's default branch: gofmt equivalence viago/format, function length and nesting from the AST, doc comments from declarations, duplicate bodies from whitespace-stripped hashes. - git grep counts debt markers (TODO, FIXME, HACK, XXX on word boundaries) in code files of every language, tests and fixtures excluded.
- Makefiles, lint configs and CI workflows are read as text to decide whether the lint gate and pre-commit hooks are wired, and to name exactly what was found.
- The engineering study of the same day supplies the project list;
check.mjscross-checks that the two agree.
Definitions and thresholds
- Excluded everywhere:
testdata/,vendor/, generated files ("Code generated … DO NOT EDIT"), and*_test.gofor every code check except gofmt. Table-driven tests legitimately run long; they are not scored on length. - Function: a named function or method, measured in lines from the AST. 60 lines is the stated bar (Clean Code asks for far less; 60 is what this fleet can defend today), 2% the stated tolerance.
- Duplicate: two function bodies that are identical after stripping whitespace and comments, 5 lines minimum. Cross-repository repetition does not count — each context is deliberately its own repository.
- Stutter is counted, never scored. The golint rule flags
promise.PromiseMade; the fleet's CloudEvents grammar mandates entity-first event names. 143 such names exist and are listed as evidence on project pages, not as failures.
Blind spots
- Syntax only. The scanner has no type information: no cyclomatic complexity, no dead-code detection, no semantic duplication (a renamed copy is invisible), no judgement of whether a function does one thing.
- Size is a proxy. Small functions and small files correlate with readable code; they do not guarantee it. A 59-line function can be worse than a 70-line one.
- The gates are read, not run. Whether CI is green is the engineering study's question; this page only checks that the gates are wired.
- One point in time. The assessment is recounted with the reports; drift becomes visible only across runs.