How alvin20082003/code-doctor works
Code Doctor analyzes Python backend code for complexity, performance, and security issues, then proposes an AI rewrite and checks it before presenting a scored report. The main workflow runs from the React workspace through the FastAPI job pipeline to live progress and results. The graph also preserves report views and the documented behavior check. Source excerpts do not show every API route or the behavior-check implementation, so those relationships are documented from the README rather than inferred from unsampled code.
Main entry points: main.py FastAPI Jobs · optimizer.py Rewrite and Verify · App.jsx App State · ReportPanel.jsx Report View
Components 19
Analysis Workspace
- App State
frontend/src/App.jsx - Landing
frontend/src/components/Landing.jsx - Workspace
frontend/src/components/Workspace.jsx - Pipeline View
frontend/src/components/PipelinePanel.jsx - Report View
frontend/src/components/ReportPanel.jsx - Complexity Charts
frontend/src/components/tabs/ComplexityTab.jsx - Finding Tabs
frontend/src/components/tabs/FindingTabs.jsx - Optimizer Diff
frontend/src/components/tabs/OptimizerTab.jsx
Analysis Service
- FastAPI Jobs
backend/main.py
Analysis and Verification
- Complexity Analysis
backend/analyzers/complexity.py - Performance Analysis
backend/analyzers/performance.py - Security Analysis
backend/analyzers/security.py - Rewrite and Verify
backend/agents/optimizer.py - Behavior Check
backend/validation.py - LLM Adapter
backend/agents/llm.py
Scoring and Reports
- Scale Score and Growth
backend/scoring.py
Other components
- Developer
- Ollama
- watsonx.ai
Connections 23
- Developer → App State: starts analysis
frontend/src/App.jsx - App State → Landing: renders
frontend/src/App.jsx - App State → Workspace: renders
frontend/src/App.jsx - Workspace → Pipeline View: renders
frontend/src/components/Workspace.jsx - Workspace → Report View: renders
frontend/src/components/Workspace.jsx - App State → FastAPI Jobs: submits code
frontend/src/App.jsx - FastAPI Jobs → App State: streams results
README.md - Report View → Complexity Charts: renders
frontend/src/components/ReportPanel.jsx - Report View → Finding Tabs: renders
frontend/src/components/ReportPanel.jsx - Report View → Optimizer Diff: renders
frontend/src/components/ReportPanel.jsx - FastAPI Jobs → Complexity Analysis: runs analysis
README.md - FastAPI Jobs → Performance Analysis: runs analysis
README.md - FastAPI Jobs → Security Analysis: runs analysis
README.md - FastAPI Jobs → Rewrite and Verify: requests rewrite
backend/main.py - Rewrite and Verify → Complexity Analysis: rechecks rewrite
backend/agents/optimizer.py - Rewrite and Verify → Performance Analysis: rechecks rewrite
backend/agents/optimizer.py - Rewrite and Verify → Security Analysis: rechecks rewrite
backend/agents/optimizer.py - Rewrite and Verify → Behavior Check: checks behavior
README.md - Rewrite and Verify → LLM Adapter: requests completion
backend/agents/optimizer.py - LLM Adapter → Ollama: sends prompt
backend/agents/llm.py - LLM Adapter → watsonx.ai: sends prompt
backend/agents/llm.py - FastAPI Jobs → Scale Score and Growth: scores findings
backend/main.py - Scale Score and Growth → Report View: provides report data
README.md