BetaViberTest is in active development — expect breaking changes.
Overview
#017lowAI-Specific Smells
AI Smell
Detects signs of unreviewed AI-generated code: console.log, generic names, obvious comments.
Rule ID:
ai-smellExamples#
BadConsole.log, generic names, obvious comments
// console.log left in production
console.log('data:', data);
console.log('user fetched');
// Generic variable names
const data = await fetchData();
const result = processData(data);
const temp = result.filter(item => item.active);
const info = getInfo();
// Obvious comments restating code
// Set the user name
const userName = user.name;
// Check if active
if (isActive) { /* ... */ }
// Generic file: utils.ts, helpers.ts
// Placeholder code
throw new Error('Not implemented');GoodDescriptive names, meaningful comments, no console.log
// Proper logging
logger.info('User fetched', { userId });
// Descriptive variable names
const activeUsers = await fetchActiveUsers();
const sortedByDate = activeUsers.sort(byCreatedAt);
const recentSignups = sortedByDate.filter(isRecentSignup);
// Comments explain WHY, not WHAT
// Rate limit to 100 req/min per GDPR compliance requirement
if (requestCount > RATE_LIMIT) { /* ... */ }
// Specific file names: date-formatters.ts, auth-validators.ts
// Complete implementations, no placeholdersWhat It Detects#
mediumconsole.log in production code
console.log left in production code
Fix: Remove console.log or replace with a proper logger.
infoGeneric variable names (data, result, temp, info, item)
Generic variable name "{name}" — lacks semantic meaning
Fix: Rename to describe what it actually holds.
lowObvious comments restating code
Obvious comment that restates the code
Fix: Remove comments that restate WHAT. Good comments explain WHY.
mediumGeneric file names (utils.ts, helpers.ts, misc.ts)
Generic file name — likely a dumping ground
Fix: Rename to describe its purpose.
highPlaceholder code (throw new Error("Not implemented"))
Placeholder code detected — not production-ready
Fix: Complete the implementation or remove the placeholder.
lowAI attribution comments (Generated by ChatGPT/Claude)
AI attribution comment — code may need human review
Fix: Review AI-generated code carefully. Remove attribution after verification.
Configuration#
This rule is enabled by default. To disable it:
.vibertestrc.jsonjson
{
"rules": {
"ai-smell": {
"enabled": false
}
}
}