-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Contains commands to run from the command prompt to analyse and render a project
In the core folder there are three files:
-
bt_file.py- a representation of a file in the system, wherefrom Astroid can read the imports of the file (in the functionget_imported_modules) -
bt_module.py- a representation of a module in the system -
bt_graph.py- the whole file tree, where modules are found*, and then their dependencies
*NOTE: Only folders with a file called __init.py__ are counted as a module. Additionally, a root module (also with an init file) is necessary. Sibling folders only do not work.
The folder contains a single (operational**) file fetch_git.py (which could be just a utils file) that clones a GitHub repository and checkout to a provided branch.
Contains two subfolders json and plantuml which (with a lot of duplicated code):
- Provides methods to save a created dependency graph to a newly generated file in a local folder, in the respective format (json/puml)
- (the save functions calls) a private method for rendering the graph in the respective format
** Currently all folders contain an __init__.py
EntityState
Enum of visual states: CREATED → #Green, DELETED → #Red, NEUTRAL → "" (empty, so you can inject a default color from config).
ViewPackage (a node in the view graph)
- Built from a
BTModule. -
name: a dotted form of the module’s view path (converts"a/b/c"→"a.b.c"). -
path: the module’s view path itself (slash-separated), viaget_view_package_path_from_bt_package. -
parentandsub_modules: hierarchy of view packages. -
view_dependency_list: outgoing edges (ViewDependancy) from this package. -
state: visual state used when rendering a package.
ViewDependancy (an edge in the view graph)
- Holds
from_package/to_package(view level) and the correspondingfrom_bt_package/to_bt_package(domain level). - On init:
dependency_count = from_bt.get_dependency_count(to_bt)-
edge_files = from_bt.get_file_level_relations(to_bt)(list of(BTFile, BTFile)pairs for traceability)
-
render_pu()/render_json():- If not in diff mode (
render_diffis empty), they render using the live fields and optional count (driven byConfigManagerSingleton().show_dependency_count). - If in diff mode, they read precomputed fields from
render_diff(e.g., color/label/from/to) to display “created/deleted/changed” edges.
- If not in diff mode (