Work / Our projects

SlopGuard: one number for the code your agents run on.

Coding agents iterate by changing code and running tests. Where the tests are missing, that loop has no feedback and the agent is guessing. SlopGuard scores every method on how tangled it is against how little of it is tested, and lets you gate the result in CI.

The interactive wCRAP explorer: a score curve against test coverage, with sliders for cyclomatic complexity, cognitive complexity and coverage.
The score, made draggable. Move coverage along the curve and watch a method of 271 fall under the threshold at 62%.
The SlopGuard home page: reduce complexity, increase coverage.
The home page. The claim is specific: find the methods agents break first, turn them into one number.
Example output: a shell command piping SlopGuard's JSON through jq to return the worst-scoring method.
Versioned JSON out of the box, so the report is something jq and an agent can both read.

The problem

An agent works the same loop a person does: change the code, run the tests, read the result. Where there are no tests, the third step returns nothing useful, and the agent cannot tell a fix from a regression. Complexity makes it worse. A deeply nested, many-branched method blows past what any model reasons about reliably, and those are exactly the methods people avoid writing tests for. The 2 failures compound, and they compound in the places nobody is looking.

The quality of the loop is decided by your codebase, not by the model you point at it. That is the whole premise: reduce complexity, increase coverage.

One score per method

SlopGuard weighs how tangled a method is against how much of it the tests actually exercise, and returns a single number:

wCRAP = (cyc × cog) × (1 − cov/100)³ + √(cyc × cog)

3 parts, each doing a job. (cyc × cog) is the tangle: how many independent paths run through the method, times how hard it is for a human to follow. (1 − cov/100)³ is untested risk, cubed, so the risk falls off a cliff as soon as you start testing — 50% coverage removes 87.5% of it. √(cyc × cog) is the floor: even at full coverage a tangled method is still tangled, and only refactoring goes below it.

A real method from SlopGuard’s own report: cyclomatic complexity 17, cognitive complexity 15, no tests. It scores 271 against a threshold of 30. Take it to 62% coverage and it passes without a line of its logic changing.

What shipped

  • Analyzers for Go, Kotlin, Python, Swift and TypeScript
  • wCRAP scoring, one number per method, worst first
  • A CI gate that fails the build above a threshold
  • Plain text reports for people, stable versioned JSON for everything else
  • A leaderboard you can hand to an agent as a work queue
  • An interactive explainer, so the formula is arguable rather than magic

Why we built it

Because we ship with agents every day and needed the guardrail ourselves. The commercial claim this practice makes is speed and quality, not speed instead of it, and that claim is worth very little without something measuring the second half. SlopGuard runs against its own source, and the worst method in its own codebase is published on the home page rather than hidden.

The project

Project
SlopGuard
Type
Own product
Sector
Developer tooling
Languages
Go, Kotlin, Python, Swift, TypeScript
Interface
CLI, plus versioned JSON
Metric
wCRAP, per method
Gate threshold
30
Source
Public on GitHub
Status
Live

Tell me about the opportunity.

One conversation, 30 minutes. You describe what you want to exist. I tell you what it would take, what it would cost and whether I am the right person to build it. If we go ahead, you have the written specification within a day.

Start the conversation