Code Quality Tool

Comment Quality Analyzer

Find outdated, misleading, and redundant comments. Detect TODO/FIXME/HACK markers. Score your comment-to-code ratio.

Get the CLI Tool

Analyze comment quality locally as an MCP server, or try it online below.

npx @clinetools/comment-quality
Requires Node.js 18+
  • Detects TODO, FIXME, HACK, XXX, WORKAROUND markers with context
  • Flags redundant comments that just restate the code
  • Identifies stale comments referencing renamed or deleted code
  • Calculates comment-to-code ratio with letter grade (A-D)
  • Preference conversation — set your ideal ratio and marker severity

How to Use It

Keep your comments honest, useful, and up to date.

1

Try Online

Paste code below and the tool analyzes every comment for quality.

2

Use via CLI

Scan your entire codebase for comment issues. First run asks your preferences.

npx @clinetools/comment-quality
3

Add to Cline / Claude Code

Agent flags stale comments when modifying code and removes ones that don't match.

"comment-quality": { "command": "npx", "args": ["@clinetools/comment-quality"] }

MCP Client Configuration

{
  "mcpServers": {
    "comment-quality": {
      "command": "npx",
      "args": ["@clinetools/comment-quality"]
    }
  }
}

Preference Conversation (First Run)

// On first run, the tool asks:

1. "What's your ideal comment-to-code ratio?"
   [ ] Minimal (5-10%) - comments only where logic isn't obvious
   [x] Moderate (10-20%) - key decisions and complex logic documented
   [ ] Thorough (20-30%) - most functions have explanatory comments

2. "How should I handle TODO/FIXME markers?"
   [x] Flag all as issues with severity ranking
   [ ] Only flag if older than 30 days
   [ ] Ignore markers entirely

3. "What about commented-out code?"
   [x] Always flag - use version control instead
   [ ] Flag if more than 3 lines
   [ ] Ignore

// Preferences saved to .clinetools/comment-quality.json
Live Demo

Try It Online

Paste code to analyze comment quality, find stale markers, and get a quality score.

Paste Code to Analyze

We check comments for quality, relevance, and markers like TODO/FIXME

Try a demo:

Paste code and click Analyze Comments to get a quality score.

Issues

Why Comment Quality Matters

Bad comments are worse than no comments. They actively mislead developers and create false confidence.

Stale Comments Lie

When code changes but comments don't, the comment becomes a lie. A developer trusting "// returns user email" when the function now returns an ID will introduce a bug. Stale comments are actively harmful.

TODOs Pile Up

Without tracking, TODO comments become permanent fixtures. The average codebase has TODOs over 2 years old. Regular auditing turns forgotten markers into actionable tickets or removes them.

Redundant = Noise

"// increment i" above "i++" adds zero value but costs reading time. Redundant comments train developers to skip all comments, including the important ones. Less is more.

AI Generates Comments

AI coding assistants frequently add redundant comments to generated code. A comment quality check after AI generation strips the noise and keeps only comments that add real value.

Good Comments Explain Why

The best comments explain WHY, not WHAT. "// Using retry because the API is flaky under load" is gold. "// make API call" is waste. This tool helps you tell the difference.

Keep Your Comments Honest and Useful

Add the Comment Quality Analyzer to your agent's toolkit and eliminate misleading documentation.

View Plans