codeanalyzer-python 0.1.5__py3-none-any.whl → 0.1.6__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/__init__.py +5 -0
- codeanalyzer/__main__.py +3 -8
- codeanalyzer/core.py +2 -2
- codeanalyzer/syntactic_analysis/symbol_table_builder.py +3 -1
- {codeanalyzer_python-0.1.5.dist-info → codeanalyzer_python-0.1.6.dist-info}/METADATA +3 -3
- {codeanalyzer_python-0.1.5.dist-info → codeanalyzer_python-0.1.6.dist-info}/RECORD +10 -10
- {codeanalyzer_python-0.1.5.dist-info → codeanalyzer_python-0.1.6.dist-info}/WHEEL +0 -0
- {codeanalyzer_python-0.1.5.dist-info → codeanalyzer_python-0.1.6.dist-info}/entry_points.txt +0 -0
- {codeanalyzer_python-0.1.5.dist-info → codeanalyzer_python-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {codeanalyzer_python-0.1.5.dist-info → codeanalyzer_python-0.1.6.dist-info}/licenses/NOTICE +0 -0
codeanalyzer/__init__.py
CHANGED
codeanalyzer/__main__.py
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from typing import Annotated, Optional
|
|
3
|
-
from enum import Enum
|
|
4
3
|
|
|
5
4
|
import typer
|
|
6
5
|
|
|
7
|
-
from codeanalyzer.core import
|
|
6
|
+
from codeanalyzer.core import Codeanalyzer
|
|
8
7
|
from codeanalyzer.utils import _set_log_level, logger
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class OutputFormat(str, Enum):
|
|
12
|
-
JSON = "json"
|
|
13
|
-
MSGPACK = "msgpack"
|
|
8
|
+
from codeanalyzer.config import OutputFormat
|
|
14
9
|
|
|
15
10
|
|
|
16
11
|
def main(
|
|
@@ -67,7 +62,7 @@ def main(
|
|
|
67
62
|
logger.error(f"Input path '{input}' does not exist.")
|
|
68
63
|
raise typer.Exit(code=1)
|
|
69
64
|
|
|
70
|
-
with
|
|
65
|
+
with Codeanalyzer(
|
|
71
66
|
input, analysis_level, using_codeql, rebuild_analysis, cache_dir, clear_cache
|
|
72
67
|
) as analyzer:
|
|
73
68
|
artifacts = analyzer.analyze()
|
codeanalyzer/core.py
CHANGED
|
@@ -13,7 +13,7 @@ from codeanalyzer.syntactic_analysis.symbol_table_builder import SymbolTableBuil
|
|
|
13
13
|
from codeanalyzer.utils import logger
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class Codeanalyzer:
|
|
17
17
|
"""Core functionality for CodeQL analysis.
|
|
18
18
|
|
|
19
19
|
Args:
|
|
@@ -196,7 +196,7 @@ class AnalyzerCore:
|
|
|
196
196
|
f"a working Python interpreter that can create virtual environments."
|
|
197
197
|
)
|
|
198
198
|
|
|
199
|
-
def __enter__(self) -> "
|
|
199
|
+
def __enter__(self) -> "Codeanalyzer":
|
|
200
200
|
# If no virtualenv is provided, try to create one using requirements.txt or pyproject.toml
|
|
201
201
|
venv_path = self.cache_dir / self.project_dir.name / "virtualenv"
|
|
202
202
|
# Ensure the cache directory exists for this project
|
|
@@ -503,7 +503,9 @@ class SymbolTableBuilder:
|
|
|
503
503
|
|
|
504
504
|
return params
|
|
505
505
|
|
|
506
|
-
def _accessed_symbols(
|
|
506
|
+
def _accessed_symbols(
|
|
507
|
+
self, fn_node: ast.FunctionDef, script: Script
|
|
508
|
+
) -> List[PySymbol]:
|
|
507
509
|
"""Analyzes the function body to extract all accessed symbols."""
|
|
508
510
|
symbols = []
|
|
509
511
|
for node in ast.walk(fn_node):
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeanalyzer-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
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
|
|
7
7
|
License-File: NOTICE
|
|
8
|
-
Requires-Python:
|
|
8
|
+
Requires-Python: ==3.10.*
|
|
9
9
|
Requires-Dist: jedi>=0.19.2
|
|
10
10
|
Requires-Dist: loguru>=0.7.3
|
|
11
11
|
Requires-Dist: msgpack>=1.1.1
|
|
12
|
-
Requires-Dist: networkx>=3.
|
|
12
|
+
Requires-Dist: networkx>=3.4.2
|
|
13
13
|
Requires-Dist: pandas>=2.3.1
|
|
14
14
|
Requires-Dist: pydantic>=2.11.7
|
|
15
15
|
Requires-Dist: requests>=2.32.4
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
codeanalyzer/__init__.py,sha256=
|
|
2
|
-
codeanalyzer/__main__.py,sha256=
|
|
3
|
-
codeanalyzer/core.py,sha256=
|
|
1
|
+
codeanalyzer/__init__.py,sha256=BZ3Kuwl-F_F-8H8cepLnVJ4Ku4NNUjjqg0Y6ujPQSsI,108
|
|
2
|
+
codeanalyzer/__main__.py,sha256=CHSa6A-AT5XtZ2GJvEEdjz8emr7Mr3xP4qG5xxRWX7k,3863
|
|
3
|
+
codeanalyzer/core.py,sha256=BVlfCaMqIRfaUkOk9_5XrnuvzHZ0WBtAkjRj3yOMHRI,12431
|
|
4
4
|
codeanalyzer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
codeanalyzer/jedi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
codeanalyzer/jedi/jedi.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -14,13 +14,13 @@ codeanalyzer/semantic_analysis/codeql/codeql_loader.py,sha256=o0BW-6yHkN6kLG66rO
|
|
|
14
14
|
codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py,sha256=QJtID1YZkO6Wyns_qTJFqOSiV238ArLXwgLv105B27E,6520
|
|
15
15
|
codeanalyzer/semantic_analysis/wala/__init__.py,sha256=JSDvkrpJ2U90Ikex34EluSHmoGutlmRhV2xvInt6tB8,743
|
|
16
16
|
codeanalyzer/syntactic_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
codeanalyzer/syntactic_analysis/symbol_table_builder.py,sha256=
|
|
17
|
+
codeanalyzer/syntactic_analysis/symbol_table_builder.py,sha256=kwmJiJV01olKcKPQKrZ8Mp3CKOMPdrM7dvb7pB6v3hg,36194
|
|
18
18
|
codeanalyzer/utils/__init__.py,sha256=hC6VWdR5rerSqBxzu9KQHTASWqwrrYJv-CMDwrTlzkc,137
|
|
19
19
|
codeanalyzer/utils/logging.py,sha256=0vTkGSl5EZN8yhhWa_5Mrn1n_twRCSW53rNwjzQ9RbI,601
|
|
20
20
|
codeanalyzer/utils/progress_bar.py,sha256=ZHJzGiCo5q4dyXq4CtsrJeq9Ip7sD84T3yZjNX7TBys,2443
|
|
21
|
-
codeanalyzer_python-0.1.
|
|
22
|
-
codeanalyzer_python-0.1.
|
|
23
|
-
codeanalyzer_python-0.1.
|
|
24
|
-
codeanalyzer_python-0.1.
|
|
25
|
-
codeanalyzer_python-0.1.
|
|
26
|
-
codeanalyzer_python-0.1.
|
|
21
|
+
codeanalyzer_python-0.1.6.dist-info/METADATA,sha256=GYnaipfEkaoQiA4cRd5dYbOtnLdj7Q2mTWK-e-Jrzdc,14462
|
|
22
|
+
codeanalyzer_python-0.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
23
|
+
codeanalyzer_python-0.1.6.dist-info/entry_points.txt,sha256=eUrB7Jq5Oav6RblMX_RYfVLSw_h15NbzC3fNSnGsPuM,59
|
|
24
|
+
codeanalyzer_python-0.1.6.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
25
|
+
codeanalyzer_python-0.1.6.dist-info/licenses/NOTICE,sha256=YU0Z9NDWqKY-2jfFcbxeZ6fbnzz0oZeKmnUcO8a-bcQ,901
|
|
26
|
+
codeanalyzer_python-0.1.6.dist-info/RECORD,,
|
|
File without changes
|
{codeanalyzer_python-0.1.5.dist-info → codeanalyzer_python-0.1.6.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{codeanalyzer_python-0.1.5.dist-info → codeanalyzer_python-0.1.6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|