@@ -6,15 +6,13 @@ A comprehensive static analysis tool for Python source code that provides symbol
6
6
7
7
## Installation
8
8
9
- This project uses [ uv] ( https://docs.astral.sh/uv/ ) for dependency management.
9
+ ``` bash
10
+ pip install codeanalyzer-python
11
+ ```
10
12
11
13
### Prerequisites
12
14
13
- - [ uv] ( https://docs.astral.sh/uv/getting-started/installation/ ) installed
14
- - Python 3.12 or higher. You can use ` uv ` to install Python if it's not already installed:
15
- ``` bash
16
- uv python install 3.12
17
- ```
15
+ - Python 3.12 or higher
18
16
19
17
#### System Package Requirements
20
18
@@ -56,36 +54,22 @@ pyenv global 3.12.0 # or pyenv local 3.12.0 for project-specific
56
54
57
55
> ** Note:** These packages are required as the tool uses Python's built-in ` venv ` module to create isolated environments for analysis.
58
56
59
- ### Setup
60
-
61
- 1 . Clone the repository:
62
- ``` bash
63
- git clone https://github.com/codellm-devkit/codeanalyzer-python
64
- cd codeanalyzer-python
65
- ```
66
-
67
- 2 . Install dependencies using uv:
68
- ``` bash
69
- uv sync --all-groups
70
- ```
71
- This will install all dependencies including development and test dependencies.
72
-
73
57
## Usage
74
58
75
59
The codeanalyzer provides a command-line interface for performing static analysis on Python projects.
76
60
77
61
### Basic Usage
78
62
79
63
``` bash
80
- uv run codeanalyzer --input /path/to/python/project
64
+ codeanalyzer --input /path/to/python/project
81
65
```
82
66
83
67
### Command Line Options
84
68
85
- To view the available options and commands, run ` uv run codeanalyzer --help` . You should see output similar to the following:
69
+ To view the available options and commands, run ` codeanalyzer --help ` . You should see output similar to the following:
86
70
87
71
``` bash
88
- ❯ uv run codeanalyzer --help
72
+ ❯ codeanalyzer --help
89
73
90
74
Usage: codeanalyzer [OPTIONS] COMMAND [ARGS]...
91
75
@@ -109,46 +93,46 @@ To view the available options and commands, run `uv run codeanalyzer --help`. Yo
109
93
110
94
1 . ** Basic analysis with symbol table:**
111
95
``` bash
112
- uv run codeanalyzer --input ./my-python-project
96
+ codeanalyzer --input ./my-python-project
113
97
```
114
98
115
99
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.
116
100
117
101
``` bash
118
- uv run codeanalyzer --input ./my-python-project --output /path/to/analysis-results
102
+ codeanalyzer --input ./my-python-project --output /path/to/analysis-results
119
103
```
120
104
121
105
Now, you can find the analysis results in ` analysis.json ` in the specified directory.
122
106
123
107
2 . ** Toggle analysis levels with ` --analysis-level ` :**
124
108
``` bash
125
- uv run codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
109
+ codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
126
110
```
127
111
Call graph analysis can be enabled by setting the level to ` 2 ` :
128
112
``` bash
129
- uv run codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
113
+ codeanalyzer --input ./my-python-project --analysis-level 2 # Symbol table + Call graph
130
114
```
131
115
*** Note: The ` --analysis-level=2 ` is not yet implemented in this version.***
132
116
133
117
3 . ** Analysis with CodeQL enabled:**
134
118
``` bash
135
- uv run codeanalyzer --input ./my-python-project --codeql
119
+ codeanalyzer --input ./my-python-project --codeql
136
120
```
137
121
This will perform CodeQL-based analysis in addition to the standard symbol table generation.
138
122
139
123
*** Note: Not yet fully implemented. Please refrain from using this option until further notice.***
140
124
141
125
4 . ** Eager analysis with custom cache directory:**
142
126
``` bash
143
- uv run codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
127
+ codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
144
128
```
145
129
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 ` .
146
130
147
131
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 ` ).
148
132
149
133
5 . ** Quiet mode (minimal output):**
150
134
``` bash
151
- uv run codeanalyzer --input /path/to/my-python-project --quiet
135
+ codeanalyzer --input /path/to/my-python-project --quiet
152
136
```
153
137
154
138
### Output
@@ -157,6 +141,32 @@ By default, analysis results are printed to stdout in JSON format. When using th
157
141
158
142
## Development
159
143
144
+ This project uses [ uv] ( https://docs.astral.sh/uv/ ) for dependency management during development.
145
+
146
+ ### Development Setup
147
+
148
+ 1 . Install [ uv] ( https://docs.astral.sh/uv/getting-started/installation/ )
149
+
150
+ 2 . Clone the repository:
151
+ ``` bash
152
+ git clone https://github.com/codellm-devkit/codeanalyzer-python
153
+ cd codeanalyzer-python
154
+ ```
155
+
156
+ 3 . Install dependencies using uv:
157
+ ``` bash
158
+ uv sync --all-groups
159
+ ```
160
+ This will install all dependencies including development and test dependencies.
161
+
162
+ ### Running from Source
163
+
164
+ When developing, you can run the tool directly from source:
165
+
166
+ ``` bash
167
+ uv run codeanalyzer --input /path/to/python/project
168
+ ```
169
+
160
170
### Running Tests
161
171
162
172
``` bash
0 commit comments