This Rubber Duck Doesn't Debug — It Roasts
Source: Dev.to
Overview
Rubber Roast — a VS Code extension that turns your rubber duck into a judgmental code critic. Inspired by CS50’s rubber‑duck debugging, this duck not only listens but also reads your code, finds smells, and roasts you for them.
Every time you save a file, Rubber Roast scans for code smells and drops sarcastic inline annotations right next to the offending lines:
- Hard‑coded API key? “This credential has the security of a screen door on a submarine.”
- Empty
catch(e) {}? “Pokemon exception handling: gotta catch ’em all… and ignore ’em all.” - 47
console.logstatements? “This is not a program, it’s a console.log delivery system.” - TODO comment from 3 years ago? “This TODO has been through 47 sprints and 3 project managers.”
Each roast is color‑coded by severity—green for mild, yellow for medium, pink for spicy—and includes a duck emoji so you know exactly who’s judging you.
Two roast engines are included:
- Template mode (free) – hundreds of savage one‑liners, zero API calls.
- LM mode – uses VS Code’s Language Model API so your AI copilot can roast you too.
Rubber Roast catches 7 types of code smells via built‑in regex (TODO/HACK, empty catch, commented‑out code, console.log spam, hard‑coded secrets, long functions, repeated magic strings) plus everything your linters and language servers already flag (type errors, unused variables, deprecated APIs, lint violations, and more). Behind the jokes, it’s a real code‑smell detector.
Features
- Inline roast comments – sarcastic one‑liners appear as italic annotations next to problematic lines, color‑coded by severity (mild/medium/spicy).
- Two roast engines – free template‑based roasts or AI‑generated roasts via the VS Code Language Model API (requires Copilot or similar).
- Auto‑roast – triggers on file save, file switch, and diagnostic updates.
What Gets Roasted
Rubber Roast detects code smells from two sources:
Built‑in regex rules (no linter required)
| Smell | What it catches |
|---|---|
| TODO/HACK comments | // TODO, // FIXME, // HACK, // WORKAROUND, etc. |
| Empty catch blocks | catch(e) {} – swallowing errors silently |
| Commented‑out code | 3+ consecutive lines of commented code |
| Hard‑coded secrets | API keys, tokens, and high‑entropy strings |
| Console spam | Excessive console.log statements |
| Long functions | Functions exceeding a configurable line count |
| Repeated magic strings | Identical literal strings used in multiple places |
Linter & language‑server diagnostics
Rubber Roast also surfaces issues reported by existing tools such as ESLint, TypeScript, Pyright, Ruff, rust‑analyzer, etc., classifying them into roastable categories (type errors, unused variables, deprecated APIs, lint violations, and more).
Technical Details
- Implementation – TypeScript, zero runtime dependencies.
- VS Code Extension API – inline text decorations, diagnostic listeners, commands, status bar integration.
- Regex‑based scanner – custom pattern matching with line classification (code vs. comment vs. string) to avoid false positives.
- Diagnostic scanner – hooks into existing language servers and maps their output to roastable categories.
- VS Code Language Model API – optional AI‑powered roasts via Copilot with template fallback.
- Shannon entropy detection – catches hard‑coded secrets that don’t match known prefixes.
- Bundling –
esbuildbundles everything into a single file. - Privacy – No external APIs, no telemetry; all processing runs locally.
Get Started
- Marketplace: Rubber Roast on VS Code Marketplace
- Source code: GitHub repository
Open to any category the judges see fit — this duck doesn’t pick favorites, it just roasts everyone equally.