Built-in checks
This catalog is generated from CheckMeta in the cofferdam source — every check is guaranteed to be in sync with the running binary. The machine-readable index lives at checks.json and is consumed by AI agents.
Badges: graph — needs cross-file context: the whole-project import/export graph or a duplicate-detection corpus (what Biome/ESLint structurally can't do); file — analyzes one file in isolation; type-aware — routes through the ts-morph type host; advisable — cofferdam advise emits a file-specific constraint for it (not just the generic explanation).
Consistency
Consistency.BroadSuppressionfile— Broad-form// cofferdam-ignore(no check id) silences every check on the next line. Tighten to a scoped form so suppression intent is auditable:// cofferdam-ignore: <CheckId>: <reason>(colon-separator) or// cofferdam-ignore <CheckId> — <reason>(space-separator, em-dash or hyphen reason).Consistency.ErrorHandlingIdiomfile— The project predominantly uses one error-handling idiom (throwing, or returning an error-shaped value) — this file deviates from it, hurting consistency of error paths for callers.Consistency.QuoteStylefile— Mixed quote styles within a file hurt scanability. Use a consistent quote character (single or double) throughout.Consistency.UnusedSuppressionfile— Acofferdam-ignoredirective (next-line, range, or file-wide) targets a check ID that has no current finding in scope. The underlying issue was likely fixed or the code was deleted — the directive is now dead weight.
Design
Design.BarrelReexportBloatfile— A barrel file re-exports an unusually large fraction of its directory's exports versus other barrels in the project — the module's real public surface becomes unclear and tree-shaking is defeated.Design.BoundaryFrozenfileadvisable— File lives inside an architectural boundary marked frozen=true in cofferdam.invariants.toml. New code in this area should be reviewed against the boundary's stated reason.Design.ClassAsDataBagfile— A class with no behavior beyond storing fields — no methods, no inheritance, no implements clause — is a candidate for a plain type/interface instead.Design.DuplicateExportNamegraph— The same name is exported from multiple files. Barrel re-exports collide silently and importers can't tell which one they got.Design.DuplicateTypeShapefile— Two independently declared interfaces/type literals share (near-)identical field shapes under different names — likely should be a single shared type.Design.EffectLeakagefileadvisable— A module (or a specific function within one) opted into a@purecontract, but transitively imports a known side-effecting module (filesystem, network, a database client) somewhere down its import chain — the annotation is making a promise the code doesn't keep.Design.ImportCyclegraphadvisable— Files in this group import each other in a cycle. Cycles cause initialization-order surprises and obscure module boundaries.Design.ImportFanOutOutlierfile— A file's import fan-in or fan-out is a statistical outlier versus the rest of the project — a likely "god module" (doing too much) or over-centralized dependency (too many things depend on one module).Design.InvariantViolationgraphadvisable— An import edge violates a[invariants]rule declared in cofferdam.invariants.toml.Design.LayerViolationgraphadvisable— An import crosses a declared architectural layer in a direction not permitted by [layers].allow.Design.MaxParametersfileadvisable— Functions with too many parameters are hard to call correctly. Pass an options object instead.Design.MissingTestFilefileadvisable— A file exports at least one real (non-type-only, non-re-export) symbol but no corresponding test file exists anywhere in the project.Design.OrphanExportgraphadvisable— An exported symbol is never imported anywhere in the project. Likely dead code left over from a refactor.Design.ReadonlyArrayParamfile— A function parameter typed as a mutable array or object, but never mutated in the body, is a missedreadonlyguarantee — a type-checker-enforced promise to callers that's cheap to add and cheap for them to trust.Design.ScriptedInvariantgraph— A scripted invariant declared in cofferdam.invariants.toml under [invariants.scripted] is violated for this file.Design.UnionExhaustivenessGapfiletype-aware— A switch over a discriminated union's tag doesn't handle every variant and has no default case — adding a new variant later can silently fall through unhandled.Rust.MissingPubDocfile— Public items in a library crate compose the published API surface. Document eachpub fn/pub struct/pub enum/pub traitwith a///doc comment so consumers can understand what to call.
Readability
Readability.MaxFunctionLengthfileadvisable— Functions longer than the configured limit are hard to follow. Break them into smaller helpers.Readability.MaxLineLengthfileadvisable— Lines longer than the configured limit are harder to scan and review.
Refactor
Refactor.CognitiveComplexityfileadvisable— Sonar-style cognitive complexity. Branching breaks plus a nesting penalty — deeply nested code costs more than a long flat switch.Refactor.CyclomaticComplexityfileadvisable— McCabe cyclomatic complexity counts independent paths through a function. High values indicate branching that's hard to test and reason about.Refactor.DeadExportgraph— Every importer of this export imports its local binding and never references it. The export is dead even though it appears used.Refactor.DuplicateBlockgraphadvisable— Runs of statements that recur (after rename canonicalisation) in multiple files. Likely copy-paste — extract a shared helper.Refactor.LongAndComplexfileadvisable— Functions that are both long and complex are the strongest refactor candidates. Length alone catches flat config tables; complexity alone catches deeply-branching short helpers. The intersection is almost always a real refactor target.Refactor.MixedThrowAndReturnErrorfile— A function that both throws and returns an error-shaped object for what looks like the same class of failure mixes two error-handling idioms, hurting composability of error paths for callers.Refactor.MutatedParameterfile— Reassigning or mutating a function parameter breaks pure input→output semantics, making the function harder to test and reason about in isolation.Refactor.PreferArrayMethodOverLoopfile— A loop whose entire body pushes one computed value (optionally gated by a singleif) onto an accumulator array is more clearly expressed as.map()/.filter().Refactor.PreferConstOverLetfile— Aletbinding that's never reassigned should beconst— it signals the value doesn't change and rules out reassignment bugs at compile time.Refactor.PreferNullishCoalescingfile—x || defaultfalls through on every falsy value (0,"",false). Use??to fall through only onnull/undefined.Refactor.PreferOptionalChainfile—a && a.b && a.b.cis more concisely written asa?.b?.c. The optional-chain operator (?.) short-circuits on null/undefined.Refactor.PurityHeuristicfileadvisable— An exported function reads a module-level mutable binding not covered by its own parameter list — a hidden dependency on outside-the-signature state that works against unit-testability.Refactor.SideEffectInMapCallbackfile— A .map/.filter callback that mutates outer-scope state or calls a known side-effecting function isn't purely computing a value — it's a loop wearing a map costume.Refactor.UnusedVariablefile— Variables declared but never read are dead code. Prefix with_to opt out where the binding is intentionally unused (e.g., positional function parameters).
Warning
Html.MissingLangAttributefile— The document's<html>element has nolangattribute, so assistive technology and search engines can't determine the page's language.Rust.NoUnimplementedInNonTestfile—unimplemented!()/todo!()panic at runtime; calling them outside test code ships a guaranteed crash. Implement the function or move it into a#[test].Rust.NoUnwrapInLibfile— Calling.unwrap()in library code panics onNone/Err(_)with no diagnostic context. ReturnResultand propagate via?, or use.expect("<reason>")when the value is provably infallible.Warning.NoConsoleLogfileadvisable—console.log(...)calls are typically debugging leftovers. Route logs through a dedicated logger or strip them in CI.Warning.NoDebuggerfile—debuggerstatements halt execution under attached devtools. Remove before shipping.Warning.NoEvalfile—eval(...)andnew Function(...)execute arbitrary strings as code. Universally banned for security and performance reasons.Warning.TripleEqualsfile—==and!=perform type coercion and are almost always a bug. Use===and!==instead. · autofixWarning.UnusedImportfile— Re-export of a symbol that no other file imports from this file. Single-file linters miss this case.Warning.UnusedNullCheckfiletype-aware— An equality check againstnull/undefinedwhose other operand's TypeScript type already excludes that value — the guard can never change the outcome. Dead defensive code, or a hint the type annotation disagrees with reality.