Measure and gate the structural decay a change introduces. Run it as a standalone CLI, a git pre-commit hook, or a plugin in GitHub, GitLab, and Jenkins CI.
Website: https://impactgate.officefloor.net
Structural decay is complexity accreting into existing structures. A god-method grows another branch. A god-class gains another method. The gate scores a change against a base ( main by default) with the change-impact measure:
impact = files_changed * Σ max(WMC_other, 1) * CC * Δlines (over changed functions)
WMC_other is the complexity already in the container you are editing. It is measured on the pre-change state. So importing a brand-new file or class is cheap. Nothing was there before. Piling onto an already-heavy class is expensive. That is the decay signal.
For the reasoning behind the formula, see Measuring the Blast Radius of Change on the OfficeFloor blog.
When impact is too high, the gate asks you to simplify the change or refactor the code it touches. It can warn (report only) or block (fail the build).
Install
pip install impact-gate # installs the `impact-gate` command
Or run it without installing anything, via the published image (git is bundled; mount the repo to score at /repo ):
... continue reading