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
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 -yInstalls 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- Spring Boot Application464
- Webhook Integration464
- Health Check Endpoints463
- Serverless Architecture463
- Classification Modeling462
- Transaction Management462
- Secrets Rotation461
- Deployment Documentation460
- Natural Language Processing460
- Runbook Creation460
- Autoscaling Configuration458
- Security Documentation458
- Stored Procedures458
- Profiling Optimization457
- Property Based Testing457
- Cpu Profiling456
- Frontend Routing456
- Load Balancer Setup456
- Aws Rds Database455
- Log Aggregation455
- Documentation Site Setup454
- Recommendation System454
- Retrospective Facilitation453
- Git Hooks Setup452
Similar to Code Metrics Analysis
More Code Review & Qualityagent-analyze-code-qualitySkillruvnet/ruflo1.2K installsStructured code quality reviewer that scores readability, maintainability, and performance, flagging code smells and refactoring opportunities.
technical-debt-assessmentSkillaj-geddes/useful-ai-prompts511 installsStructured assessment framework that scores technical debt by severity, effort, impact, and interest before prioritizing fixes.
code-quality-toolkitPluginarmanzeroeight/fastagent-plugins29 starsComprehensive code quality toolkit for detecting code smells, analyzing complexity, and planning refactoring. Includes quality architect agent for strategic tec
refactor-legacy-codeSkillaj-geddes/useful-ai-prompts612 installsIncremental, test-backed refactoring guide that modernizes legacy code while preserving existing behavior.
refactoring-analysisSkillpedronauck/skills441 installsAudit codebases for refactoring opportunities using Fowler's code smells and techniques, with a prioritized report.