Skip to main content

AI slop patterns.

Named residue in AI generated code: comments that restate the next line, casts to any, swallowed errors, dead imports, todo stubs. aislop catches them deterministically. 58 patterns, 11 language targets. Each page has a flagged example, a clean example, and the rule id.

$npx aislop scan
4 of 58 auto-fixable
ai-slop/narrative-commentauto-fixable

Narrative comment

A multi-line comment block that walks through what the function does in prose. The signature already says it; the prose is decorative.

View pattern →
ai-slop/trivial-commentauto-fixable

Trivial comment

A single-line comment that restates exactly what the next line of code does. Removing it changes nothing for the reader.

View pattern →
ai-slop/swallowed-exceptionmanual fix

Swallowed exception

A try/catch where the catch block is empty or only contains a comment — failures vanish silently with no log, no rethrow, no recovery.

View pattern →
ai-slop/unsafe-type-assertionmanual fix

Unsafe type assertion

An `as any` cast — bypasses TypeScript's checker entirely. Every guarantee from the type system is gone for that value forward.

View pattern →
ai-slop/double-type-assertionmanual fix

Double type assertion

An `as unknown as X` cast — a double-cast escape hatch used when the compiler refuses a direct `as X`. Smuggles types through without validation.

View pattern →
ai-slop/ts-directivemanual fix

Unexplained TypeScript directive

A `@ts-ignore`, `@ts-expect-error`, or `@ts-nocheck` directive without a reason comment. Silences the type checker on that line forever.

View pattern →
ai-slop/todo-stubmanual fix

Orphan TODO stub

A `// TODO` without an owner, ticket, or completion plan. The kind that survives years.

View pattern →
ai-slop/generic-namingmanual fix

Generic naming

Variables and parameters named `data`, `result`, `value`, `temp`, `obj`, `info`, `item`. Names that say "this is a noun" without saying which noun.

View pattern →
ai-slop/unused-importauto-fixable

Unused import

An import that no remaining code references. Usually left over after a refactor or a deletion the agent forgot to follow through on.

View pattern →
ai-slop/console-leftovermanual fix

Console leftover

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

View pattern →
ai-slop/empty-functionmanual fix

Empty function

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

View pattern →
ai-slop/unreachable-codemanual fix

Unreachable code

Code after a `return`, `throw`, `break`, or `continue` that can never execute.

View pattern →
ai-slop/constant-conditionmanual fix

Constant condition

An `if` or `while` whose condition is a constant — `if (true)`, `while (false)`, `if (1)` — leaving a dead branch in the source.

View pattern →
ai-slop/thin-wrappermanual fix

Thin wrapper

A function that exists only to call another function with the same arguments — no transformation, no added value, just an extra layer.

View pattern →
ai-slop/duplicate-importauto-fixable

Duplicate import

Two `import ... from` statements for the same module in one file. Readers have to check two places for what one statement should say.

View pattern →
ai-slop/duplicate-type-declarationmanual fix

Duplicate exported type

The same exported `interface` or `type` alias, with the same name and body, declared in two TypeScript files. Two sources of truth for one shape.

View pattern →
ai-slop/hallucinated-importmanual fix

Hallucinated import

An import of a package the project does not declare. Often a plausible-sounding name a model made up, which fails at install or at runtime.

View pattern →
ai-slop/hardcoded-idmanual fix

Hardcoded ID

A provider, tenant, or project identifier pasted into source as a string literal: a Stripe price ID, an org ID, an API key. It bakes one environment into the code.

View pattern →
ai-slop/hardcoded-urlmanual fix

Hardcoded URL

A deployment-specific URL in source: an API base, a staging host, a webhook endpoint. The code works in one environment and quietly calls it from all the others.

View pattern →
ai-slop/hidden-fallbackmanual fix

Hidden fallback

A safe-looking default (`0`, `[]`, `{ ok: true }`) standing in for missing input or a failed call. A loud error becomes a quiet wrong answer.

View pattern →
ai-slop/meta-commentmanual fix

Meta comment

A comment about the task or the change rather than the code: "as per the requirements", "previously this called X", "no longer needed". It records the conversation that produced the code.

View pattern →
ai-slop/redundant-try-catchmanual fix

Redundant try/catch

A try/catch whose catch only rethrows the same error. It adds nesting and implies handling that does not exist.

View pattern →
ai-slop/redundant-type-coercionmanual fix

Redundant type coercion

`String(x)`, `Number(x)`, or `Boolean(x)` applied to a parameter already typed as that primitive. The conversion repeats what the type system already guarantees.

View pattern →
ai-slop/silent-recoverymanual fix

Silent recovery

A catch or except block that logs a message without the caught error and carries on. The failure is noticed and its cause thrown away.

View pattern →
ai-slop/tautological-testmanual fix

Tautological test

A test assertion that compares two fixed literals, such as `expect(true).toBe(true)` or `assert True`. It cannot fail and proves nothing about the code.

View pattern →
ai-slop/unknown-directivemanual fix

Unknown suppression directive

A comment such as `// aislop-ignore-nextline` whose scope is not a real directive. It looks like a suppression and suppresses nothing.

View pattern →
ai-slop/python-bare-exceptmanual fix

Bare except

An `except:` clause with no exception type. It catches everything, including `KeyboardInterrupt` and `SystemExit`, so Ctrl-C and clean shutdowns are swallowed along with the real bugs.

View pattern →
ai-slop/python-broad-exceptmanual fix

Broad except with pass

`except Exception: pass` (or `BaseException`): a handler that catches every ordinary error and does nothing with it. The failure leaves no trace.

View pattern →
ai-slop/python-chained-dict-getmanual fix

Chained dict.get

A `.get(key, {})` whose empty-dict default is fed straight into another `.get(...)`. Missing data at any level silently becomes an empty value.

View pattern →
ai-slop/python-isinstance-laddermanual fix

isinstance ladder

Four or more `if`/`elif isinstance(x, ...)` branches testing the same variable. Type dispatch written out by hand, one branch per type.

View pattern →
ai-slop/python-mutable-defaultmanual fix

Mutable default argument

A function parameter that defaults to `[]`, `{}`, or `set()`. Python evaluates the default once, so every call that omits the argument shares and mutates the same object.

View pattern →
ai-slop/python-print-debugmanual fix

Print debugging

A `print()` call left in library or application code. Usually a trace from a debugging session that shipped.

View pattern →
ai-slop/python-range-len-loopmanual fix

range(len()) loop

`for i in range(len(items)):` is a C-style index loop where Python offers direct iteration or `enumerate`.

View pattern →
ai-slop/python-repetitive-dispatchmanual fix

Repetitive string dispatch

Four or more `if`/`elif x == "..."` branches comparing the same variable against string literals. A dispatch table written out longhand.

View pattern →
ai-slop/csharp-async-voidmanual fix

Async void method

An `async void` method. Callers cannot await it, and an exception thrown inside it escapes every caller's try/catch and can crash the process.

View pattern →
ai-slop/csharp-broad-catchmanual fix

Broad catch

A `catch (Exception)` that handles everything and never uses the caught exception. Problems you did not plan for disappear along with the one you did.

View pattern →
ai-slop/csharp-console-leftovermanual fix

Console leftover in C#

`Console.Write`/`WriteLine` in library code, or `Debug`/`Trace` write calls in shipped code. Usually output left over from debugging.

View pattern →
ai-slop/csharp-empty-catch-rethrowmanual fix

Catch that only rethrows

`catch (...) { throw; }`: a handler whose only statement rethrows. It changes nothing and adds a try block to read.

View pattern →
ai-slop/csharp-if-laddermanual fix

If/else-if ladder

Four or more chained `if`/`else if` branches comparing the same value with `==` against a constant. A `switch` written longhand.

View pattern →
ai-slop/csharp-index-loopmanual fix

Index for-loop

`for (int i = 0; i < items.Length; i++)` where `i` is only used to read `items[i]`. A `foreach` with extra plumbing.

View pattern →
ai-slop/csharp-linq-countmanual fix

Count() emptiness check

`.Count() > 0` or `.Count() == 0` used to ask whether a sequence has any elements. On a lazy enumerable it walks every element to answer a yes/no question.

View pattern →
ai-slop/csharp-not-implementedmanual fix

NotImplementedException stub

`throw new NotImplementedException()` in shipped code. The member compiles; the caller fails at runtime.

View pattern →
ai-slop/csharp-null-forgivingmanual fix

Null-forgiving operator

A postfix `!` (`user!.Name`, `GetValue()!`) that tells the compiler a value is not null. It silences the nullable warning without checking anything.

View pattern →
ai-slop/csharp-redundant-doc-commentmanual fix

Redundant XML doc comment

A one-line `/// <summary>Gets or sets the name.</summary>` that restates the member name. It documents nothing the signature does not already say.

View pattern →
ai-slop/csharp-string-concat-in-loopmanual fix

String concatenation in a loop

`result += "..."` inside a loop. Strings are immutable, so each iteration allocates a new string and copies the old one: quadratic work for a linear job.

View pattern →
ai-slop/csharp-suppressed-warningmanual fix

Unexplained warning suppression

A `#pragma warning disable` with no comment, or a `[SuppressMessage]` with no real `Justification`. The analyzer finding is hidden and nobody knows why.

View pattern →
ai-slop/csharp-sync-over-asyncmanual fix

Sync over async

Blocking on a task with `.Result`, `.Wait()`, or `.GetAwaiter().GetResult()`. It ties up a thread and can deadlock under a synchronization context.

View pattern →
ai-slop/cpp-c-style-castmanual fix

C-style cast

A C-style cast such as `(int)x` or `(double)total` in C++ code. It may perform a static, const, or reinterpret conversion, and nothing in the syntax says which.

View pattern →
ai-slop/cpp-define-constantmanual fix

#define constant

`#define MAX_RETRIES 5` in C++: a macro used as a constant. It has no type, ignores scope, and is gone before the debugger sees it.

View pattern →
ai-slop/cpp-endl-in-streammanual fix

std::endl in a stream

`<< std::endl` used as a newline. It also flushes the stream every time, which is costly in loops and file output.

View pattern →
ai-slop/cpp-iostream-leftovermanual fix

iostream leftover

`std::cout` or `std::cerr` in library code. Usually debug output that shipped.

View pattern →
ai-slop/cpp-manual-deletemanual fix

Manual delete

A raw `delete` or `delete[]` on a pointer. Ownership is manual, so an early return or exception between `new` and `delete` leaks, and a second `delete` is undefined behaviour.

View pattern →
ai-slop/cpp-not-implementedmanual fix

Not-implemented stub

A function that throws `std::logic_error` or `std::runtime_error` with a "not implemented" message, or asserts `false && "not implemented"`. It compiles and fails at runtime.

View pattern →
ai-slop/cpp-null-literalmanual fix

NULL instead of nullptr

The `NULL` macro in C++ code. It is an integer constant in disguise, so it can select the wrong overload where `nullptr` cannot.

View pattern →
ai-slop/cpp-using-namespace-std-in-headermanual fix

using namespace std in a header

`using namespace std;` in a header file. Every file that includes the header inherits the whole `std` namespace and the name clashes that come with it.

View pattern →

Score your repo.

One command. 0–100 score. Every pattern above, every change. Auto-fix what's mechanical, hand off the rest with full context.

npx aislop scan