---
title: "Measuring the Sloppiness of Code"
description: "Functionally correct LLM-generated code still accumulates slop such as needless abstractions, duplication and LOC explosions, and measuring it is hard."
url: "https://swe.quest/articles/measuring-the-sloppiness-of-code-601dfd1310c3a584"
canonical: "https://earendil.com/posts/measuring-code-sloppiness/"
source: "Earendil"
published: "2026-09-10"
difficulty: "medium"
kind: "Research"
reading_minutes: 5
tags: ["ai-coding","evals","static-analysis","llms"]
---

# Measuring the Sloppiness of Code

A post on [Earendil](https://swe.quest/sources/earendil.md), published 2026-09-10, 5 min read, Research. Original: [https://earendil.com/posts/measuring-code-sloppiness/](https://earendil.com/posts/measuring-code-sloppiness/)

## Summary

Functionally correct LLM-generated code still accumulates slop such as needless abstractions, duplication and LOC explosions, and measuring it is hard. LLM-as-judge scoring is unreliable and sensitive to labeling, and human review doesn't scale, while raw LOC change works surprisingly well until it becomes an optimization target. Two SlopCodeBench metrics, verbosity (AST-Grep-flagged plus clone lines over LOC) and erosion (share of complexity-weighted function mass in functions with cyclomatic complexity above 10), show agent code roughly twice as verbose (0.33 vs 0.15) and eroded (0.68 vs 0.31) as established repos. In SlopCodeBench's iterative, context-reset checkpoints, bad decisions compound and even frontier models reach a 0% strict solve rate.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Static analysis](https://swe.quest/tags/static-analysis.md) (Engineering practices)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- cyclomatic complexity
- LLM coding agents ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

SlopCodeBench, AST-Grep, Earendil, LLM-as-judge

## Related posts

- [You can’t vibe code a prompt](https://swe.quest/articles/you-can-t-vibe-code-a-prompt-7bae994c4b57de8e.md): incident.io · 2025-03-25 · Medium · 11 min read · LLMs, Evaluation, AI for coding
  Letting an LLM iteratively rewrite a prompt until evals pass produces overfitted, brittle prompts.
- [Introducing the LiveCodeBench Leaderboard - Holistic and Contamination-Free Evaluation of Code LLMs](https://swe.quest/articles/introducing-the-livecodebench-leaderboard-holistic-and-contamination-free-cd05ed71356a1cca.md): Hugging Face · 2024-04-16 · Easy · 4 min read · Evaluation, LLMs, AI for coding
  LiveCodeBench is a code-LLM benchmark built from LeetCode, AtCoder and CodeForces contest problems annotated with release dates, so models can be scored only on problems published after their training cutoff to avoid contamination.
- [Why coding agents fail in large codebases (and what to do about it)](https://swe.quest/articles/why-coding-agents-fail-in-large-codebases-and-what-to-do-about-it-67302cc99ae40bda.md): Sourcegraph · 2026-05-08 · Medium · 8 min read · AI for coding, AI agents, Search, Evaluation, RAG & retrieval
  Across 1,281 scored agent runs on 40+ large open-source repos (CodeScaleBench), coding agents fail in five repeatable ways: getting lost in exploration, picking the wrong file or symbol, partial completion, tool thrashing, and context overflow.
- [BigCodeArena: Judging code generations end to end with code executions](https://swe.quest/articles/bigcodearena-judging-code-generations-end-to-end-with-code-executions-e01cca9057c6a3ce.md): Hugging Face · 2025-10-07 · Medium · 9 min read · Evaluation, AI for coding, LLMs, Sandboxing & isolation
  BigCodeArena is a human-in-the-loop arena for code generation models that runs generated code in sandboxes, letting users interact with the output and vote on it.
- [StarCoder: A State-of-the-Art LLM for Code](https://swe.quest/articles/starcoder-a-state-of-the-art-llm-for-code-ae224d2374e67db4.md): Hugging Face · 2023-05-04 · Easy · 5 min read · LLMs, AI for coding, Evaluation, Open source
  StarCoder and StarCoderBase are ~15B-parameter code LLMs trained on 1 trillion tokens of permissively licensed GitHub data from The Stack 1.2, covering 80+ languages, commits, issues and notebooks, with StarCoder further fine-tuned on 35B Python tokens.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
