-
Notifications
You must be signed in to change notification settings - Fork 0
architecture
Jules Martins edited this page Jun 11, 2026
·
1 revision
Codelyzer is architected as a Static Monolith-Client application. It operates entirely within the browser environment, leveraging modern Web APIs for repository interaction and local file processing.
graph TD
User([User]) --> UI[React Frontend]
UI --> Controller[Analysis Controller]
Controller --> Parser[Language Parser Core]
Controller --> GitHub[GitHub API Connector]
Parser --> Extractors[Regex & Tree-sitter Extractors]
Controller --> Viz[D3.js Visualization Engine]
Viz --> Graph[Force-Directed Graph]
The parser identifies structural entities (functions, classes, imports) across 30+ languages.
- Static Analysis: Uses optimized regular expressions for high-speed scanning.
-
Advanced Analysis: Employs
web-tree-sitterfor complex language structures (where enabled). -
Dependency Mapping: Inferred via symbol resolution. If
File Areferences a function defined inFile B, a dependency edge is created.
Built on D3.js v7.
-
Force Simulation: Uses
d3-forceto calculate node positions based on many-body forces and link constraints. -
Layers: Nodes are categorized into layers (UI, Logic, Service, Data, etc.) based on path patterns (defined in
Parser.detectLayer).
-
Fetch:
fetchAPI retrieves file tree and content (GitHub) orFileSystemHandlereads local bits. - Process: Parser extracts functions and connections.
- Metrication: Calculates "Blast Radius" (out-degree impact) and "Health Grade" (circularity + coupling).
- Render: D3 updates the DOM/SVG nodes.
-
Decision: Ship the main application as a single
index.html. - Rationale: Zero-install requirement. Users can download and run it offline immediately.
-
Consequences: CSS and JS are inlined; requires careful management of the 9000+ lines in
index.html.
- Decision: No backend server for analysis.
- Rationale: Privacy and security. Sensitive code never leaves the user's machine.
- Consequences: Limited by browser memory and CORS policies for some APIs.
| Mode | Logic |
|---|---|
| Folder | Clusters nodes by directory hierarchy. |
| Layer | Uses detectLayer patterns to group by architectural role. |
| Blast | Recursive depth-first search to find all downstream dependents. |
| Churn | Maps Git commit frequency to color scales (Red = Hot). |