codeanalyzer-python 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,392 @@
1
+ Metadata-Version: 2.4
2
+ Name: codeanalyzer-python
3
+ Version: 0.1.5
4
+ Summary: Static Analysis on Python source code using Jedi, CodeQL and Treesitter.
5
+ Author-email: Rahul Krishna <i.m.ralk@gmail.com>
6
+ License-File: LICENSE
7
+ License-File: NOTICE
8
+ Requires-Python: >=3.12
9
+ Requires-Dist: jedi>=0.19.2
10
+ Requires-Dist: loguru>=0.7.3
11
+ Requires-Dist: msgpack>=1.1.1
12
+ Requires-Dist: networkx>=3.5
13
+ Requires-Dist: pandas>=2.3.1
14
+ Requires-Dist: pydantic>=2.11.7
15
+ Requires-Dist: requests>=2.32.4
16
+ Requires-Dist: rich>=14.0.0
17
+ Requires-Dist: typer>=0.16.0
18
+ Description-Content-Type: text/markdown
19
+
20
+ ![logo](https://github.com/codellm-devkit/codeanalyzer-python/blob/main/docs/assets/logo.png?raw=true)
21
+
22
+ # A Python Static Analysis Toolkit (and Library)
23
+
24
+ A comprehensive static analysis tool for Python source code that provides symbol table generation, call graph analysis, and semantic analysis using Jedi, CodeQL, and Tree-sitter.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install codeanalyzer-python
30
+ ```
31
+
32
+ ### Prerequisites
33
+
34
+ - Python 3.12 or higher
35
+
36
+ #### System Package Requirements
37
+
38
+ The tool creates virtual environments internally using Python's built-in `venv` module.
39
+
40
+ **Ubuntu/Debian systems:**
41
+ ```bash
42
+ sudo apt update
43
+ sudo apt install python3.12-venv python3-dev build-essential
44
+ ```
45
+
46
+ **Fedora/RHEL/CentOS systems:**
47
+ ```bash
48
+ sudo dnf group install "Development Tools"
49
+ sudo dnf install python3-pip python3-venv python3-devel
50
+ ```
51
+ or on older versions:
52
+ ```bash
53
+ sudo yum groupinstall "Development Tools"
54
+ sudo yum install python3-pip python3-venv python3-devel
55
+ ```
56
+
57
+ **macOS systems:**
58
+ ```bash
59
+ # Install Xcode Command Line Tools (for compilation)
60
+ xcode-select --install
61
+
62
+ # If using Homebrew Python (recommended)
63
+ brew install python@3.12
64
+
65
+ # If using pyenv (popular Python version manager)
66
+ # First ensure pyenv is properly installed and configured
67
+ pyenv install 3.12.0 # or latest 3.12.x version
68
+ pyenv global 3.12.0 # or pyenv local 3.12.0 for project-specific
69
+
70
+ # If using system Python, you may need to install certificates
71
+ /Applications/Python\ 3.12/Install\ Certificates.command
72
+ ```
73
+
74
+ > **Note:** These packages are required as the tool uses Python's built-in `venv` module to create isolated environments for analysis.
75
+
76
+ ## Usage
77
+
78
+ The codeanalyzer provides a command-line interface for performing static analysis on Python projects.
79
+
80
+ ### Basic Usage
81
+
82
+ ```bash
83
+ codeanalyzer --input /path/to/python/project
84
+ ```
85
+
86
+ ### Command Line Options
87
+
88
+ To view the available options and commands, run `codeanalyzer --help`. You should see output similar to the following:
89
+
90
+ ```bash
91
+ ❯ codeanalyzer --help
92
+
93
+ Usage: codeanalyzer [OPTIONS] COMMAND [ARGS]...
94
+
95
+ Static Analysis on Python source code using Jedi, CodeQL and Tree sitter.
96
+
97
+
98
+ ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
99
+ │ * --input -i PATH Path to the project root directory. [default: None] [required] │
100
+ │ --output -o PATH Output directory for artifacts. [default: None] │
101
+ │ --analysis-level -a INTEGER 1: symbol table, 2: call graph. [default: 1] │
102
+ │ --codeql --no-codeql Enable CodeQL-based analysis. [default: no-codeql] │
103
+ │ --eager --lazy Enable eager or lazy analysis. Defaults to lazy. [default: lazy] │
104
+ │ --cache-dir -c PATH Directory to store analysis cache. [default: None] │
105
+ │ --clear-cache --keep-cache Clear cache after analysis. [default: clear-cache] │
106
+ │ -v INTEGER Increase verbosity: -v, -vv, -vvv [default: 0] │
107
+ │ --help Show this message and exit. │
108
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
109
+ ```
110
+
111
+ ### Examples
112
+
113
+ 1. **Basic analysis with symbol table:**
114
+ ```bash
115
+ codeanalyzer --input ./my-python-project
116
+ ```
117
+
118
+ This will print the symbol table to stdout in JSON format to the standard output. If you want to save the output, you can use the `--output` option.
119
+
120
+ ```bash
121
+ codeanalyzer --input ./my-python-project --output /path/to/analysis-results
122
+ ```
123
+
124
+ Now, you can find the analysis results in `analysis.json` in the specified directory.
125
+
126
+ 2. **Toggle analysis levels with `--analysis-level`:**
127
+ ```bash
128
+ codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
129
+ ```
130
+ Call graph analysis can be enabled by setting the level to `2`:
131
+ ```bash
132
+ codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
133
+ ```
134
+ ***Note: The `--analysis-level=2` is not yet implemented in this version.***
135
+
136
+ 3. **Analysis with CodeQL enabled:**
137
+ ```bash
138
+ codeanalyzer --input ./my-python-project --codeql
139
+ ```
140
+ This will perform CodeQL-based analysis in addition to the standard symbol table generation.
141
+
142
+ ***Note: Not yet fully implemented. Please refrain from using this option until further notice.***
143
+
144
+ 4. **Eager analysis with custom cache directory:**
145
+ ```bash
146
+ codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
147
+ ```
148
+ This will rebuild the analysis cache at every run and store it in `/path/to/custom-cache/.codeanalyzer`. The cache will be cleared by default after analysis unless you specify `--keep-cache`.
149
+
150
+ If you provide --cache-dir, the cache will be stored in that directory. If not specified, it defaults to `.codeanalyzer` in the current working directory (`$PWD`).
151
+
152
+ 5. **Quiet mode (minimal output):**
153
+ ```bash
154
+ codeanalyzer --input /path/to/my-python-project --quiet
155
+ ```
156
+
157
+ ### Output
158
+
159
+ By default, analysis results are printed to stdout in JSON format. When using the `--output` option, results are saved to `analysis.json` in the specified directory.
160
+
161
+ ## Development
162
+
163
+ This project uses [uv](https://docs.astral.sh/uv/) for dependency management during development.
164
+
165
+ ### Development Setup
166
+
167
+ 1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
168
+ ![logo](https://github.com/codellm-devkit/codeanalyzer-python/blob/main/docs/assets/logo.png?raw=true)
169
+
170
+ # A Python Static Analysis Toolkit (and Library)
171
+
172
+ A comprehensive static analysis tool for Python source code that provides symbol table generation, call graph analysis, and semantic analysis using Jedi, CodeQL, and Tree-sitter.
173
+
174
+ ## Installation
175
+
176
+ ```bash
177
+ pip install codeanalyzer-python
178
+ ```
179
+
180
+ ### Prerequisites
181
+
182
+ - Python 3.12 or higher
183
+
184
+ #### System Package Requirements
185
+
186
+ The tool creates virtual environments internally using Python's built-in `venv` module.
187
+
188
+ **Ubuntu/Debian systems:**
189
+ ```bash
190
+ sudo apt update
191
+ sudo apt install python3.12-venv python3-dev build-essential
192
+ ```
193
+
194
+ **Fedora/RHEL/CentOS systems:**
195
+ ```bash
196
+ sudo dnf group install "Development Tools"
197
+ sudo dnf install python3-pip python3-venv python3-devel
198
+ ```
199
+ or on older versions:
200
+ ```bash
201
+ sudo yum groupinstall "Development Tools"
202
+ sudo yum install python3-pip python3-venv python3-devel
203
+ ```
204
+
205
+ **macOS systems:**
206
+ ```bash
207
+ # Install Xcode Command Line Tools (for compilation)
208
+ xcode-select --install
209
+
210
+ # If using Homebrew Python (recommended)
211
+ brew install python@3.12
212
+
213
+ # If using pyenv (popular Python version manager)
214
+ # First ensure pyenv is properly installed and configured
215
+ pyenv install 3.12.0 # or latest 3.12.x version
216
+ pyenv global 3.12.0 # or pyenv local 3.12.0 for project-specific
217
+
218
+ # If using system Python, you may need to install certificates
219
+ /Applications/Python\ 3.12/Install\ Certificates.command
220
+ ```
221
+
222
+ > **Note:** These packages are required as the tool uses Python's built-in `venv` module to create isolated environments for analysis.
223
+
224
+ ## Usage
225
+
226
+ The codeanalyzer provides a command-line interface for performing static analysis on Python projects.
227
+
228
+ ### Basic Usage
229
+
230
+ ```bash
231
+ codeanalyzer --input /path/to/python/project
232
+ ```
233
+
234
+ ### Command Line Options
235
+
236
+ To view the available options and commands, run `codeanalyzer --help`. You should see output similar to the following:
237
+
238
+ ```bash
239
+ ❯ codeanalyzer --help
240
+
241
+ Usage: codeanalyzer [OPTIONS] COMMAND [ARGS]...
242
+
243
+ Static Analysis on Python source code using Jedi, CodeQL and Tree sitter.
244
+
245
+
246
+ ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
247
+ │ * --input -i PATH Path to the project root directory. [default: None] [required] │
248
+ │ --output -o PATH Output directory for artifacts. [default: None] │
249
+ │ --format -f [json|msgpack] Output format: json or msgpack. [default: json]. │
250
+ │ --analysis-level -a INTEGER 1: symbol table, 2: call graph. [default: 1] │
251
+ │ --codeql --no-codeql Enable CodeQL-based analysis. [default: no-codeql] │
252
+ │ --eager --lazy Enable eager or lazy analysis. Defaults to lazy. [default: lazy] │
253
+ │ --cache-dir -c PATH Directory to store analysis cache. [default: None] │
254
+ │ --clear-cache --keep-cache Clear cache after analysis. [default: clear-cache] │
255
+ │ -v INTEGER Increase verbosity: -v, -vv, -vvv [default: 0] │
256
+ │ --help Show this message and exit. │
257
+ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
258
+ ```
259
+
260
+ ### Examples
261
+
262
+ 1. **Basic analysis with symbol table:**
263
+ ```bash
264
+ codeanalyzer --input ./my-python-project
265
+ ```
266
+
267
+ This will print the symbol table to stdout in JSON format to the standard output. If you want to save the output, you can use the `--output` option.
268
+
269
+ ```bash
270
+ codeanalyzer --input ./my-python-project --output /path/to/analysis-results
271
+ ```
272
+
273
+ Now, you can find the analysis results in `analysis.json` in the specified directory.
274
+
275
+ 2. **Toggle analysis levels with `--analysis-level`:**
276
+ ```bash
277
+ codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
278
+ ```
279
+ Call graph analysis can be enabled by setting the level to `2`:
280
+ ```bash
281
+ codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
282
+ ```
283
+ ***Note: The `--analysis-level=2` is not yet implemented in this version.***
284
+
285
+ 3. **Analysis with CodeQL enabled:**
286
+ ```bash
287
+ codeanalyzer --input ./my-python-project --codeql
288
+ ```
289
+ This will perform CodeQL-based analysis in addition to the standard symbol table generation.
290
+
291
+ ***Note: Not yet fully implemented. Please refrain from using this option until further notice.***
292
+
293
+ 4. **Eager analysis with custom cache directory:**
294
+ ```bash
295
+ codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
296
+ ```
297
+ This will rebuild the analysis cache at every run and store it in `/path/to/custom-cache/.codeanalyzer`. The cache will be cleared by default after analysis unless you specify `--keep-cache`.
298
+
299
+ If you provide --cache-dir, the cache will be stored in that directory. If not specified, it defaults to `.codeanalyzer` in the current working directory (`$PWD`).
300
+
301
+ 5. **Save output in msgpack format:**
302
+ ```bash
303
+ codeanalyzer --input ./my-python-project --output /path/to/analysis-results --format msgpack
304
+ ```
305
+
306
+ ### Output
307
+
308
+ By default, analysis results are printed to stdout in JSON format. When using the `--output` option, results are saved to `analysis.json` in the specified directory.
309
+
310
+ ## Development
311
+
312
+ This project uses [uv](https://docs.astral.sh/uv/) for dependency management during development.
313
+
314
+ ### Development Setup
315
+
316
+ 1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
317
+
318
+ 2. Clone the repository:
319
+ ```bash
320
+ git clone https://github.com/codellm-devkit/codeanalyzer-python
321
+ cd codeanalyzer-python
322
+ ```
323
+
324
+ 3. Install dependencies using uv:
325
+ ```bash
326
+ uv sync --all-groups
327
+ ```
328
+ This will install all dependencies including development and test dependencies.
329
+
330
+ ### Running from Source
331
+
332
+ When developing, you can run the tool directly from source:
333
+
334
+ ```bash
335
+ uv run codeanalyzer --input /path/to/python/project
336
+ ```
337
+
338
+ ### Running Tests
339
+
340
+ ```bash
341
+ uv run pytest --pspec -s
342
+ ```
343
+
344
+ ### Development Dependencies
345
+
346
+ The project includes additional dependency groups for development:
347
+
348
+ - **test**: pytest and related testing tools
349
+ - **dev**: development tools like ipdb
350
+
351
+ Install all groups with:
352
+ ```bash
353
+ uv sync --all-groups
354
+ ```
355
+
356
+ 2. Clone the repository:
357
+ ```bash
358
+ git clone https://github.com/codellm-devkit/codeanalyzer-python
359
+ cd codeanalyzer-python
360
+ ```
361
+
362
+ 3. Install dependencies using uv:
363
+ ```bash
364
+ uv sync --all-groups
365
+ ```
366
+ This will install all dependencies including development and test dependencies.
367
+
368
+ ### Running from Source
369
+
370
+ When developing, you can run the tool directly from source:
371
+
372
+ ```bash
373
+ uv run codeanalyzer --input /path/to/python/project
374
+ ```
375
+
376
+ ### Running Tests
377
+
378
+ ```bash
379
+ uv run pytest --pspec -s
380
+ ```
381
+
382
+ ### Development Dependencies
383
+
384
+ The project includes additional dependency groups for development:
385
+
386
+ - **test**: pytest and related testing tools
387
+ - **dev**: development tools like ipdb
388
+
389
+ Install all groups with:
390
+ ```bash
391
+ uv sync --all-groups
392
+ ```
@@ -0,0 +1,26 @@
1
+ codeanalyzer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ codeanalyzer/__main__.py,sha256=xbBEltVa3ACC1tiQ7RWBoG7afkpuSv6RI8A3PpPGrII,3915
3
+ codeanalyzer/core.py,sha256=29LVfRmprj6Y-f4rzwmdZ9dWH_S22zLo0Uqm_E62c5I,12431
4
+ codeanalyzer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ codeanalyzer/jedi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ codeanalyzer/jedi/jedi.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ codeanalyzer/schema/__init__.py,sha256=bIwfGFvgqtNZ0mCAvDXSo9WVJHqhm15iZc7YOuWYSZ0,390
8
+ codeanalyzer/schema/py_schema.py,sha256=YFd0EtJkTOiOruaVkO_ibbzTktSPOvKDvsxqcI3n9J8,10471
9
+ codeanalyzer/semantic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ codeanalyzer/semantic_analysis/codeql/__init__.py,sha256=ODMkdGvs3ebJdfIZle8T4VcHoCBhH_ZehWuWFpNh3NI,1022
11
+ codeanalyzer/semantic_analysis/codeql/codeql_analysis.py,sha256=-mVTm2JdQlfmV_9T4xLgjxwROKS83aP7lJAmQHh37xY,5312
12
+ codeanalyzer/semantic_analysis/codeql/codeql_exceptions.py,sha256=PnJOasW9rP68SEX158jSqQFdqjW_Q_Fx3vbH6vNiCQs,474
13
+ codeanalyzer/semantic_analysis/codeql/codeql_loader.py,sha256=o0BW-6yHkN6kLG66rOYQQ_ToQUn5Ivl9h9ZdBM3_E_Q,2288
14
+ codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py,sha256=QJtID1YZkO6Wyns_qTJFqOSiV238ArLXwgLv105B27E,6520
15
+ codeanalyzer/semantic_analysis/wala/__init__.py,sha256=JSDvkrpJ2U90Ikex34EluSHmoGutlmRhV2xvInt6tB8,743
16
+ codeanalyzer/syntactic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ codeanalyzer/syntactic_analysis/symbol_table_builder.py,sha256=Q6AncS5MED8xrKHv5KQdtg2pnppyrXkoDSFOJ0y8FIA,36175
18
+ codeanalyzer/utils/__init__.py,sha256=hC6VWdR5rerSqBxzu9KQHTASWqwrrYJv-CMDwrTlzkc,137
19
+ codeanalyzer/utils/logging.py,sha256=0vTkGSl5EZN8yhhWa_5Mrn1n_twRCSW53rNwjzQ9RbI,601
20
+ codeanalyzer/utils/progress_bar.py,sha256=ZHJzGiCo5q4dyXq4CtsrJeq9Ip7sD84T3yZjNX7TBys,2443
21
+ codeanalyzer_python-0.1.5.dist-info/METADATA,sha256=-3mwXD07jkzG_4O1xjuuipDuA0wQuk52sHP9CSkxk2k,14458
22
+ codeanalyzer_python-0.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ codeanalyzer_python-0.1.5.dist-info/entry_points.txt,sha256=eUrB7Jq5Oav6RblMX_RYfVLSw_h15NbzC3fNSnGsPuM,59
24
+ codeanalyzer_python-0.1.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
+ codeanalyzer_python-0.1.5.dist-info/licenses/NOTICE,sha256=YU0Z9NDWqKY-2jfFcbxeZ6fbnzz0oZeKmnUcO8a-bcQ,901
26
+ codeanalyzer_python-0.1.5.dist-info/RECORD,,
@@ -1,198 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: codeanalyzer-python
3
- Version: 0.1.3
4
- Summary: Static Analysis on Python source code using Jedi, CodeQL and Treesitter.
5
- Author-email: Rahul Krishna <i.m.ralk@gmail.com>
6
- License-File: LICENSE
7
- License-File: NOTICE
8
- Requires-Python: >=3.12
9
- Requires-Dist: asteroid>=0.7.0
10
- Requires-Dist: astor>=0.8.1
11
- Requires-Dist: jedi>=0.19.2
12
- Requires-Dist: loguru>=0.7.3
13
- Requires-Dist: networkx>=3.5
14
- Requires-Dist: pandas>=2.3.0
15
- Requires-Dist: pydantic>=2.11.7
16
- Requires-Dist: requests>=2.32.4
17
- Requires-Dist: rich>=14.0.0
18
- Requires-Dist: ruff>=0.12.2
19
- Requires-Dist: toml>=0.10.2
20
- Requires-Dist: typer>=0.16.0
21
- Description-Content-Type: text/markdown
22
-
23
- ![logo](https://github.com/codellm-devkit/codeanalyzer-python/blob/main/docs/assets/logo.png?raw=true)
24
-
25
- # A Python Static Analysis Toolkit (and Library)
26
-
27
- A comprehensive static analysis tool for Python source code that provides symbol table generation, call graph analysis, and semantic analysis using Jedi, CodeQL, and Tree-sitter.
28
-
29
- ## Installation
30
-
31
- This project uses [uv](https://docs.astral.sh/uv/) for dependency management.
32
-
33
- ### Prerequisites
34
-
35
- - [uv](https://docs.astral.sh/uv/getting-started/installation/) installed
36
- - Python 3.12 or higher. You can use `uv` to install Python if it's not already installed:
37
- ```bash
38
- uv python install 3.12
39
- ```
40
-
41
- #### System Package Requirements
42
-
43
- The tool creates virtual environments internally using Python's built-in `venv` module.
44
-
45
- **Ubuntu/Debian systems:**
46
- ```bash
47
- sudo apt update
48
- sudo apt install python3.12-venv python3-dev build-essential
49
- ```
50
-
51
- **Fedora/RHEL/CentOS systems:**
52
- ```bash
53
- sudo dnf group install "Development Tools"
54
- sudo dnf install python3-pip python3-venv python3-devel
55
- ```
56
- or on older versions:
57
- ```bash
58
- sudo yum groupinstall "Development Tools"
59
- sudo yum install python3-pip python3-venv python3-devel
60
- ```
61
-
62
- **macOS systems:**
63
- ```bash
64
- # Install Xcode Command Line Tools (for compilation)
65
- xcode-select --install
66
-
67
- # If using Homebrew Python (recommended)
68
- brew install python@3.12
69
-
70
- # If using pyenv (popular Python version manager)
71
- # First ensure pyenv is properly installed and configured
72
- pyenv install 3.12.0 # or latest 3.12.x version
73
- pyenv global 3.12.0 # or pyenv local 3.12.0 for project-specific
74
-
75
- # If using system Python, you may need to install certificates
76
- /Applications/Python\ 3.12/Install\ Certificates.command
77
- ```
78
-
79
- > **Note:** These packages are required as the tool uses Python's built-in `venv` module to create isolated environments for analysis.
80
-
81
- ### Setup
82
-
83
- 1. Clone the repository:
84
- ```bash
85
- git clone https://github.com/codellm-devkit/codeanalyzer-python
86
- cd codeanalyzer-python
87
- ```
88
-
89
- 2. Install dependencies using uv:
90
- ```bash
91
- uv sync --all-groups
92
- ```
93
- This will install all dependencies including development and test dependencies.
94
-
95
- ## Usage
96
-
97
- The codeanalyzer provides a command-line interface for performing static analysis on Python projects.
98
-
99
- ### Basic Usage
100
-
101
- ```bash
102
- uv run codeanalyzer --input /path/to/python/project
103
- ```
104
-
105
- ### Command Line Options
106
-
107
- To view the available options and commands, run `uv run codeanalyzer --help`. You should see output similar to the following:
108
-
109
- ```bash
110
- ❯ uv run codeanalyzer --help
111
-
112
- Usage: codeanalyzer [OPTIONS] COMMAND [ARGS]...
113
-
114
- Static Analysis on Python source code using Jedi, CodeQL and Tree sitter.
115
-
116
-
117
- ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
118
- │ * --input -i PATH Path to the project root directory. [default: None] [required] │
119
- │ --output -o PATH Output directory for artifacts. [default: None] │
120
- │ --analysis-level -a INTEGER 1: symbol table, 2: call graph. [default: 1] │
121
- │ --codeql --no-codeql Enable CodeQL-based analysis. [default: no-codeql] │
122
- │ --eager --lazy Enable eager or lazy analysis. Defaults to lazy. [default: lazy] │
123
- │ --cache-dir -c PATH Directory to store analysis cache. [default: None] │
124
- │ --clear-cache --keep-cache Clear cache after analysis. [default: clear-cache] │
125
- │ -v INTEGER Increase verbosity: -v, -vv, -vvv [default: 0] │
126
- │ --help Show this message and exit. │
127
- ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
128
- ```
129
-
130
- ### Examples
131
-
132
- 1. **Basic analysis with symbol table:**
133
- ```bash
134
- uv run codeanalyzer --input ./my-python-project
135
- ```
136
-
137
- This will print the symbol table to stdout in JSON format to the standard output. If you want to save the output, you can use the `--output` option.
138
-
139
- ```bash
140
- uv run codeanalyzer --input ./my-python-project --output /path/to/analysis-results
141
- ```
142
-
143
- Now, you can find the analysis results in `analysis.json` in the specified directory.
144
-
145
- 2. **Toggle analysis levels with `--analysis-level`:**
146
- ```bash
147
- uv run codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
148
- ```
149
- Call graph analysis can be enabled by setting the level to `2`:
150
- ```bash
151
- uv run codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
152
- ```
153
- ***Note: The `--analysis-level=2` is not yet implemented in this version.***
154
-
155
- 3. **Analysis with CodeQL enabled:**
156
- ```bash
157
- uv run codeanalyzer --input ./my-python-project --codeql
158
- ```
159
- This will perform CodeQL-based analysis in addition to the standard symbol table generation.
160
-
161
- ***Note: Not yet fully implemented. Please refrain from using this option until further notice.***
162
-
163
- 4. **Eager analysis with custom cache directory:**
164
- ```bash
165
- uv run codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
166
- ```
167
- This will rebuild the analysis cache at every run and store it in `/path/to/custom-cache/.codeanalyzer`. The cache will be cleared by default after analysis unless you specify `--keep-cache`.
168
-
169
- If you provide --cache-dir, the cache will be stored in that directory. If not specified, it defaults to `.codeanalyzer` in the current working directory (`$PWD`).
170
-
171
- 5. **Quiet mode (minimal output):**
172
- ```bash
173
- uv run codeanalyzer --input /path/to/my-python-project --quiet
174
- ```
175
-
176
- ### Output
177
-
178
- By default, analysis results are printed to stdout in JSON format. When using the `--output` option, results are saved to `analysis.json` in the specified directory.
179
-
180
- ## Development
181
-
182
- ### Running Tests
183
-
184
- ```bash
185
- uv run pytest --pspec -s
186
- ```
187
-
188
- ### Development Dependencies
189
-
190
- The project includes additional dependency groups for development:
191
-
192
- - **test**: pytest and related testing tools
193
- - **dev**: development tools like ipdb
194
-
195
- Install all groups with:
196
- ```bash
197
- uv sync --all-groups
198
- ```
@@ -1,26 +0,0 @@
1
- codeanalyzer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- codeanalyzer/__main__.py,sha256=vfASpqZsadwzxNkdHIlqb6r6ERT7O_JlqEIP8KKg1Z4,2580
3
- codeanalyzer/core.py,sha256=fR6ffVc74IH-5kwGR4iqg4kNXFVoblXHVSDZ4Z__zQo,12521
4
- codeanalyzer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- codeanalyzer/jedi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- codeanalyzer/jedi/jedi.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- codeanalyzer/schema/__init__.py,sha256=YWGFbLLCOqc94VXA6NaBKKOKf7TBFbx_DyOgmWucZFQ,388
8
- codeanalyzer/schema/py_schema.py,sha256=xOvzmyv-3VHQAe5FtirM04bfD5ZKKs2jG011UiV7jH0,13148
9
- codeanalyzer/semantic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- codeanalyzer/semantic_analysis/codeql/__init__.py,sha256=JYeyTli9aa-V1gpdGKdwr2e927G72_dgcUw25Pagt3o,1022
11
- codeanalyzer/semantic_analysis/codeql/codeql_analysis.py,sha256=zr3sXkKmBXyRUCRy2u6OZD1CXYRol8_D2p8cbX0NoXA,5324
12
- codeanalyzer/semantic_analysis/codeql/codeql_exceptions.py,sha256=PnJOasW9rP68SEX158jSqQFdqjW_Q_Fx3vbH6vNiCQs,474
13
- codeanalyzer/semantic_analysis/codeql/codeql_loader.py,sha256=GwPIItrzyuEIDuet9txgrgkP1yGO2vTsjTWBt6z1EWM,2689
14
- codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py,sha256=fBNbdQhIH8vnHNYNHQgel2tVpowmXmP_Vi5qF4JL_cY,6519
15
- codeanalyzer/semantic_analysis/wala/__init__.py,sha256=JSDvkrpJ2U90Ikex34EluSHmoGutlmRhV2xvInt6tB8,743
16
- codeanalyzer/syntactic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- codeanalyzer/syntactic_analysis/symbol_table_builder.py,sha256=b9IlM-WsCO_p2a0jUpHPHhf_XWpSvWmx6G-3oJgu75s,37026
18
- codeanalyzer/utils/__init__.py,sha256=Ipgq2cSoNgTMSi-BamJoIAWo_1LN2IyaYW4Ms1z-qnI,157
19
- codeanalyzer/utils/logging.py,sha256=UkSKx9IyBd7mCGcgXTR-PX-Rw-x_0tZDRRnwDyrGeuY,600
20
- codeanalyzer/utils/progress_bar.py,sha256=4BmrOVEzZt2rOvGNoP-j_8rCapDZU36VibUA8S7--9A,2442
21
- codeanalyzer_python-0.1.3.dist-info/METADATA,sha256=eFLmP0pz3-NBuVqz5BBwytwkYNmloNtdVBr6WIBGEGU,7474
22
- codeanalyzer_python-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
- codeanalyzer_python-0.1.3.dist-info/entry_points.txt,sha256=eUrB7Jq5Oav6RblMX_RYfVLSw_h15NbzC3fNSnGsPuM,59
24
- codeanalyzer_python-0.1.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
- codeanalyzer_python-0.1.3.dist-info/licenses/NOTICE,sha256=YU0Z9NDWqKY-2jfFcbxeZ6fbnzz0oZeKmnUcO8a-bcQ,901
26
- codeanalyzer_python-0.1.3.dist-info/RECORD,,