Skip to content
Back to skills

Code Metrics Analyzer

ASecurity

Calculate code quality metrics - complexity, coverage, maintainability

  • 754 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 8, 2026
developmentpythonswiftbashrefactoring

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill code-metrics-analyzer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Metrics Analyzer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Metrics Analyzer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-code-metrics-analyzer/badge)](https://www.skillsdirectory.com/skills/majiayu000-code-metrics-analyzer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-metrics-analyzer
description: Calculate code quality metrics - complexity, coverage, maintainability
type: skill
language: python
---

# Code Metrics Analyzer

Measure code quality through various metrics.

## Capabilities
- Calculate cyclomatic complexity
- Measure code coverage
- Analyze lines of code (LOC)
- Count methods/functions per file
- Measure comment density
- Identify complex methods
- Track metrics over time
- Generate quality reports
- Find refactoring candidates

## Tools
`code_metrics.py` - Calculate various code metrics

## Metrics Calculated
- **Cyclomatic Complexity** - Decision point count
- **Cognitive Complexity** - Mental effort to understand
- **LOC** - Lines of code (total, code, comments, blank)
- **Method Count** - Methods per class/file
- **Depth of Inheritance** - Class hierarchy depth
- **Comment Ratio** - Comments vs code
- **Test Coverage** - Percentage tested

## Commands
```bash
# Analyze project
./code_metrics.py analyze --source-dir PaleoRose

# Find complex methods
./code_metrics.py complex --threshold 10

# Generate report
./code_metrics.py report --format html
```

## Output
```
Code Metrics Summary
====================
Total Files: 104
Total LOC: 15,234
Average Complexity: 4.2

Most Complex Files:
1. XRoseTableController.m (complexity: 28)
2. InMemoryStore.swift (complexity: 22)
3. DocumentModel.swift (complexity: 18)

Refactoring Candidates:
- XRoseTableController.configureController (complexity: 15)
- InMemoryStore.readFromStore (complexity: 12)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.