Skip to main content
New aislop v0.9.4: four new Python rules from the SlopCodeBench paper, plus a CLI star prompt and GitHub Discussions. Read more →
ai-slop/empty-function manual fix

Empty function.

A function with no body — usually a placeholder the agent stubbed to make a signature compile and forgot to fill in.

Bad — what an agent ships
function handleSubmit(values: FormValues) {
}

export function Form() {
  return <form onSubmit={handleSubmit}>...</form>
}
Good — what aislop hands back
// either implement it
function handleSubmit(values: FormValues) {
  return saveDraft(values)
}

// or remove it and let the form be uncontrolled until you decide

When asked to scaffold, agents stub functions to make types resolve, then forget to come back. The empty body ships and silently no-ops.

How this rule is justified.

Rule id

ai-slop/empty-function

Enforcing engine

ai-slop

Detector strategy

Deterministic AST match: flags function bodies that contain no statements.

Legitimate code that is NOT flagged

Intentional no-op callbacks, abstract method stubs, and interface declarations are not flagged.

Evidence

Provenance: repeated across public scans as scaffolding left unfinished.