Skip to content

Commit 5680250

Browse files
Merge develop and fix conflicts in __init__.py
2 parents 21ce121 + fe1ba9b commit 5680250

File tree

115 files changed

+11676
-8648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+11676
-8648
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,47 @@ A powerful static code analysis system that provides extensive information about
77
This analyzer provides comprehensive analysis of your codebase, including:
88

99
### 1. Codebase Structure Analysis
10+
1011
- File Statistics (count, language, size)
1112
- Symbol Tree Analysis
1213
- Import/Export Analysis
1314
- Module Organization
1415

1516
### 2. Symbol-Level Analysis
17+
1618
- Function Analysis (parameters, return types, complexity)
1719
- Class Analysis (methods, attributes, inheritance)
1820
- Variable Analysis
1921
- Type Analysis
2022

2123
### 3. Dependency and Flow Analysis
24+
2225
- Call Graph Generation
2326
- Data Flow Analysis
2427
- Control Flow Analysis
2528
- Symbol Usage Analysis
2629

2730
### 4. Code Quality Analysis
31+
2832
- Unused Code Detection
2933
- Code Duplication Analysis
3034
- Complexity Metrics
3135
- Style and Convention Analysis
3236

3337
### 5. Visualization Capabilities
38+
3439
- Dependency Graphs
3540
- Call Graphs
3641
- Symbol Trees
3742
- Heat Maps
3843

3944
### 6. Language-Specific Analysis
45+
4046
- Python-Specific Analysis
4147
- TypeScript-Specific Analysis
4248

4349
### 7. Code Metrics
50+
4451
- Monthly Commits
4552
- Cyclomatic Complexity
4653
- Halstead Volume
@@ -49,12 +56,14 @@ This analyzer provides comprehensive analysis of your codebase, including:
4956
## Installation
5057

5158
1. Clone the repository:
59+
5260
```bash
5361
git clone https://github.com/yourusername/codebase-analyzer.git
5462
cd codebase-analyzer
5563
```
5664

5765
2. Install dependencies:
66+
5867
```bash
5968
pip install -r requirements.txt
6069
```
@@ -111,4 +120,3 @@ python codebase_analyzer.py --repo-url https://github.com/username/repo --output
111120
## License
112121

113122
MIT
114-

codegen-examples/examples/snapshot_event_handler/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Event Handler with codebase snapshotting
22

3-
This project is designed to using Modal snapshotting to provide parsed codebase instances with minimal latency, make it more manageable to write event based handlers.
3+
This project is designed to using Modal snapshotting to provide parsed codebase instances with minimal latency, make it more manageable to write event based handlers.
44

55
Follow the instructions below to set up and deploy the application.
66

@@ -9,7 +9,7 @@ Follow the instructions below to set up and deploy the application.
99
Before you begin, ensure you have the following installed and configured:
1010

1111
1. **uv**: A tool for managing virtual environments and syncing dependencies.
12-
2. **Modal**: Ensure you have Modal configured on your system.
12+
1. **Modal**: Ensure you have Modal configured on your system.
1313

1414
## Setup Instructions
1515

@@ -23,15 +23,15 @@ Before you begin, ensure you have the following installed and configured:
2323
source ./venv/bin/activate
2424
```
2525

26-
2. **Sync Dependencies**
26+
1. **Sync Dependencies**
2727

2828
Sync the project dependencies using `uv`:
2929

3030
```bash
3131
uv sync
3232
```
3333

34-
3. **Deploy to Modal**
34+
1. **Deploy to Modal**
3535

3636
Deploy the application to Modal by running:
3737

@@ -48,7 +48,6 @@ Before you begin, ensure you have the following installed and configured:
4848
- `.env.template` and `.env`: Environment variable templates and configurations.
4949
- `pyproject.toml`: Project configuration and dependencies.
5050

51-
5251
## Integration
5352

54-
Once deployed, you can use the deployed web_url as the webhook endpoint for your slack, linear, or github webhooks.
53+
Once deployed, you can use the deployed web_url as the webhook endpoint for your slack, linear, or github webhooks.

codegen-examples/examples/swebench_agent_run/local_run.ipynb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@
3232
"metadata": {},
3333
"outputs": [],
3434
"source": [
35-
"await run_eval(use_existing_preds=None, dataset=\"lite\", length=5, repo=\"django/django\", num_workers=10, model=\"claude-3-7-sonnet-latest\")"
35+
"await run_eval(\n",
36+
" use_existing_preds=None,\n",
37+
" dataset=\"lite\",\n",
38+
" length=5,\n",
39+
" repo=\"django/django\",\n",
40+
" num_workers=10,\n",
41+
" model=\"claude-3-7-sonnet-latest\",\n",
42+
")"
3643
]
3744
},
3845
{
@@ -76,7 +83,12 @@
7683
"source": [
7784
"from codegen.agents.code_agent import CodeAgent\n",
7885
"\n",
79-
"agent = CodeAgent(codebase=codebase, tags=[\"local_test\"], model_name=\"claude-3-5-sonnet-latest\", model_provider=\"anthropic\")"
86+
"agent = CodeAgent(\n",
87+
" codebase=codebase,\n",
88+
" tags=[\"local_test\"],\n",
89+
" model_name=\"claude-3-5-sonnet-latest\",\n",
90+
" model_provider=\"anthropic\",\n",
91+
")"
8092
]
8193
},
8294
{

codegen-on-oss/codegen_on_oss/analyzers/README.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ analyzers/
2525
### 1. API Interface (`api.py`)
2626

2727
The main entry point for frontend applications. Provides REST-like endpoints for:
28+
2829
- Codebase analysis
2930
- PR analysis
3031
- Dependency visualization
@@ -34,6 +35,7 @@ The main entry point for frontend applications. Provides REST-like endpoints for
3435
### 2. Analyzer System (`analyzer.py`)
3536

3637
Plugin-based system that coordinates different types of analysis:
38+
3739
- Code quality analysis (complexity, maintainability)
3840
- Dependency analysis (imports, cycles, coupling)
3941
- PR impact analysis
@@ -42,6 +44,7 @@ Plugin-based system that coordinates different types of analysis:
4244
### 3. Issue Tracking (`issues.py`)
4345

4446
Comprehensive issue model with:
47+
4548
- Severity levels (critical, error, warning, info)
4649
- Categories (dead code, complexity, dependency, etc.)
4750
- Location information and suggestions
@@ -50,6 +53,7 @@ Comprehensive issue model with:
5053
### 4. Dependency Analysis (`dependencies.py`)
5154

5255
Analysis of codebase dependencies:
56+
5357
- Import dependencies between modules
5458
- Circular dependency detection
5559
- Module coupling analysis
@@ -59,6 +63,7 @@ Analysis of codebase dependencies:
5963
### 5. Code Quality Analysis (`code_quality.py`)
6064

6165
Analysis of code quality aspects:
66+
6267
- Dead code detection (unused functions, variables)
6368
- Complexity metrics (cyclomatic, cognitive)
6469
- Parameter checking (types, usage)
@@ -121,11 +126,7 @@ dependency_issues = api.get_issues(category="dependency_cycle")
121126
module_deps = api.get_module_dependencies(format="json")
122127

123128
# Get function call graph
124-
call_graph = api.get_function_call_graph(
125-
function_name="main",
126-
depth=3,
127-
format="json"
128-
)
129+
call_graph = api.get_function_call_graph(function_name="main", depth=3, format="json")
129130

130131
# Export visualization to file
131132
api.export_visualization(call_graph, format="html", filename="call_graph.html")
@@ -197,52 +198,42 @@ For a web application exposing these endpoints with Flask:
197198

198199
```python
199200
from flask import Flask, request, jsonify
200-
from codegen_on_oss.analyzers.api import (
201-
api_analyze_codebase,
202-
api_analyze_pr,
203-
api_get_visualization,
204-
api_get_static_errors
205-
)
201+
from codegen_on_oss.analyzers.api import api_analyze_codebase, api_analyze_pr, api_get_visualization, api_get_static_errors
206202

207203
app = Flask(__name__)
208204

205+
209206
@app.route("/api/analyze/codebase", methods=["POST"])
210207
def analyze_codebase():
211208
data = request.json
212-
result = api_analyze_codebase(
213-
repo_path=data.get("repo_path"),
214-
analysis_types=data.get("analysis_types")
215-
)
209+
result = api_analyze_codebase(repo_path=data.get("repo_path"), analysis_types=data.get("analysis_types"))
216210
return jsonify(result)
217211

212+
218213
@app.route("/api/analyze/pr", methods=["POST"])
219214
def analyze_pr():
220215
data = request.json
221-
result = api_analyze_pr(
222-
repo_path=data.get("repo_path"),
223-
pr_number=data.get("pr_number")
224-
)
216+
result = api_analyze_pr(repo_path=data.get("repo_path"), pr_number=data.get("pr_number"))
225217
return jsonify(result)
226218

219+
227220
@app.route("/api/visualize", methods=["POST"])
228221
def visualize():
229222
data = request.json
230-
result = api_get_visualization(
231-
repo_path=data.get("repo_path"),
232-
viz_type=data.get("viz_type"),
233-
params=data.get("params", {})
234-
)
223+
result = api_get_visualization(repo_path=data.get("repo_path"), viz_type=data.get("viz_type"), params=data.get("params", {}))
235224
return jsonify(result)
236225

226+
237227
@app.route("/api/issues", methods=["GET"])
238228
def get_issues():
239229
repo_path = request.args.get("repo_path")
240230
severity = request.args.get("severity")
241231
category = request.args.get("category")
242-
232+
243233
api = create_api(repo_path=repo_path)
244234
return jsonify(api.get_issues(severity=severity, category=category))
245235

236+
246237
if __name__ == "__main__":
247238
app.run(debug=True)
248-
```
239+
```

0 commit comments

Comments
 (0)