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/console-leftover manual fix

Console leftover.

`console.log` (or `print`, in other languages) left in production code after debugging.

Bad — what an agent ships
function reconcile(orders: Order[]) {
  console.log('reconciling', orders.length)
  for (const o of orders) {
    console.log('processing', o.id, o)
    process(o)
  }
}
Good — what aislop hands back
function reconcile(orders: Order[]) {
  log.debug('reconciling', { count: orders.length })
  for (const o of orders) {
    process(o)
  }
}

Agents trace execution with console.log during a session and forget to remove them. The logs end up shipped — noisy, untyped, ungrep-able.

How this rule is justified.

Rule id

ai-slop/console-leftover

Enforcing engine

ai-slop

Detector strategy

Deterministic AST match against debug-print calls (`console.log`, language equivalents) outside designated logging.

Legitimate code that is NOT flagged

Calls through a structured logger, and console use inside CLI tools or test setup, are not flagged.

Evidence

Provenance: repeated across public scans as debug output left in production paths.