What problem does it solve?
High code complexity (e.g., high cyclomatic complexity, long functions, deep nesting) leads to hard-to-maintain code, increased bugs, and technical debt. This Skill helps you identify and address these complexity hotspots.
Core Features & Use Cases
- Automated Complexity Analysis: Runs tools like Lizard to measure cyclomatic complexity (CCN), lines of code (NLOC), and nesting depth.
- Manual Detection Patterns: Provides grep patterns to identify deep nesting, long conditional chains, and high parameter counts.
- Complexity Sources Identification: Helps pinpoint specific causes of complexity, such as multiple responsibilities or mixed abstraction levels.
- Refactoring Patterns: Suggests concrete refactoring strategies like "Extract Method," "Guard Clauses," or "Parameter Object" to simplify complex code.
- Use Case: Analyze the
src/utils/dataProcessor.ts file for code complexity, identifying functions with high cyclomatic complexity or excessive length, and suggest specific refactoring patterns to improve maintainability.
Quick Start
Run bash ~/.claude/plugins/cache/review/scripts/review-complexity.sh to get a complexity report for the project.