josharsh/100LinesOfAICode
🚀 New Tool: Code Complexity Analyzer (AI-powered)
Aperta
#21 aperta il 22 nov 2025
ai-poweredenhancementhacktoberfesthelp-wantednew-tool
Metriche repository
- Star
- (4 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
🎯 Goal
Create a new tool that analyzes code complexity and suggests simplifications!
📋 Description
Build complexity-analyzer/ - a tool that:
- Scans code files
- Identifies complex functions (cyclomatic complexity, nesting)
- Uses Claude to suggest simplifications
- Shows before/after comparisons
💡 Example Usage
python analyze.py mycode.py
🔍 Found 3 complex functions:
━━━━━━━━━━━━━━━━━━━━━━━━
Function: calculate_total (line 45)
Complexity: 12 (high)
💡 Suggestion:
Extract nested loops into separate functions
Consider using list comprehensions
━━━━━━━━━━━━━━━━━━━━━━━━
🔨 Implementation Ideas
- Use
radonormccabefor complexity metrics - Parse code with
astmodule - Send complex code to Claude for analysis
- Format suggestions nicely
📁 Structure
complexity-analyzer/
├── analyze.py (main script, <100 lines!)
├── README.md
└── examples/
├── before.py
└── after.py
✅ Acceptance Criteria
- Analyzes Python files (bonus: other languages)
- Identifies functions above complexity threshold
- AI suggestions are actionable
- Under 100 lines (excluding README)
- Clean terminal output
- Examples showing improvement
🎓 Learning Outcomes
- AST parsing
- Code quality metrics
- AI-powered refactoring
- CLI design
Estimated time: 5-8 hours Impact: New tool that helps developers write better code! Cool factor: 🔥🔥🔥