Add lizard cyclomatic complexity check to pre-commit#1221
Add lizard cyclomatic complexity check to pre-commit#1221Hardcode84 wants to merge 1 commit intoiree-org:mainfrom
Conversation
Gate new code on CCN <= 50 and length <= 300. Existing violations are grandfathered via whitelizard.txt. Excludes vendored LLVM headers, generated code, tests, and examples. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
CCN 50 is extremely generous and all the whitelisted functions are legit candidates for refactoring. Even if we don't plan to fix them immediately, this will prevent us from creating the new ones. |
|
That's |
Lizard Complexity ReportGenerated: 2026-04-02 Whitelisted Violations (sorted by CCN)
Summary
Breakdown by Component
Notes
|
|
Breakdown by component shows that the more robust code review policy that I enacted in water works. Very basically, if people have to actually review your code, they will complain about cognitive complexity much sooner than tools. I agree with Tim on the intent: if there is no intent to rearchitect this code beyond asking an LLM to refactor it which will just try to game an artificial metric, let's not bother. If somebody wants to run the tool, maybe we can have it as an optional CI? |
|
If this is a pre-commit hook, then we can catch this even before submitting the PR? Doesnt that help reduce the cognitive load on the reviewer? |
Gate new code on CCN <= 50 and length <= 300. Existing violations are grandfathered via whitelizard.txt. Excludes vendored LLVM headers, generated code, tests, and examples.