
5 Code Smells Only AI Creates (And How to Detect Them)
I've mass-reviewed code from teams using Cursor, Copilot, and ChatGPT. After hundreds of PRs, I started noticing patterns — specific code smells that humans rarely produce, but AI generates constantly. Here are the top 5, with real examples and how to catch them automatically. The Hallucinated Import AI models confidently import packages that don't exist. Not typos — completely fabricated module names that sound plausible. import { validateSchema } from 'express-validator-utils'; // This package does not exist on npm from fastapi.middleware.logging import RequestLogger # This module doesn't exist in FastAPI Why does this happen? LLMs predict the most likely next token. A package named express-validator-utils is statistically plausible. The model doesn't check npm. It just guesses. How common: I've seen this in ~15% of AI-heavy PRs. It always passes code review because the name looks right. The Copy-Paste Clone Ask AI to "add a similar endpoint" and it will duplicate 30 lines with one f
Continue reading on Dev.to Webdev
Opens in a new tab



