Aikido

How to remove lingering TODO and FIXME comments from your codebase

Rule
Remove lingering TODO/FIXME comments
Unresolved TODO and FIXME comments indicate
incomplete work that can accumulate over time.
Track issues in your issue tracker instead of leaving them in code.

Supported languages: 45+

Introduction

TODO and FIXME comments start as helpful reminders but quickly become permanent fixtures in the codebase. What was meant as a temporary note becomes a warning sign that everyone ignores. These comments indicate unfinished work, deferred decisions, or known issues that nobody tracked properly. When you ship code with TODO comments, you're shipping acknowledgment that something isn't right, without any plan to fix it.

Why it matters

Code maintainability: TODO comments create ambiguity about code readiness and completeness. New team members don't know if these comments represent urgent issues or years-old notes that nobody cares about anymore. The more TODOs accumulate, the less seriously anyone takes them, creating a broken windows effect where quality standards erode.

Technical debt tracking: Issues hidden in comments don't get prioritized, assigned, or tracked. Your project management system shows everything is complete while the codebase contains dozens of "fix this later" notes. Without proper tracking, important issues get forgotten until they cause production problems.

Security implications: TODO comments sometimes mark incomplete security implementations or known vulnerabilities. A comment like "TODO: add authentication check" in production code means you shipped a security hole with full awareness. These markers make it easier for attackers reviewing your code to find weak points.

Code examples

❌ Non-compliant:

async function processPayment(userId, amount) {
    // TODO: Add fraud detection before processing
    // FIXME: This doesn't handle concurrent payments

    const user = await db.users.findById(userId);

    if (user.balance < amount) {
        throw new Error('Insufficient funds');
    }

    // TODO: Add transaction logging
    user.balance -= amount;
    await user.save();

    return { success: true };
}
 

Why it's wrong: Three critical issues (fraud detection, concurrency, logging) are marked but not resolved, indicating this function was shipped incomplete. These comments document known problems without any tracking or timeline to fix them.

✅ Compliant:

async function processPayment(userId, amount) {
    await fraudDetection.check(userId, amount);

    return await db.transaction(async (trx) => {
        const user = await trx.users
            .findById(userId)
            .forUpdate();

        if (user.balance < amount) {
            throw new Error('Insufficient funds');
        }

        user.balance -= amount;
        await user.save();

        await trx.auditLog.create({
            userId,
            action: 'payment',
            amount,
            timestamp: new Date()
        });

        return { success: true };
    });
}

Why this matters: All previously marked issues are resolved. Fraud detection is implemented, database transactions handle concurrency, and audit logging tracks all payments. The code is complete without apologetic comments about what's missing.

Conclusion

Remove TODO and FIXME comments before merging code to production. If work is incomplete, finish it or create tracked issues in your project management system with proper priority and assignment. Comments in code are invisible to project planning and make your codebase look perpetually unfinished.

FAQs

Got Questions?

What if I genuinely need to mark something for later?

Create an issue in your tracker (Jira, GitHub Issues, Linear) with context, priority, and assignment. Link the issue number in a comment if you must: // See issue #1234 for planned refactoring. This makes the work visible to project management and ensures it gets prioritized properly.

What if I genuinely need to mark something for later?

Create an issue in your tracker (Jira, GitHub Issues, Linear) with context, priority, and assignment. Link the issue number in a comment if you must: // See issue #1234 for planned refactoring. This makes the work visible to project management and ensures it gets prioritized properly.

Are there any acceptable uses of TODO comments?

In draft pull requests or feature branches that aren't merged yet, TODO comments help track incomplete work during development. Before merging to main, either complete the work or convert TODOs to tracked issues. Never merge TODO comments into production branches.

How do I handle TODOs in legacy code?

Audit them in batches. Many old TODOs are obsolete or already fixed. For valid issues, create tickets and remove the comments. Set a policy that new code cannot add TODOs. This prevents accumulation while you work through existing technical debt.

What about HACK or OPTIMIZE comments?

These suffer from the same problems as TODO comments. HACK indicates code you're embarrassed by but shipped anyway. OPTIMIZE suggests premature concern about performance. Either fix the code or accept it as-is without apologetic comments. Document actual performance requirements in tickets, not code comments.

Get secure for free

Secure your code, cloud, and runtime in one central system.
Find and fix vulnerabilities fast automatically.

No credit card required | Scan results in 32secs.