Skip to main content

Module delta

Module delta 

Source
Expand description

Edit-time cognitive-complexity delta.

Computes how an edit changes per-function cognitive complexity without touching the index — pure and deterministic, so it can run inside the edit path (ctx_edit, ctx_patch) and the native-edit hook to prevent complexity drift at the moment it is introduced. Functions are matched by name (their stable identity across an in-place edit).

Structs§

CognitiveDelta
One function’s cognitive-complexity change across an edit.

Functions§

cognitive_delta
Compare cognitive complexity of every function between old and new source for file ext. Returns only functions whose complexity changed, sorted by name. Empty when tree-sitter is disabled or nothing changed.
format_gate_notice
Deterministic one-line edit-gate notice. No timestamps/counters → #498-safe.
worst_regression
The most significant increase that ends above threshold, if any. This is what the edit-gate surfaces (one line, the worst offender).