josharsh/100LinesOfAICode
ð New Tool: Code Complexity Analyzer (AI-powered)
ãªãŒãã³
#21 opened on 2025/11/22
ai-poweredenhancementhacktoberfesthelp-wantednew-tool
Repository metrics
- Stars
-  (4 åã®ã¹ã¿ãŒ)
- PR merge metrics
- Â (PR metrics pending)
説æ
ð¯ 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: ð¥ð¥ð¥