Complexity adversary
Reviews code changes for implementation complexity that appears disproportionate to the behavior being added.
Goals
The adversary is designed to produce a small number of high-confidence, actionable findings grounded in concrete repository evidence. Its review should be deterministic where possible, explicit about impact, and quiet when the available evidence does not justify a finding.
Scope
It evaluates changed JavaScript and TypeScript functions against their previous versions using established complexity metrics and structural design signals. A narrow cross-language signal also recognizes when changed Python or Rust code copies an established same-file multi-step operation instead of reusing it.
The complete detector or review inventory is maintained in CHECKS.md.
Package and usage
- Catalog reference:
review/complexity - Version: See package.json.
- Runtime: Node.js 22
- Repository: https://github.com/doomerlabs/complexity-adversary
Run it against a local change with:
doomer run review/complexity --path /path/to/repository
This repository does not currently declare a project license. The published artifact retains the license files for its bundled third-party runtime dependencies.
Boundaries
It judges complexity introduced by a change, not style, security, type safety, or unchanged legacy complexity. New files have no prior implementation, so their initial line and branch counts do not trigger growth findings; concrete abstraction and indirection signals can still be reported. When the supplied git baseline is missing or unavailable, the scan makes a conservative snapshot assessment without claiming metric growth. The clone signal requires the base revision to contain exactly one normalized occurrence and the change to introduce a second changed occurrence, so existing duplication, short idioms, comments, literals, generated code, and independently introduced symmetric implementations stay quiet.
SDK source coverage
This release uses SDK 0.1.43. This reviewer uses deterministic prepared evidence rather than repository-tool model retrieval, so it has no model coverage result to reinterpret. Existing evidence gates and deterministic findings are preserved.
SDK 0.1.43
This release rebuilds with SDK 0.1.43. SDK PR #73 adds a tested neutral fallback to formatOpinionAsync when concern wording validation is exhausted, preserving completed findings and the ship decision. Reviewers that do not call this API retain their existing opinion behavior. Provider and transport failures remain errors. Domain rules and evidence requirements are unchanged.