Skip to content

Coverage Audit

The coverage audit scans an entire directory of TypeScript files and produces a comprehensive report of Effect usage across your project. Use it to understand how much of your codebase uses Effect, identify files the analyzer struggles with, and track analysis quality over time.

Coverage audit showing 93 files discovered, 67 analyzed, 72% coverage

Terminal window
npx effect-analyze ./src --coverage-audit

This produces a report covering:

  • Discovery - how many files were found, analyzed, and failed
  • Coverage - percentage of files containing Effect programs
  • Zero-program files - files with no Effect programs, classified by type
  • Top offenders - files with highest complexity
  • Unknown node rates - files where the analyzer encountered unrecognized patterns
Files discovered: 142
Files analyzed: 138
Files failed: 4
Coverage: 72% (99/138 files contain Effect programs)

Files with no detected Effect programs are classified into categories:

ClassificationDescription
BarrelRe-export files (index.ts with only export * from)
ConfigConfiguration files (constants, env vars)
TestTest files (.test.ts, .spec.ts)
Type-onlyFiles with only type definitions
SuspiciousFiles that look like they should contain Effect but don’t

Show files that appear to import Effect but have no detected programs:

Terminal window
npx effect-analyze ./src --coverage-audit --show-suspicious-zeros

Show files with the highest percentage of unrecognized AST patterns:

Terminal window
npx effect-analyze ./src --coverage-audit --show-top-unknown

Add --show-top-unknown-reasons to include the specific patterns that weren’t recognized:

Terminal window
npx effect-analyze ./src --coverage-audit --show-top-unknown --show-top-unknown-reasons

Aggregate results by folder to see which parts of your project have the highest Effect adoption:

Terminal window
npx effect-analyze ./src --coverage-audit --show-by-folder

Output the audit as JSON for CI/CD integration:

Terminal window
npx effect-analyze ./src --coverage-audit --json-summary

This produces a machine-readable JSON object suitable for parsing in CI scripts, tracking metrics over time, or failing builds when quality thresholds are not met.

Include per-file timing data to identify slow files:

Terminal window
npx effect-analyze ./src --coverage-audit --per-file-timing
FlagDescription
--min-meaningful-nodes <n>Minimum node count to consider a file meaningful
--known-effect-internals-root <path>Treat local paths as Effect-like (reduces false suspicious zeros)
--exclude-from-suspicious-zero <pattern>Exclude patterns from suspicious-zero reporting
import { runCoverageAudit } from "effect-analyzer"
const audit = await runCoverageAudit("./src", {
showSuspiciousZeros: true,
showTopUnknown: true,
jsonSummary: false,
})
console.log(audit.discovered) // Total files found
console.log(audit.analyzed) // Files successfully analyzed
console.log(audit.failed) // Files that failed analysis
console.log(audit.coverage) // Coverage percentage