How bunty5600/codelens works
CodeLens AI accepts pasted Python, ZIP projects, and GitHub repositories, then returns static metrics, risk estimates, quality insights, and reports. The React application submits requests to FastAPI; the API coordinates analysis, prediction, persistence, and retrieval. ZIP and GitHub processing have distinct project-level paths, while smell, debt, AI, quality-gate, and PDF features form additional insight branches. The README documents those capabilities, but excerpts do not show every route’s wiring; links for those branches reflect documented API responsibilities. The detailed metric-module call sequence is not fully sampled.
Main entry points: main.py FastAPI routes · analyzer.py Analysis orchestrator · App.jsx React application · github_service.py Repository analysis
Components 22
Web application
- React application
frontend/src/App.jsx - API client
frontend/src/services/api.js - Auth context
frontend/src/context/AuthContext.jsx - Upload and GitHub
frontend/src/pages/Upload.jsx - Results and history
frontend/src/pages/Results.jsx
API and identity
- FastAPI routes
api/main.py - Clerk identity
api/clerk_auth.py
Code analysis
- Analysis orchestrator
analyzer/analyzer.py - Python AST parser
analyzer/ast_parser.py - Metric extractors
analyzer/complexity_metrics.py - ZIP analysis
services/analysis_service.py - Repository analysis
services/github_service.py
Quality insights
- Defect prediction
ml/predictor.py - Code smells
services/smell_service.py - Technical debt
services/debt_service.py - AI recommendations
services/ai_service.py - Quality gate
services/quality_gate_service.py - PDF report
services/report_service.py
Persistence and integrations
- Analysis database
api/database.py - GitHub repository
- Groq API
Other components
- Developer
Connections 27
- Developer → React application: uses
- React application → Auth context: reads session
- React application → Upload and GitHub: offers submission
- React application → Results and history: shows results
- Upload and GitHub → API client: submits code
- Results and history → API client: requests results
- API client → FastAPI routes: HTTP requests
- Auth context → Clerk identity: uses identity
- FastAPI routes → Clerk identity: validates session
- FastAPI routes → Analysis orchestrator: analyzes pasted code
- FastAPI routes → ZIP analysis: analyzes ZIP
- FastAPI routes → Repository analysis: analyzes repository
- Repository analysis → GitHub repository: clones repository
- Analysis orchestrator → Python AST parser: parses source
- Analysis orchestrator → Metric extractors: extracts metrics
- ZIP analysis → Analysis orchestrator: analyzes Python files
- Repository analysis → Analysis orchestrator: analyzes Python files
- FastAPI routes → Defect prediction: predicts defect risk
- FastAPI routes → Code smells: detects smells
- FastAPI routes → Technical debt: scores debt
- FastAPI routes → AI recommendations: requests recommendations
- AI recommendations → Groq API: requests completions
- FastAPI routes → Quality gate: evaluates thresholds
- FastAPI routes → PDF report: generates PDF
- FastAPI routes → Analysis database: stores analyses
- FastAPI routes → Analysis database: reads history
- FastAPI routes → Results and history: returns results