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.
Every language · 26
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 →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 →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 →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 →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 →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 →Orphan TODO stub
A `// TODO` without an owner, ticket, or completion plan. The kind that survives years.
View pattern →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 →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 →Console leftover
`console.log` (or `print`, in other languages) left in production code after debugging.
View pattern →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 →Unreachable code
Code after a `return`, `throw`, `break`, or `continue` that can never execute.
View pattern →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 →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 →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 →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 →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 →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 →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 →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 →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 →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 →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 →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 →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 →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 →Python · 8
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 →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 →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 →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 →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 →Print debugging
A `print()` call left in library or application code. Usually a trace from a debugging session that shipped.
View pattern →range(len()) loop
`for i in range(len(items)):` is a C-style index loop where Python offers direct iteration or `enumerate`.
View pattern →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 →C# · 13
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 →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 →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 →Catch that only rethrows
`catch (...) { throw; }`: a handler whose only statement rethrows. It changes nothing and adds a try block to read.
View pattern →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 →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 →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 →NotImplementedException stub
`throw new NotImplementedException()` in shipped code. The member compiles; the caller fails at runtime.
View pattern →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 →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 →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 →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 →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 →C and C++ · 8
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 →#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 →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 →iostream leftover
`std::cout` or `std::cerr` in library code. Usually debug output that shipped.
View pattern →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 →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 →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 →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 →Go · 1
Rust · 2
Unwrap outside tests
`.unwrap()` on an `Option` or `Result` in production Rust code. A `None` or `Err` becomes a panic for the caller.
View pattern →todo! or unimplemented! stub
A `todo!()` or `unimplemented!()` macro in Rust code. It type-checks as any return type and panics when the path runs.
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