ai-comment-emojis
Severity: WarningCategory: AI Telltales
Fixable: Yes Detects emojis in code comments, a common pattern in AI-generated code.
Why this matters
AI models often generate comments with emojis to make code more “friendly” or “visual”. While not harmful, emojis in comments are unprofessional in production code and can cause encoding issues in some environments.What it detects
The rule identifies any emoji characters in comments, including:- Smileys and people: 😀 🔥 💀 🤖
- Symbols: ⚠️ ✅ ❌ ⭐
- Objects: 🚀 💡 🔧 📝
Examples
Bad: Emojis in comments
Bad: Emojis in comments
Good: Plain text comments
Good: Plain text comments
Auto-fix
This rule can automatically remove emojis from comments while preserving the text.Location
apps/cli/src/rules/ai-comment-emojis.ts:1
ai-todo-comments
Severity: WarningCategory: AI Telltales
Fixable: Yes Detects excessive TODO/FIXME/HACK comments that AI often leaves behind.
Why this matters
AI models frequently generate TODO comments for functionality they don’t fully implement. While some TODOs are legitimate, excessive TODOs indicate incomplete or hastily generated code.What it detects
The rule looks for AI-generated TODO patterns:TODO: implement,TODO: fix,TODO: addTODO: later,TODO: soon,TODO: nextFIXME: later,FIXME: soon,FIXME: whenHACK: temp,HACK: temporary,HACK: workaround- Generic
TODO,FIXME,HACKcomments - TODOs with emojis
Threshold
Reports excessive TODOs if 3 or more are found in a file.Examples
Bad: Excessive AI TODOs
Bad: Excessive AI TODOs
Good: Complete implementations
Good: Complete implementations
Legitimate TODOs
Not all TODOs are bad. Good TODOs:- Reference specific tickets or issues
- Have clear ownership and timeline
- Describe why something is deferred
Location
apps/cli/src/rules/ai-todo-comments.ts:1
magic-numbers
Severity: WarningCategory: Best Practices Detects unnamed numeric constants (“magic numbers”) that hurt code readability.
Why this matters
Magic numbers are numeric literals without context. They make code harder to understand and maintain. AI-generated code often contains magic numbers that should be extracted to named constants.What it detects
The rule identifies:- Numbers appearing 3+ times in a file
- Numbers greater than 1000
- Excludes common safe values
Safe values (ignored)
Common numbers that don’t need extraction:- Boundaries: 0, 1, -1, 2, 10, 100, 1000
- HTTP status: 200, 201, 204, 301, 302, 400, 401, 403, 404, 500, 502, 503
- Binary/ASCII: 256, 128, 64, 32
- Time: 60, 3600, 24, 7, 30, 365
- Sizes: 1024, 4096, 8192
Examples
Bad: Magic numbers
Bad: Magic numbers
Good: Named constants
Good: Named constants
When to extract constants
Extract a number to a constant when:- It appears multiple times
- Its meaning isn’t obvious
- It represents a business rule or constraint
- It might change in the future
- You need to document what it represents
When numbers are OK
Numbers don’t need extraction when:- They’re obviously 0, 1, or -1
- They’re array indices
- They’re incrementing/decrementing
- Context makes them self-explanatory
Location
apps/cli/src/rules/magic-numbers.ts:1
Why these patterns indicate AI
AI language models:- Add emojis to make code “friendly” and “visual”
- Generate TODOs for functionality they can’t fully implement
- Use numeric literals without considering maintainability
- Focus on working code over production-ready code
Best practices
Refining AI-generated code
- Remove emojis from comments
- Complete or remove TODO comments
- Extract magic numbers to named constants
- Add context and documentation
- Review for maintainability
- Test thoroughly before deploying