Code Architecture Analyzer is a static analysis tool designed to automatically evaluate the architectural and high-level design quality of large-scale software projects. Developed as a Bachelor's thesis project at ELTE, the software transforms source code into a unified, language-agnostic component graph and applies network theory algorithms, architectural rules, and LLM to detect design flaws.
The analyzer processes source code written in C, C++, C#, Java, JavaScript, TypeScript, and Python.
The analysis pipeline consists of the following steps:
- AST Parsing: Uses
tree-sitterto parse the source code into an AST. - Graph Construction: Maps the AST into a directed, labeled multigraph. Nodes represent logical units (modules, classes, interfaces, functions, methods, attributes). Edges represent dependencies (contains, imports, inherits, implements, calls, references).
- Network Analysis: Utilizes the
igraphlibrary to calculate complex graph metrics. - AI Integration: Optionally integrates Gemini LLM to assist in semantic analysis, discovering hidden entry points, and detecting complex anti-patterns that static analysis alone cannot catch.
- Interactive UI: Features a local web-based interface (built with Flask, pywebview, and Cytoscape.js) to visually filter and explore the dependency graph.
The tool evaluates the codebase across multiple dimensions, scores to provide quality groupings (Modularity, Structural Complexity, Object-Oriented Design, Resilience).
- Modularity: Q-modularity, Modularization Quality, Clustered Cost.
- Structural Complexity: Propagation Cost, Clustering Coefficient, NodeRank (PageRank-like importance for functions/modules), Betweenness Centrality.
- OO Metrics: Tight Class Cohesion, Lack of Cohesion (LCOM4), Coupling Between Objects, Distance from the Main Sequence.
- Resilience Degeneracy, Propagation Cost.
- Code Smells: The Blob (God Object), Spaghetti Code, Swiss Army Knife, Cut-and-paste programming (Duplication).
- AI-Assisted Smells: Lava Flow (Dead Code) and Functional Decomposition.
- SOLID/Design Rules: Acyclic Dependencies Principle, Stable Dependencies Principle, Dependency Inversion Principle, Interface Segregation Principle.
Running the project requires Python 3.10 or higher.
- Download the latest
.whlinstaller file from the Releases page. - Open your terminal in the download folder.
- Install the package using pip (replace with the current version):
pip install code_arch_analyzer-<version>-py3-none-any.whl
Start the application by running the following command in your terminal:
analyzer-startThe graphical user interface will open automatically.

