What problem does it solve?
This skill solves the problem of unmaintainable, hard-to-read code by automatically measuring multiple standard code complexity metrics to identify functions that require refactoring before they accumulate technical debt and cause bugs.
Core Features & Use Cases
- Multi-metric measurement: Calculates cyclomatic, cognitive, NPath, Halstead, and structural complexity metrics across 7+ programming languages.
- Actionable findings: Every flagged function includes the measured metric value, threshold breach, and concrete refactor suggestions, with no findings lacking a fix recommendation.
- Tool integration: Works with common static analysis tools (SonarQube, lizard, radon, language-specific linters) and integrates into CI/CD pipelines and code review workflows.
- Edge case handling: Includes a suppression contract for legitimate complexity exceedances like generated code, state machines, and sealed enum switches.
Use case: A development team can run this skill during code review to catch overly complex functions early, reducing long-term maintenance costs and preventing hard-to-debug issues.
Quick Start
Use the complexity-analyzer skill to scan your project's source code for functions exceeding complexity thresholds and get a prioritized list of refactoring hotspots with suggested fixes.