Skip to content
aj-geddes avatar

Code Metrics Analysis

Measures cyclomatic complexity, cognitive complexity, maintainability, and churn to flag refactoring candidates and technical debt.

CCM score
38 of 100
skills.sh installs
464
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers complexity, maintainability index, and code churn analysis for assessing code quality and monitoring technical debt over time
  • Includes a TypeScript complexity analyzer, a Python analyzer built on radon, an ESLint complexity plugin, and CI/CD quality gate guides
  • Provides a TypeScript Compiler API example that reports cyclomatic and cognitive complexity, nesting depth, and function and class counts per file
  • Designed for code review automation, legacy code analysis, and enforcing thresholds as CI/CD quality gates

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill code-metrics-analysis -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Code Metrics Analysis

Table of Contents

Overview

Measure and analyze code quality metrics to identify complexity, maintainability issues, and areas for improvement.

When to Use

  • Code quality assessment
  • Identifying refactoring candidates
  • Technical debt monitoring
  • Code review automation
  • CI/CD quality gates
  • Team performance tracking
  • Legacy code analysis

Quick Start

Minimal working example:

import * as ts from "typescript";
import * as fs from "fs";

interface ComplexityMetrics {
  cyclomaticComplexity: number;
  cognitiveComplexity: number;
  linesOfCode: number;
  functionCount: number;
  classCount: number;
  maxNestingDepth: number;
}

class CodeMetricsAnalyzer {
  analyzeFile(filePath: string): ComplexityMetrics {
    const sourceCode = fs.readFileSync(filePath, "utf-8");
    const sourceFile = ts.createSourceFile(
      filePath,
      sourceCode,
      ts.ScriptTarget.Latest,
      true,
    );

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Code Review & Quality, Testing & QA
First seen
Jun 3, 2026

Questions

What does the code-metrics-analysis skill do?

The code-metrics-analysis skill measures code complexity, cyclomatic complexity, maintainability index and code churn using metrics tools. It helps the agent assess code quality, find refactoring candidates and monitor technical debt over time.

How do I install the code-metrics-analysis skill?

Run npx -y skills add aj-geddes/useful-ai-prompts --skill code-metrics-analysis -y in your project. Once installed, code-metrics-analysis lets the agent analyze files for complexity and maintainability when you ask about code quality.

Which code-metrics-analysis guides cover which languages?

The code-metrics-analysis skill includes reference guides for a TypeScript complexity analyzer, Python code metrics using radon, an ESLint plugin for complexity and CI/CD quality gates. Each guide gives detailed implementations that code-metrics-analysis can follow for that toolchain.

Where does code-metrics-analysis stand in the Code Review & Quality category?

code-metrics-analysis is listed in the Code Review & Quality category next to improve-codebase-architecture, codebase-design, code-review, setup-ts-deep-modules and caveman-review. Its focus is on quantitative metrics such as churn and maintainability index rather than reviewing diffs directly.

More from aj-geddes/useful-ai-prompts

All 258

Similar to Code Metrics Analysis

More Code Review & Quality