Code Quality Tool

Test Coverage Gap Finder

Identify untested functions prioritized by risk and complexity. Generate test stubs for uncovered code paths.

Get the CLI Tool

Run the coverage gap finder locally as an MCP server, or try it online below.

npx @clinetools/coverage-gaps
Requires Node.js 18+
  • Risk-based prioritization — complexity + exports + size
  • Automatic source-test file matching
  • Test stub generation for uncovered functions
  • JS/TS and Python support
  • Zero config — just run with npx

How to Use It

Three ways to find coverage gaps — pick the one that fits your workflow.

1

Try Online

Use the interactive demo below to paste source and test code — no install needed.

2

Use via CLI

Run as a local MCP server and connect any MCP-compatible client.

npx @clinetools/coverage-gaps
3

Add to AI Agent

Add the tool to your MCP settings for instant access from your AI assistant.

"coverage-gaps": { "command": "npx", "args": ["@clinetools/coverage-gaps"] }

MCP Client Configuration (Cline)

{
  "mcpServers": {
    "coverage-gaps": {
      "command": "npx",
      "args": ["@clinetools/coverage-gaps"]
    }
  }
}

Claude Code Configuration

# In your project's .mcp.json:
{
  "mcpServers": {
    "coverage-gaps": {
      "command": "npx",
      "args": ["@clinetools/coverage-gaps"]
    }
  }
}

Example Prompt: Find High-Risk Untested Functions

// Prompt to your AI agent:
"Find the 10 highest-risk untested functions"

// The agent calls:
find_coverage_gaps({
  path: "src/",
  sort: "risk",
  limit: 10
})

Example Prompt: Generate Test Stubs

// Prompt to your AI agent:
"Generate test stubs for all uncovered exported functions"

// The agent calls:
find_coverage_gaps({
  path: "src/",
  exported_only: true,
  generate_stubs: true
})
// Then writes test stubs to your test directory
Live Demo

Try It Online

Paste source code and test code below to find untested functions ranked by risk.

Source & Test Code

Enter your source code and any existing tests

Try a demo:

Paste code and click Find Gaps to see coverage analysis.

Untested Functions by Risk

Understanding Coverage Analysis

How the gap finder evaluates risk and prioritizes untested functions.

Risk Scoring

Each untested function gets a risk score (0–100) based on complexity (40pts), export status (20pts), line count (20pts), missing docs (10pts), and parameter count (10pts).

Test Coverage

Matches functions to tests by scanning describe, it, and test blocks for function name references. Detects both direct calls and string mentions.

Function Complexity

Cyclomatic complexity is calculated per function by counting branches: if, for, while, case, catch, logical operators. Higher complexity means higher risk when untested.

Test Stubs

Auto-generates test skeletons with correct function signatures, import paths, and placeholder assertions. Supports describe/it (Jest) and def test_ (pytest) styles.

Need Automated Coverage Gates?

Our Pro plan includes CI/CD coverage checks that block merges when test gaps exceed thresholds.

View Plans