npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sulthonzh/ai-code-quality-analyzer

v1.0.0

Published

CLI tool that analyzes code quality and outputs metrics for humans and AI agents

Readme

codeq — AI-friendly code quality analyzer

A zero-config CLI that scans your codebase and tells you what's actually going on. Outputs both human-readable reports and structured JSON that AI agents and CI pipelines can consume.

Why this exists

Most code quality tools are either enterprise-grade monsters or produce output that only CI systems understand. codeq gives you quick, actionable insights in your terminal — and when you need it, clean JSON for automation.

Built because I wanted something I could point at any project and immediately see: what's complex, what's duplicated, what's being postponed with TODOs, and whether the overall health is okay.

Install

npm install -g ai-code-quality-analyzer

Or run directly with npx:

npx ai-code-quality-analyzer .

Usage

# Analyze current directory
codeq

# Analyze a specific project
codeq ~/projects/my-app

# JSON output for CI / AI tools
codeq --json

# Quiet mode — just the summary
codeq --quiet

What it checks

| Metric | What it tells you | |--------|------------------| | File sizes | Which files are getting too big to maintain | | Cyclomatic complexity | How complex your functions are getting | | TODO/FIXME/HACK tracking | What you're postponing (and who's responsible) | | Code duplication | Blocks that appear in multiple places | | Import analysis | Dependency graph stats per file | | Overall score | 0-100 health score for the codebase |

Example output

codeq — code quality report
─────────────────────────────
📁 42 code files (67 total)
📝 3,218 lines of code (4,502 total)
⭐ Score: 78/100

Most complex files:
  src/analyzer.js                           complexity: 24 ████████
  src/reporter.js                           complexity: 12 ████

TODOs & FIXMEs (7):
  src/analyzer.js:45 — TODO: handle edge cases
  src/cli.js:12 — FIXME: arg parsing is fragile

Recommendations:
  ⚠️ 2 file(s) exceed 500 lines. Consider splitting.
  💡 3 potential duplicate blocks found.
  ✅ Codebase looks healthy overall.

JSON output

Use --json for structured output perfect for CI or AI agents:

codeq --json | jq '.summary.score'

The JSON includes: summary, per-file metrics, duplicate detection, and actionable recommendations with severity levels.

Score calculation

The 0-100 score starts at 100 and deducts points for:

  • Large files (>500 lines): -2 each
  • High complexity (>20 per function): -3 each
  • TODOs/FIXMEs: -0.5 each (capped at -15)
  • Duplicate code blocks: -1.5 each (capped at -20)
  • Low code-to-comment ratio: -1 each

Exit code is 1 if score drops below 50 (configurable with --threshold). Useful for CI gates.

Branch comparison (--compare)

See how your code quality changed between git refs:

# Compare current branch against main
codeq --compare main

# Compare against a tag
codeq --compare v1.0.0

# JSON output for automation
codeq --compare main --json

Example output:

codeq — branch comparison
─────────────────────────────
  base: main
  head: HEAD

  Score:   72 → 80  (+8 ↑)
  Files:   10 → 12  (+2)
  Lines:   500 → 600  (+100)

Resolved issues:
  ✅ 1 file(s) exceed 500 lines. Consider splitting.

✅ Quality improved!

In compare mode, --threshold controls how much degradation is acceptable. Exit code is 1 if the score drops by more than the threshold value.

CI / GitHub Actions

Use --threshold to set a quality gate in CI:

# Fail if score < 70
npx ai-code-quality-analyzer --json --threshold 70 .

Quick setup

Drop this workflow into .github/workflows/code-quality.yml:

name: Code Quality
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npx ai-code-quality-analyzer --json --threshold 70 .

The pipeline fails when the score drops below your threshold. Adjust --threshold to whatever bar makes sense for your team.

With artifact upload

Want to keep the full report? Upload it as an artifact:

      - run: npx ai-code-quality-analyzer --json . > quality-report.json
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: quality-report
          path: quality-report.json

Supported languages

JavaScript, TypeScript, Python, Ruby, Go, Rust, Java, Kotlin, C/C++.

License

MIT