All member projects

Code · Built by members

crap4ts

CRAP scores for TypeScript. It mixes cyclomatic complexity with test coverage to give a deterministic quality gate for agent-written code.

Conceptual illustration: CRAP scores for TypeScript. It mixes cyclomatic complexity with test coverage to give a deterministic quality gate for agent-written code.
AI-generated editorial illustration, not a product screenshot.

What it is

crap4ts calculates CRAP (Change Risk Anti-Patterns) scores for TypeScript and TSX code. The score combines each function's cyclomatic complexity with its test coverage, so complex code with little testing scores high.

It is meant as a deterministic quality gate for code written by AI agents. A CI check fails when any function goes over a threshold, 8 by default, and agents can be asked to bring their scores down.

What it does

  • Scores every function from Istanbul coverage output, such as Vitest V8 coverage.
  • Fails with a clear exit code when a function goes over the threshold.
  • Human, JSON and Markdown output, including a compact pull request summary.
  • Can gate only the functions changed since a given git ref.
  • Ships as an npm package and a GitHub Action.

Built with

  • TypeScript
  • Node.js
  • Vitest
  • Istanbul
  • GitHub Actions
  • npm
  • developer tools

More from the community

Code

governed-agent

by Jeremy

Capability-based security, scope-bounded planning and out-of-band audit for autonomous LLM agents.

App

ArchLang

by Chan

An open-source language for floor plans, now also inside ChatGPT: ask for a plan in plain words and ChatGPT writes it in ArchLang, compiles it and checks it.

App

Remote Clipboard

by Ming

Copy on one device and paste on another, or share with people and agents, through a short-lived room or the rclip CLI.

Back to all member projects