aj-geddes avatar

Code Metrics Analysis

This is your standard code quality metrics toolkit wrapped up for Claude. It measures cyclomatic complexity, cognitive complexity, maintainability index, and code churn across TypeScript and Python codebases. You'd reach for this during code reviews, when setting up CI/CD quality gates, or when you need to justify refactoring that gnarly legacy module to your team lead. The reference guides cover practical implementations including radon integration for Python and ESLint plugins for JavaScript. One thing to appreciate here is the emphasis on tracking trends over time rather than obsessing over absolute numbers, which is the right mindset. Works best when you combine multiple metrics instead of fixating on a single complexity score.

skills.sh installs
462
GitHub stars
379
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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,
    );

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
DevOps & CI/CD, Code Review & Quality, AI & Agent Building, Marketing & SEO
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258
1aj-geddes avatardeployment-documentationaj-geddes/useful-ai-promptsDocument deployment processes, infrastructure setup, CI/CD pipelines, and configuration management. Use when creating deployment guides, infrastructure docs, or457skills.sh installs
2aj-geddes avatarautoscaling-configurationaj-geddes/useful-ai-promptsConfigure autoscaling for Kubernetes, VMs, and serverless workloads based on metrics, schedules, and custom indicators.456skills.sh installs
3davila7 avatarcomputer-use-agentsdavila7/claude-code-templatesBuild AI agents that interact with computers like humans do - viewing screens, moving cursors, clicking buttons, and typing text. Covers Anthropic's Computer Us455skills.sh installs
4aj-geddes avatarload-balancer-setupaj-geddes/useful-ai-promptsConfigure and deploy load balancers (HAProxy, AWS ELB/ALB/NLB) for distributing traffic, session management, and high availability.454skills.sh installs
5aj-geddes avataraws-rds-databaseaj-geddes/useful-ai-promptsDeploy and manage relational databases using RDS with Multi-AZ, read replicas, backups, and encryption. Use for PostgreSQL, MySQL, MariaDB, and Oracle.453skills.sh installs
6aj-geddes avatarlog-aggregationaj-geddes/useful-ai-promptsImplement centralized logging with ELK Stack, Loki, or Splunk for log collection, parsing, storage, and analysis across infrastructure.453skills.sh installs