code-metrics-analyzer

Compute code quality metrics and generate HTML reports.

2|Updated Jun 25, 2023
One-click install
npx skills add https://github.com/paleoterra/PaleoRose --skill code-metrics-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-metrics-analyzer
Source: https://github.com/paleoterra/PaleoRose/tree/main/.claude/skills/code-metrics-analyzer
Command: npx skills add https://github.com/paleoterra/PaleoRose --skill code-metrics-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides objective insights into your codebase's health by calculating key code quality metrics, helping you identify complex areas and prioritize refactoring efforts to improve maintainability.

Core Features & Use Cases

  • Complexity Analysis: Calculate cyclomatic and cognitive complexity for files and methods.
  • Codebase Overview: Measure lines of code (LOC), method count, comment density, and track metrics over time.
  • Use Case: Generate a comprehensive report on your project's codebase, highlighting the most complex files and methods, and suggesting specific areas for refactoring to improve maintainability and reduce technical debt.

Quick Start

Analyze the source code in the 'PaleoRose' directory and identify methods with a cyclomatic complexity greater than 10.

Frequently Asked Questions about code-metrics-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure code quality metrics for my project?

Code quality metrics quantify complexity, maintainability, and test coverage across your codebase. This Skill computes cyclomatic and cognitive complexity, lines of code, method counts, comment density, and test coverage, then generates a structured report highlighting the most complex files and refactoring candidates.

How do I identify which methods need refactoring?

Run the analyze and complex commands to calculate cyclomatic complexity per method and file. The Skill identifies methods exceeding complexity thresholds, ranks them by difficulty, and produces refactoring suggestions with specific targets to reduce technical debt.

Can I track code quality metrics over time?

Yes. The Skill's report command produces structured outputs and HTML reports suitable for trend analysis. Store successive analyses to monitor how metrics like complexity, LOC, and coverage change across releases and refactoring cycles.

What languages does code metrics analysis support?

The Skill applies to projects of varying languages and sizes. It analyzes cyclomatic and cognitive complexity, method counts, and inheritance depth—metrics language-agnostic enough for multi-language codebases, though the underlying Python tool determines specific language support.

Does this work for large codebases?

Yes. The Skill is designed for projects of varying sizes. It processes multiple files, generates summary tables of the most complex files, and produces both machine-readable structured output and human-readable HTML reports for large-scale analysis.

What's the difference between cyclomatic and cognitive complexity?

Cyclomatic complexity counts decision branches (if, loops, operators); cognitive complexity adds nesting weight and abstracts language-specific constructs. Both identify complex methods, but cognitive complexity better reflects perceived difficulty for maintainers.