Agent skill
code-metrics-analyzer
Calculate code quality metrics - complexity, coverage, maintainability
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/code-metrics-analyzer
SKILL.md
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
# 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)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?