You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -91,21 +91,20 @@ Build a call graph by raising the analysis level:
91
91
from cldk importCLDK
92
92
from cldk.analysis import AnalysisLevel
93
93
94
-
analysis =CLDK.java(
95
-
project_path="/path/to/java/project",
94
+
analysis =CLDK.python(
95
+
project_path="/path/to/python/project",
96
96
analysis_level=AnalysisLevel.call_graph,
97
97
)
98
98
call_graph = analysis.get_call_graph() # a networkx.DiGraph
99
99
```
100
100
101
-
Select a backend by passing a typed config. For example, query a pre-populated graph **read-only**
102
-
over Neo4j (no source or analyzer run needed) — available for all three languages:
101
+
Select a backend by passing a typed config. For example, query a pre-populated graph **read-only** over Neo4j (no source or analyzer run needed):
103
102
104
103
```python
105
104
from cldk importCLDK
106
105
from cldk.analysis.commons.backend_config import Neo4jConnectionConfig
107
106
108
-
analysis =CLDK.java(
107
+
analysis =CLDK.python(
109
108
backend=Neo4jConnectionConfig(
110
109
uri="bolt://localhost:7687",
111
110
application_name="my-app", # the graph is populated out of band
@@ -128,6 +127,8 @@ Each language is analyzed by a dedicated `codeanalyzer-*` engine; CLDK normalize
128
127
129
128
The backend is selected by the **type** of the `backend=` config you pass to a factory: the in-process analyzer (default) or a `Neo4jConnectionConfig` for the read-only graph backend.
130
129
130
+
> **Analysis cache (Python):** caching is owned by `codeanalyzer-python` — the backend virtualenv, CodeQL database, and analysis cache live under `cache_dir` (default `<project>/.codeanalyzer`). CodeQL is on by default, so the first run is slow (it provisions a CodeQL DB) and later runs reuse a checksum-validated cache. Add the cache directory to your `.gitignore`.
131
+
131
132
## Architecture
132
133
133
134
The user interacts only with the top-level `CLDK` interface (`core.py`), which configures the session, initializes the language-specific pipeline, and exposes a high-level, language-agnostic API. Each language module is built from two pieces: **data models** and an **analysis backend**.
@@ -153,7 +154,7 @@ graph TD
153
154
154
155
**Data models** — each language has its own set of Pydantic models under `cldk.models` (`cldk.models.java`, `cldk.models.python`, `cldk.models.typescript`). They give you structured, typed, dot-accessible representations of classes, methods, fields, and statements, with JSON serialization and shared conventions across languages.
155
156
156
-
**Analysis backends** — each language has a backend under `cldk.analysis.<language>` that coordinates its engine (see the table above) and maps the result onto the data models. The read-only Neo4j backends (`cldk.analysis.<language>.neo4j`) reconstruct the *same* models from a Cypher graph, so they are drop-in interchangeable with the in-process analyzers. Backends are orchestrated internally; you only call high-level methods such as `get_symbol_table()`, `get_method(...)`, and `get_call_graph(...)`, and CLDK handles tool coordination, parsing, and marshalling under the hood.
157
+
**Analysis backends** — each language has a backend under `cldk.analysis.<language>` that coordinates its engine (see the table above) and maps the result onto the data models. The read-only Neo4j backends (`cldk.analysis.<language>.neo4j`) reconstruct the *same* models from a Cypher graph, so they are drop-in interchangeable with the in-process analyzers. Backends are orchestrated internally; you only call high-level methods such as `get_symbol_table()`, `get_method_body(...)`, and `get_call_graph(...)`, and CLDK handles tool coordination, parsing, and marshalling under the hood.
0 commit comments