codeanalyzer-python 0.1.13__py3-none-any.whl → 0.1.14__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.
- codeanalyzer/__main__.py +0 -5
- codeanalyzer/core.py +154 -19
- codeanalyzer/options/options.py +0 -1
- codeanalyzer/schema/py_schema.py +20 -0
- codeanalyzer/semantic_analysis/call_graph.py +266 -0
- codeanalyzer/semantic_analysis/codeql/codeql_analysis.py +236 -69
- codeanalyzer/semantic_analysis/codeql/codeql_loader.py +32 -4
- codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py +51 -31
- codeanalyzer/syntactic_analysis/symbol_table_builder.py +87 -4
- {codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/METADATA +20 -42
- {codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/RECORD +15 -15
- {codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/WHEEL +1 -1
- codeanalyzer/semantic_analysis/wala/__init__.py +0 -15
- {codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/entry_points.txt +0 -0
- {codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/licenses/LICENSE +0 -0
- {codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/licenses/NOTICE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeanalyzer-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.14
|
|
4
4
|
Summary: Static Analysis on Python source code using Jedi, CodeQL and Treesitter.
|
|
5
5
|
Author-email: Rahul Krishna <i.m.ralk@gmail.com>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -110,16 +110,15 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
|
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
113
|
-
│ * --input -i PATH Path to the project root directory. [default: None] [required]
|
|
114
|
-
│ --output -o PATH Output directory for artifacts. [default: None]
|
|
115
|
-
│ --format -f [json|msgpack] Output format: json or msgpack. [default: json]
|
|
116
|
-
│ --
|
|
117
|
-
│ --
|
|
118
|
-
│ --
|
|
119
|
-
│ --cache-
|
|
120
|
-
│
|
|
121
|
-
│
|
|
122
|
-
│ --help Show this message and exit. │
|
|
113
|
+
│ * --input -i PATH Path to the project root directory. [default: None] [required] │
|
|
114
|
+
│ --output -o PATH Output directory for artifacts. [default: None] │
|
|
115
|
+
│ --format -f [json|msgpack] Output format: json or msgpack. [default: json] │
|
|
116
|
+
│ --codeql --no-codeql Enable CodeQL-based analysis. [default: no-codeql] │
|
|
117
|
+
│ --eager --lazy Enable eager or lazy analysis. Defaults to lazy. [default: lazy] │
|
|
118
|
+
│ --cache-dir -c PATH Directory to store analysis cache. [default: None] │
|
|
119
|
+
│ --clear-cache --keep-cache Clear cache after analysis. [default: clear-cache] │
|
|
120
|
+
│ -v INTEGER Increase verbosity: -v, -vv, -vvv [default: 0] │
|
|
121
|
+
│ --help Show this message and exit. │
|
|
123
122
|
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
124
123
|
```
|
|
125
124
|
|
|
@@ -145,25 +144,15 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
|
|
|
145
144
|
|
|
146
145
|
This will save the analysis results in `analysis.msgpack` in the specified directory.
|
|
147
146
|
|
|
148
|
-
3. **
|
|
149
|
-
```bash
|
|
150
|
-
codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
|
|
151
|
-
```
|
|
152
|
-
Call graph analysis can be enabled by setting the level to `2`:
|
|
153
|
-
```bash
|
|
154
|
-
codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
|
|
155
|
-
```
|
|
156
|
-
***Note: The `--analysis-level=2` is not yet implemented in this version.***
|
|
157
|
-
|
|
158
|
-
4. **Analysis with CodeQL enabled:**
|
|
147
|
+
3. **Analysis with CodeQL enabled:**
|
|
159
148
|
```bash
|
|
160
149
|
codeanalyzer --input ./my-python-project --codeql
|
|
161
150
|
```
|
|
162
|
-
|
|
151
|
+
Every run produces a symbol table **and** a call graph. By default, edges come from Jedi's lexical analysis. Adding `--codeql` resolves additional edges (including RPC / third-party / dynamically-dispatched targets) and merges them with the Jedi-derived edges. CodeQL also backfills resolved callees on Jedi-emitted call sites where Jedi couldn't resolve them.
|
|
163
152
|
|
|
164
|
-
***Note:
|
|
153
|
+
***Note: CodeQL integration is experimental. The CLI is downloaded into `<cache_dir>/codeql/` on first use and reused thereafter.***
|
|
165
154
|
|
|
166
|
-
|
|
155
|
+
4. **Eager analysis with custom cache directory:**
|
|
167
156
|
```bash
|
|
168
157
|
codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
|
|
169
158
|
```
|
|
@@ -171,7 +160,7 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
|
|
|
171
160
|
|
|
172
161
|
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`).
|
|
173
162
|
|
|
174
|
-
|
|
163
|
+
5. **Quiet mode (minimal output):**
|
|
175
164
|
```bash
|
|
176
165
|
codeanalyzer --input /path/to/my-python-project --quiet
|
|
177
166
|
```
|
|
@@ -269,7 +258,6 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
|
|
|
269
258
|
│ * --input -i PATH Path to the project root directory. [default: None] [required] │
|
|
270
259
|
│ --output -o PATH Output directory for artifacts. [default: None] │
|
|
271
260
|
│ --format -f [json|msgpack] Output format: json or msgpack. [default: json]. │
|
|
272
|
-
│ --analysis-level -a INTEGER 1: symbol table, 2: call graph. [default: 1] │
|
|
273
261
|
│ --codeql --no-codeql Enable CodeQL-based analysis. [default: no-codeql] │
|
|
274
262
|
│ --eager --lazy Enable eager or lazy analysis. Defaults to lazy. [default: lazy] │
|
|
275
263
|
│ --cache-dir -c PATH Directory to store analysis cache. [default: None] │
|
|
@@ -294,25 +282,15 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
|
|
|
294
282
|
|
|
295
283
|
Now, you can find the analysis results in `analysis.json` in the specified directory.
|
|
296
284
|
|
|
297
|
-
2. **
|
|
298
|
-
```bash
|
|
299
|
-
codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
|
|
300
|
-
```
|
|
301
|
-
Call graph analysis can be enabled by setting the level to `2`:
|
|
302
|
-
```bash
|
|
303
|
-
codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
|
|
304
|
-
```
|
|
305
|
-
***Note: The `--analysis-level=2` is not yet implemented in this version.***
|
|
306
|
-
|
|
307
|
-
3. **Analysis with CodeQL enabled:**
|
|
285
|
+
2. **Analysis with CodeQL enabled:**
|
|
308
286
|
```bash
|
|
309
287
|
codeanalyzer --input ./my-python-project --codeql
|
|
310
288
|
```
|
|
311
|
-
|
|
289
|
+
Every run produces a symbol table **and** a call graph. By default, edges come from Jedi's lexical analysis. Adding `--codeql` resolves additional edges (including RPC / third-party / dynamically-dispatched targets) and merges them with the Jedi-derived edges. CodeQL also backfills resolved callees on Jedi-emitted call sites where Jedi couldn't resolve them.
|
|
312
290
|
|
|
313
|
-
|
|
291
|
+
***Note: CodeQL integration is experimental. The CLI is downloaded into `<cache_dir>/codeql/` on first use and reused thereafter.***
|
|
314
292
|
|
|
315
|
-
|
|
293
|
+
3. **Eager analysis with custom cache directory:**
|
|
316
294
|
```bash
|
|
317
295
|
codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
|
|
318
296
|
```
|
|
@@ -320,7 +298,7 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
|
|
|
320
298
|
|
|
321
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`).
|
|
322
300
|
|
|
323
|
-
|
|
301
|
+
4. **Save output in msgpack format:**
|
|
324
302
|
```bash
|
|
325
303
|
codeanalyzer --input ./my-python-project --output /path/to/analysis-results --format msgpack
|
|
326
304
|
```
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
codeanalyzer/__init__.py,sha256=BZ3Kuwl-F_F-8H8cepLnVJ4Ku4NNUjjqg0Y6ujPQSsI,108
|
|
2
|
-
codeanalyzer/__main__.py,sha256=
|
|
3
|
-
codeanalyzer/core.py,sha256=
|
|
2
|
+
codeanalyzer/__main__.py,sha256=z5hV6JDMSulvsV1S1vaib_7-pWCYnclssbvV9Wc6WcI,5028
|
|
3
|
+
codeanalyzer/core.py,sha256=_kndexmk7S0DswwvinevARiF4_bB7oMz2BRJBnBCp-w,30605
|
|
4
4
|
codeanalyzer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
codeanalyzer/config/__init__.py,sha256=9XBxAn1oWGRuhg3bEBUuVGs3hFNXEAKrr-Ce7tq9a2k,61
|
|
6
6
|
codeanalyzer/config/config.py,sha256=ZiKzc5uEUCIvih58-6BDtLLI1hPij41wGQjBcj9KNQM,188
|
|
7
7
|
codeanalyzer/jedi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
codeanalyzer/jedi/jedi.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
codeanalyzer/options/__init__.py,sha256=4kkwBiOrGjalrkfFF8EJgfgOtaPtD7HcCYfZgcOgelU,67
|
|
10
|
-
codeanalyzer/options/options.py,sha256=
|
|
10
|
+
codeanalyzer/options/options.py,sha256=moHOGYSpeZfwMBEbxoZRs03p9cNJfZi-QYlckKQoR5Q,564
|
|
11
11
|
codeanalyzer/schema/__init__.py,sha256=HB7y4y-49dkEo-H9GREam1_9Cr1N-GF6MYwx9yoU878,1978
|
|
12
|
-
codeanalyzer/schema/py_schema.py,sha256=
|
|
12
|
+
codeanalyzer/schema/py_schema.py,sha256=meEgkl7C-LCEAXuqs4pe8eGrEnxIzbEJCHiv8Hd1ObE,11578
|
|
13
13
|
codeanalyzer/semantic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
codeanalyzer/semantic_analysis/call_graph.py,sha256=3hgLA1sL1YFQa4fzUz_ifVbLs1I9V2QFe7ldwN18mcg,10323
|
|
14
15
|
codeanalyzer/semantic_analysis/codeql/__init__.py,sha256=ODMkdGvs3ebJdfIZle8T4VcHoCBhH_ZehWuWFpNh3NI,1022
|
|
15
|
-
codeanalyzer/semantic_analysis/codeql/codeql_analysis.py,sha256
|
|
16
|
+
codeanalyzer/semantic_analysis/codeql/codeql_analysis.py,sha256=jDannAyQ0tRIBIrA0DwYGyIjrTvBUXv7PFGFFnj8YYw,12558
|
|
16
17
|
codeanalyzer/semantic_analysis/codeql/codeql_exceptions.py,sha256=PnJOasW9rP68SEX158jSqQFdqjW_Q_Fx3vbH6vNiCQs,474
|
|
17
|
-
codeanalyzer/semantic_analysis/codeql/codeql_loader.py,sha256=
|
|
18
|
-
codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py,sha256=
|
|
19
|
-
codeanalyzer/semantic_analysis/wala/__init__.py,sha256=JSDvkrpJ2U90Ikex34EluSHmoGutlmRhV2xvInt6tB8,743
|
|
18
|
+
codeanalyzer/semantic_analysis/codeql/codeql_loader.py,sha256=XFjTx6ERRipzTguwHzSS5BTI6Nzf95fcdK3nLxqHARs,3599
|
|
19
|
+
codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py,sha256=Zr5NPIpQjm8W-up-js8f3Q7Y9YYfSfUalm6yxtdTC90,7768
|
|
20
20
|
codeanalyzer/syntactic_analysis/__init__.py,sha256=EUQkJEh6wHjWx2qTTKbTbUgwSbfKeNieKHNy7RknVXA,476
|
|
21
21
|
codeanalyzer/syntactic_analysis/exceptions.py,sha256=whs_n0vIu655Jkk1a7iOoXY6iIca4pZqJnU40V9Ejaw,537
|
|
22
|
-
codeanalyzer/syntactic_analysis/symbol_table_builder.py,sha256=
|
|
22
|
+
codeanalyzer/syntactic_analysis/symbol_table_builder.py,sha256=zmHFt8pN50jG-Ex4fnisvbLmn1XaW05jwbV_xSG4qfU,38177
|
|
23
23
|
codeanalyzer/utils/__init__.py,sha256=hC6VWdR5rerSqBxzu9KQHTASWqwrrYJv-CMDwrTlzkc,137
|
|
24
24
|
codeanalyzer/utils/logging.py,sha256=0vTkGSl5EZN8yhhWa_5Mrn1n_twRCSW53rNwjzQ9RbI,601
|
|
25
25
|
codeanalyzer/utils/progress_bar.py,sha256=ZHJzGiCo5q4dyXq4CtsrJeq9Ip7sD84T3yZjNX7TBys,2443
|
|
26
|
-
codeanalyzer_python-0.1.
|
|
27
|
-
codeanalyzer_python-0.1.
|
|
28
|
-
codeanalyzer_python-0.1.
|
|
29
|
-
codeanalyzer_python-0.1.
|
|
30
|
-
codeanalyzer_python-0.1.
|
|
31
|
-
codeanalyzer_python-0.1.
|
|
26
|
+
codeanalyzer_python-0.1.14.dist-info/METADATA,sha256=meajf2SAGQBVRMjSGrFKI2XiJ7uaFjoV59uhoMZepiI,15823
|
|
27
|
+
codeanalyzer_python-0.1.14.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
28
|
+
codeanalyzer_python-0.1.14.dist-info/entry_points.txt,sha256=eUrB7Jq5Oav6RblMX_RYfVLSw_h15NbzC3fNSnGsPuM,59
|
|
29
|
+
codeanalyzer_python-0.1.14.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
30
|
+
codeanalyzer_python-0.1.14.dist-info/licenses/NOTICE,sha256=YU0Z9NDWqKY-2jfFcbxeZ6fbnzz0oZeKmnUcO8a-bcQ,901
|
|
31
|
+
codeanalyzer_python-0.1.14.dist-info/RECORD,,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
################################################################################
|
|
2
|
-
# Copyright IBM Corporation 2025
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
################################################################################
|
{codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{codeanalyzer_python-0.1.13.dist-info → codeanalyzer_python-0.1.14.dist-info}/licenses/NOTICE
RENAMED
|
File without changes
|