-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture & Heuristics
Krzysztofci edited this page Jun 26, 2026
·
2 revisions
The tool analyzes source code statically without executing it, leveraging Python's built-in ast (Abstract Syntax Tree) module. This ensures that the analysis process is completely safe, lightweight, and fast.
Every function within the target project is mapped by the Analyzer(ast.NodeVisitor) class and receives score points (weights) across two categories: GUI and LOGIC.
-
Function Names:
- Keywords like
build,show,ui,widgetaward score points to GUI (provided that the file imports known windowing/UI libraries). - Keywords like
calc,parse,load,processautomatically increment the LOGIC counter.
- Keywords like
-
Internal Method Calls:
- Methods such as
.pack(),.grid(),.bind()or UI component instantiations (e.g.,Button,Frame) serve as strong GUI indicators. - System-level calls and file operations (
open,json,subprocess,os,re) push the weight towards LOGIC.
- Methods such as
The final classification of a function is determined by the ratio of its accumulated scores:
-
UNKNOWN: Total weight equals
0(e.g., abstract methods, empty interfaces). -
GUI / LOGIC: One type dominates the other by a factor of at least
$1.5\times$ (or the opposing weight is exactly 0). -
MIXED: The function exhibits characteristics of both types, but neither managed to establish a
$1.5\times$ lead. This signals a heavy coupling between view and logic (tight coupling) — a clear invitation for architectural refactoring.