Skip to content

Commit 91bee8b

Browse files
authored
Merge pull request #4 from alpsla/clean_push_candidate
Clean push candidate
2 parents 5031ac6 + 27d3d61 commit 91bee8b

3,162 files changed

Lines changed: 350508 additions & 717 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ jobs:
1717
uses: actions/setup-node@v3
1818
with:
1919
node-version: '18.x'
20-
cache: 'npm'
20+
# Disable npm caching to avoid ENOWORKSPACES error
21+
# cache: 'npm'
2122

2223
- name: Install dependencies
23-
run: npm ci
24+
run: npm ci --no-workspaces
2425

2526
- name: Create .env file
2627
run: |
@@ -47,10 +48,10 @@ jobs:
4748
EOF
4849
4950
- name: Lint
50-
run: npm run lint
51+
run: npm run lint --no-workspaces
5152

5253
- name: Build
53-
run: npm run build
54+
run: npm run build --no-workspaces
5455

5556
- name: Test
56-
run: npm run test
57+
run: npm run test --no-workspaces

README.md

Lines changed: 24 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,45 @@
11
# CodeQual
22

3-
CodeQual is an intelligent code review system that analyzes pull requests, educates developers based on identified issues, and tracks individual and team growth over time.
3+
A comprehensive code quality analysis system powered by AI.
44

5-
## Overview
5+
## Directory Structure
66

7-
CodeQual uses a flexible, adaptive multi-agent architecture to provide:
7+
- `/scripts`: Core scripts for repository analysis and testing
8+
- `/reports`: Generated analysis reports (timestamped)
9+
- `/docs`: Documentation and guides
10+
- `/archive`: Archived files from previous versions
811

9-
- Code quality analysis
10-
- Security vulnerability detection
11-
- Performance optimization suggestions
12-
- Educational content tailored to developers
13-
- Skill tracking and professional growth insights
12+
## Getting Started
1413

15-
## Features
16-
17-
- **Two-Tier Analysis**: Choose between quick (1-3 minutes) or comprehensive (5-10 minutes) analysis
18-
- **Multi-Agent Architecture**: Uses several AI models to provide the best analysis for each context
19-
- **Repository Analysis Caching**: Stores deep repository analysis for efficient reuse
20-
- **Skills Tracking**: Monitors developer growth across various skill categories
21-
- **Visualization**: Grafana dashboards for insight visualization
22-
23-
## Installation
24-
25-
1. Clone the repository
26-
```bash
27-
git clone https://github.com/your-username/codequal.git
28-
cd codequal
29-
```
30-
31-
2. Install dependencies
14+
1. Run a quick test to verify the integration is working:
3215
```bash
33-
npm install
16+
./scripts/quick_test.sh
3417
```
3518

36-
3. Set up environment variables
19+
2. Analyze a repository:
3720
```bash
38-
cp .env.sample .env
39-
# Edit .env with your Supabase and API credentials
21+
./scripts/analyze_repository.sh <repository_url> [model_name]
4022
```
41-
42-
4. Set up the database
23+
24+
3. View the latest report:
4325
```bash
44-
./scripts/make-scripts-executable.sh
45-
./scripts/migrate-database.sh
26+
open ./reports/latest/comprehensive_analysis.md
4627
```
4728

48-
## Environment Variables
49-
50-
CodeQual requires the following environment variables:
29+
## Documentation
5130

52-
| Variable | Description | Required |
53-
|----------|-------------|----------|
54-
| SUPABASE_URL | URL for your Supabase project | Yes |
55-
| SUPABASE_SERVICE_ROLE_KEY | Service role key for Supabase | Yes |
56-
| PUBLIC_SUPABASE_ANON_KEY | Anonymous key for Supabase | No |
57-
| GITHUB_TOKEN | GitHub API token | No* |
58-
| OPENAI_API_KEY | OpenAI API key for GPT models | No* |
59-
| ANTHROPIC_API_KEY | Anthropic API key for Claude models | No* |
60-
| DEEPSEEK_API_KEY | DeepSeek API key | No* |
61-
| GEMINI_API_KEY | Google Gemini API key | No* |
31+
For detailed documentation, see:
6232

63-
\* At least one model API key is required for functionality.
64-
65-
For local development, create a `.env` file in the project root with these variables. For production, set them in your deployment environment.
66-
67-
## Usage
68-
69-
```bash
70-
# Start the CLI
71-
npm run cli
72-
73-
# Run analysis on a PR
74-
codequal analyze-pr --repo owner/repo --pr 123 --mode quick
75-
```
33+
- [Repository Analysis Guide](./docs/guides/repository_analysis.md)
7634

7735
## Architecture
7836

79-
The project uses a TypeScript monorepo structure with the following packages:
80-
81-
- `agents`: AI agent integrations and orchestration
82-
- `cli`: Command-line interface
83-
- `core`: Core types and utilities
84-
- `database`: Database models and Supabase integration
85-
- `testing`: Testing utilities and test repositories
86-
- `ui`: User interface components
87-
88-
## Contributing
89-
90-
1. Fork the repository
91-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
92-
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
93-
4. Push to the branch (`git push origin feature/amazing-feature`)
94-
5. Open a Pull Request
37+
CodeQual uses a multi-agent approach with fallback capabilities to analyze repositories across multiple dimensions:
9538

96-
## License
39+
- Architecture
40+
- Code Quality
41+
- Security
42+
- Dependencies
43+
- Performance
9744

98-
This project is licensed under the MIT License - see the LICENSE file for details.
45+
Each analysis produces a score from 1-10, which are combined to create an overall repository score.

apps/api/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,12 @@
1111
"keywords": [],
1212
"author": "",
1313
"license": "ISC",
14-
"description": ""
14+
"description": "",
15+
"dependencies": {
16+
"axios": "^1.9.0",
17+
"dotenv": "^16.5.0"
18+
},
19+
"devDependencies": {
20+
"@types/dotenv": "^6.1.1"
21+
}
1522
}

apps/api/src/pages/api/pr-review.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextApiRequest, NextApiResponse } from 'next';
2-
import { PRReviewService } from '@pr-reviewer/core/services/pr-review-service';
3-
import { DEFAULT_AGENTS } from '@pr-reviewer/core/config/agent-registry';
2+
import { PRReviewService } from '@codequal/core/services/pr-review-service';
3+
import { DEFAULT_AGENTS } from '@codequal/core/config/agent-registry';
44

55
/**
66
* API endpoint for PR review
@@ -44,8 +44,9 @@ export default async function handler(
4444
suggestions: result.combinedResult.suggestions.length,
4545
educational: result.combinedResult.educational?.length || 0
4646
});
47-
} catch (error: any) {
47+
} catch (error: unknown) {
4848
console.error('Error handling PR review request:', error);
49-
return res.status(500).json({ error: error.message });
49+
const errorMessage = error instanceof Error ? error.message : String(error);
50+
return res.status(500).json({ error: errorMessage });
5051
}
5152
}

apps/api/tsconfig.tsbuildinfo

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

apps/web/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,12 @@
1111
"keywords": [],
1212
"author": "",
1313
"license": "ISC",
14-
"description": ""
14+
"description": "",
15+
"dependencies": {
16+
"axios": "^1.9.0",
17+
"dotenv": "^16.5.0"
18+
},
19+
"devDependencies": {
20+
"@types/dotenv": "^6.1.1"
21+
}
1522
}

apps/web/src/components/pr-review/pr-review-form.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function PRReviewForm() {
2525
}
2626

2727
// GitHub or GitLab PR URL validation
28-
const validUrl = /https:\/\/(github|gitlab)\.com\/[^\/]+\/[^\/]+(\/pull\/\d+|\/\-\/merge_requests\/\d+)/;
28+
const validUrl = /https:\/\/(github|gitlab)\.com\/[^/]+\/[^/]+(\/pull\/\d+|\/merge_requests\/\d+)/;
2929
if (!validUrl.test(prUrl)) {
3030
setError('Invalid PR URL. Must be a GitHub or GitLab PR URL.');
3131
return;
@@ -65,8 +65,9 @@ export function PRReviewForm() {
6565

6666
// Redirect to results page
6767
router.push(`/results/${result.prReviewId}`);
68-
} catch (error: any) {
69-
setError(error.message);
68+
} catch (error: unknown) {
69+
const errorMessage = error instanceof Error ? error.message : String(error);
70+
setError(errorMessage);
7071
} finally {
7172
setIsSubmitting(false);
7273
}

archive/api_endpoints.txt

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
API Endpoints:
2+
GET /models/config
3+
Description: Get available model providers and their models.
4+
5+
This endpoint returns the configuration of available model providers and their
6+
respective models that can be used throughout the application.
7+
8+
Returns:
9+
ModelConfig: A configuration object containing providers and their models
10+
Parameters: []
11+
12+
POST /export/wiki
13+
Description: Export wiki content as Markdown or JSON.
14+
15+
Args:
16+
request: The export request containing wiki pages and format
17+
18+
Returns:
19+
A downloadable file in the requested format
20+
Parameters: []
21+
22+
GET /local_repo/structure
23+
Description: Return the file tree and README content for a local repository.
24+
Parameters: [
25+
{
26+
"name": "path",
27+
"in": "query",
28+
"required": false,
29+
"schema": {
30+
"type": "string",
31+
"description": "Path to local repository",
32+
"title": "Path"
33+
},
34+
"description": "Path to local repository"
35+
}
36+
]
37+
38+
POST /chat/completions/stream
39+
Description: Stream a chat completion response directly using Google Generative AI
40+
Parameters: []
41+
42+
GET /api/wiki_cache
43+
Description: Retrieves cached wiki data (structure and generated pages) for a repository.
44+
Parameters: [
45+
{
46+
"name": "owner",
47+
"in": "query",
48+
"required": true,
49+
"schema": {
50+
"type": "string",
51+
"description": "Repository owner",
52+
"title": "Owner"
53+
},
54+
"description": "Repository owner"
55+
},
56+
{
57+
"name": "repo",
58+
"in": "query",
59+
"required": true,
60+
"schema": {
61+
"type": "string",
62+
"description": "Repository name",
63+
"title": "Repo"
64+
},
65+
"description": "Repository name"
66+
},
67+
{
68+
"name": "repo_type",
69+
"in": "query",
70+
"required": true,
71+
"schema": {
72+
"type": "string",
73+
"description": "Repository type (e.g., github, gitlab)",
74+
"title": "Repo Type"
75+
},
76+
"description": "Repository type (e.g., github, gitlab)"
77+
},
78+
{
79+
"name": "language",
80+
"in": "query",
81+
"required": true,
82+
"schema": {
83+
"type": "string",
84+
"description": "Language of the wiki content",
85+
"title": "Language"
86+
},
87+
"description": "Language of the wiki content"
88+
}
89+
]
90+
91+
POST /api/wiki_cache
92+
Description: Stores generated wiki data (structure and pages) to the server-side cache.
93+
Parameters: []
94+
95+
DELETE /api/wiki_cache
96+
Description: Deletes a specific wiki cache from the file system.
97+
Parameters: [
98+
{
99+
"name": "owner",
100+
"in": "query",
101+
"required": true,
102+
"schema": {
103+
"type": "string",
104+
"description": "Repository owner",
105+
"title": "Owner"
106+
},
107+
"description": "Repository owner"
108+
},
109+
{
110+
"name": "repo",
111+
"in": "query",
112+
"required": true,
113+
"schema": {
114+
"type": "string",
115+
"description": "Repository name",
116+
"title": "Repo"
117+
},
118+
"description": "Repository name"
119+
},
120+
{
121+
"name": "repo_type",
122+
"in": "query",
123+
"required": true,
124+
"schema": {
125+
"type": "string",
126+
"description": "Repository type (e.g., github, gitlab)",
127+
"title": "Repo Type"
128+
},
129+
"description": "Repository type (e.g., github, gitlab)"
130+
},
131+
{
132+
"name": "language",
133+
"in": "query",
134+
"required": true,
135+
"schema": {
136+
"type": "string",
137+
"description": "Language of the wiki content",
138+
"title": "Language"
139+
},
140+
"description": "Language of the wiki content"
141+
}
142+
]
143+
144+
GET /
145+
Description: Root endpoint to check if the API is running
146+
Parameters: []
147+
148+
GET /api/processed_projects
149+
Description: Lists all processed projects found in the wiki cache directory.
150+
Projects are identified by files named like: deepwiki_cache_{repo_type}_{owner}_{repo}_{language}.json
151+
Parameters: []
152+

0 commit comments

Comments
 (0)