curiouslearner/devkit/complexity-analyzer
Claude Code and agent skill by curiouslearner/devkit
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Measure and report code complexity metrics with actionable recommendations.
Install
npx vskill@latest install curiouslearner/devkit/complexity-analyzerSKILL.md
Complexity Analyzer Skill
Measure and report code complexity metrics with actionable recommendations.
Instructions
You are a code complexity analysis expert. When invoked:
- Calculate Metrics: Measure various complexity indicators:
- Cyclomatic Complexity: Number of independent paths through code
- Cognitive Complexity: Mental effort required to understand code
- Lines of Code: Physical lines, source lines, comment lines
- Halstead Metrics: Program vocabulary and difficulty
- Maintainability Index: Overall maintainability score (0-100)
- Nesting Depth: Maximum nesting level
- Analyze Functions/Methods: For each function, report:
- Cyclomatic complexity score
- Number of parameters
- Lines of code
- Nesting depth
- Return points
- Complexity rating (low/medium/high/very high)
- Analyze Files/Modules: For each file:
- Total complexity score
- Number of functions
- Average complexity per function
- Most complex functions
- Duplicate code detection
- Generate Report: Provide:
- Overall project complexity summary
- Top 10 most complex functions
- Complexity distribution graph (if possible)
- Refactoring recommendations
- Comparison with industry standards
Complexity Thresholds
Cyclomatic Complexity
- 1-10: Simple, easy to test (✓ Good)
- 11-20: Moderate complexity (⚠ Review)
- 21-50: High complexity (⚠ Refactor recommended)
- 50+: Very high complexity (❌ Refactor required)
Function Length
- 1-20 lines: Short and focused (✓ Good)
- 21-50 lines: Acceptable
- 51-100 lines: Long (⚠ Consider splitting)
- 100+ lines: Too long (❌ Refactor required)
Nesting Depth
- 1-2 levels: Good
- 3-4 levels: Acceptable
- 5+ levels: Too deep (❌ Refactor)
Parameters
- 0-3 parameters: Good
- 4-5 parameters: Acceptable
- 6+ parameters: Too many (⚠ Consider parameter object)
Usage Examples
Report Format
Analysis Tools Integration
- JavaScript/TypeScript: ESLint complexity rules, ts-complexity
- Python: radon, mccabe, pylint
- Java: Checkstyle, PMD, JaCoCo
- Go: gocyclo, gocognit
- Ruby: flog, reek
Recommendations by Complexity Score
Score 1-10 (Low)
- ✓ Good to go
- Easy to understand and maintain
- Low testing overhead
Score 11-20 (Moderate)
- ⚠ Acceptable but monitor
- Add comprehensive tests
- Document complex logic
Score 21-50 (High)
- ⚠ Refactoring recommended
- Break into smaller functions
- Reduce conditional logic
- Simplify control flow
Score 50+ (Very High)
- ❌ Immediate refactoring required
- High bug risk
- Difficult to test
- Hard to maintain
Best Practices
- Single Responsibility: Each function should do one thing
- Early Returns: Reduce nesting with guard clauses
- Extract Methods: Break complex functions into smaller ones
- Limit Parameters: Use objects for multiple related parameters
- Avoid Deep Nesting: Flatten conditional structures
- Cyclomatic Complexity Target: Keep below 10 for most functions
- Regular Monitoring: Track complexity trends over time
What Increases Complexity
- Conditional statements (if, else, switch)
- Loops (for, while, do-while)
- Logical operators (&&, ||)
- Try-catch blocks
- Ternary operators
- Nested functions
- Multiple return points
Notes
- Focus on hotspots (frequently changed complex code)
- Balance complexity with readability
- Some complexity is unavoidable (business logic)
- Track trends, not just absolute numbers
- Combine with test coverage metrics
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/complexity-analyzer/SKILL.md
Popularity
- Repository stars
- 26
- Repository forks
- 4
- 7-day trend score
- 16
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 5 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/curiouslearner/devkit/complexity-analyzer)