mopthing Get in touch

Every analyser · every project · back into the loop

The slop, measured.

The tools that find rotting code already exist: CRAP scores, complexity, duplication, coverage. Each speaks its own format in its own language, and none of it reaches the agent that wrote the code. mopthing runs them everywhere and hands the agent the mess.

Act I

Done, according to the agent.

The tests pass, so the work is done. Whether anyone would want to maintain it is a different question, and nobody asks it.

01 · Done!

The tests pass.

So the agent stops. Passing tests say the code does what was asked, not that it's code anyone can change next month.

assistant
Add retries to the uploader. Make sure it's solid.
Done! Retries with backoff, and all tests pass. ✓
$ go test ./upload/
ok upload 0.41s

02 · The analysers

A tool per language, a format each.

Complexity from one tool, coverage from another, the next project's linter in a third format. Run when someone remembers.

~/src
$ gocyclo -over 15 ./upload
31 upload Retry upload/retry.go:48:1
$ go test -cover ./upload/
coverage: 12.0% of statements
$ mix credo --strict
[F] Function is too complex (CC is 18)

03 · The math

Nobody puts it together.

Complex and untested, in the same function, is the code that breaks. The score says so in one number, and nobody computed it.

~/src
# CRAP = cc² × (1 − cov)³ + cc
✗ upload.Retry · CRAP 686 · limit 30
# found next week. the agent moved on.

That was one function.

tools run by hand
3
findings, own format
3
never reached the agent
1
findings the agent saw
0

Here's the same function, mopped.

Act II

The mopthing way.

The analysers stay the experts. mopthing runs them, reads them as one format, and puts the result where the agent will act on it.

01 · Every project

One command, every repo.

It knows each project's language and which analysers apply, and runs them all.

~/src
$ mopthing run ~/src/*
outboxthing go 4 tools 2 over
hostingthing elixir 3 tools 0 over
thinglaunch ts 3 tools 1 over
14 repos · one format

02 · One score

Complex and untested, at once.

CRAP squares the complexity and cubes the share left uncovered. A tangled function with tests passes, and so does a simple one without.

~/src/outboxthing
$ mopthing crap
FUNCTION CC COV CRAP
upload.Retry 31 12% 686
billing.Parse 9 40% 27
✓ 1 over 30 · 212 under

03 · Back to the agent

The finding is the next prompt.

A check after the agent's turn, on what it changed. Over the line, it exits non-zero, and its output says what to do.

~/src/outboxthing
$ mopthing check --changed
✗ upload.Retry CRAP 686 > 30
cover it or split it, then run again
exit 1 · handed back to the agent

04 · A ratchet

Old debt doesn't block.

Each repo keeps a baseline. What was already over is recorded, not failed; only new code and code that got worse goes back.

~/src/outboxthing
✓ baseline: 14 over, none worse
✓ new code: under 30, or it goes back
the baseline only moves down

Act III

Where the line is.

mopthing measures and reports. The analysis is the analysers' job, and the fix is the agent's.

  1. 1

    It wraps, it doesn't analyse

    gocyclo, credo, coverage, duplication: each stays upstream. mopthing reads what they print into one format.

  2. 2

    The stack first

    Go, Elixir and TypeScript, because that is what gets written here. Another language is another set of analysers.

  3. 3

    It fails where the agent can act

    On changed code, with a message that says what to do, inside the loop the reviewer runs (llmthing).

Code quality, both ways
Measure By hand mopthing
Analysers run when remembered every repo, one command
Output a format per tool one table
The agent sees nothing its own findings
Old debt blocks all or nothing a baseline that only drops

Agents writing faster than you read?

Tell me what your agents write. mopthing is how it gets checked here.

Get in touch