atlas-pipeline-mcp 1.0.19 → 1.0.21
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.
- package/dist/mcp.js +191 -0
- package/dist/mcp.js.map +1 -1
- package/dist/tools/context.d.ts +33 -7
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +167 -82
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/dashboard.d.ts +107 -0
- package/dist/tools/dashboard.d.ts.map +1 -0
- package/dist/tools/dashboard.js +544 -0
- package/dist/tools/dashboard.js.map +1 -0
- package/dist/tools/dependencies.d.ts +105 -0
- package/dist/tools/dependencies.d.ts.map +1 -0
- package/dist/tools/dependencies.js +410 -0
- package/dist/tools/dependencies.js.map +1 -0
- package/dist/tools/git.d.ts +27 -4
- package/dist/tools/git.d.ts.map +1 -1
- package/dist/tools/git.js +156 -59
- package/dist/tools/git.js.map +1 -1
- package/dist/tools/profiler.d.ts +83 -0
- package/dist/tools/profiler.d.ts.map +1 -0
- package/dist/tools/profiler.js +385 -0
- package/dist/tools/profiler.js.map +1 -0
- package/dist/tools/refactor.d.ts +63 -0
- package/dist/tools/refactor.d.ts.map +1 -0
- package/dist/tools/refactor.js +308 -0
- package/dist/tools/refactor.js.map +1 -0
- package/dist/tools/resource-manager.d.ts +167 -0
- package/dist/tools/resource-manager.d.ts.map +1 -0
- package/dist/tools/resource-manager.js +352 -0
- package/dist/tools/resource-manager.js.map +1 -0
- package/dist/tools/review.d.ts +98 -0
- package/dist/tools/review.d.ts.map +1 -0
- package/dist/tools/review.js +428 -0
- package/dist/tools/review.js.map +1 -0
- package/dist/tools/test-utils.d.ts +170 -0
- package/dist/tools/test-utils.d.ts.map +1 -0
- package/dist/tools/test-utils.js +490 -0
- package/dist/tools/test-utils.js.map +1 -0
- package/dist/tools/validation.d.ts +237 -0
- package/dist/tools/validation.d.ts.map +1 -0
- package/dist/tools/validation.js +323 -0
- package/dist/tools/validation.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas Server - AI Code Review Assistant
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive AI-powered code review capabilities:
|
|
5
|
+
* - Multi-dimensional code quality analysis
|
|
6
|
+
* - Best practices enforcement
|
|
7
|
+
* - Architectural pattern validation
|
|
8
|
+
* - Security vulnerability detection
|
|
9
|
+
* - Performance optimization suggestions
|
|
10
|
+
* - Test coverage recommendations
|
|
11
|
+
* - Documentation quality assessment
|
|
12
|
+
* - Team coding standards compliance
|
|
13
|
+
*
|
|
14
|
+
* @module review
|
|
15
|
+
* @author Nishant Unavane
|
|
16
|
+
* @version 1.0.0
|
|
17
|
+
*/
|
|
18
|
+
import { getActiveProvider, isNoLLMMode } from '../providers/index.js';
|
|
19
|
+
import { logger, createTimer } from '../utils.js';
|
|
20
|
+
import { z } from 'zod';
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// Validation Schema
|
|
23
|
+
// ============================================================================
|
|
24
|
+
const CodeReviewOptionsSchema = z.object({
|
|
25
|
+
code: z.string().min(1).max(500000),
|
|
26
|
+
language: z.string().min(1),
|
|
27
|
+
filePath: z.string().optional(),
|
|
28
|
+
checkQuality: z.boolean().optional(),
|
|
29
|
+
checkSecurity: z.boolean().optional(),
|
|
30
|
+
checkPerformance: z.boolean().optional(),
|
|
31
|
+
checkArchitecture: z.boolean().optional(),
|
|
32
|
+
checkTests: z.boolean().optional(),
|
|
33
|
+
checkDocumentation: z.boolean().optional(),
|
|
34
|
+
framework: z.string().optional(),
|
|
35
|
+
teamStandards: z.string().optional(),
|
|
36
|
+
pullRequestContext: z.string().optional(),
|
|
37
|
+
changedFiles: z.array(z.string()).optional(),
|
|
38
|
+
});
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Static Analysis
|
|
41
|
+
// ============================================================================
|
|
42
|
+
/**
|
|
43
|
+
* Calculate quality metrics from code
|
|
44
|
+
*/
|
|
45
|
+
function calculateQualityMetrics(code, language) {
|
|
46
|
+
const lines = code.split('\n');
|
|
47
|
+
const codeLines = lines.filter(l => {
|
|
48
|
+
const trimmed = l.trim();
|
|
49
|
+
return trimmed.length > 0 && !trimmed.startsWith('//') && !trimmed.startsWith('/*') && !trimmed.startsWith('*') && !trimmed.startsWith('#');
|
|
50
|
+
});
|
|
51
|
+
const commentLines = lines.filter(l => {
|
|
52
|
+
const trimmed = l.trim();
|
|
53
|
+
return trimmed.startsWith('//') || trimmed.startsWith('/*') || trimmed.startsWith('*') || trimmed.startsWith('#');
|
|
54
|
+
});
|
|
55
|
+
const blankLines = lines.filter(l => l.trim().length === 0);
|
|
56
|
+
// Calculate average complexity (simplified)
|
|
57
|
+
const decisionPoints = (code.match(/\b(if|else|for|while|case|catch|\?|&&|\|\|)\b/g) || []).length;
|
|
58
|
+
const functions = (code.match(/\b(function|def|fn|func)\s+\w+/g) || []).length || 1;
|
|
59
|
+
const averageComplexity = decisionPoints / functions;
|
|
60
|
+
// Detect duplicated code (very simplified - just looks for repeated lines)
|
|
61
|
+
const lineSet = new Set(codeLines.map(l => l.trim()));
|
|
62
|
+
const duplicatedCodeRatio = 1 - (lineSet.size / (codeLines.length || 1));
|
|
63
|
+
// Check documentation coverage (count documented functions vs total)
|
|
64
|
+
const totalFunctions = (code.match(/\b(function|def|fn|func|class|interface)\s+\w+/g) || []).length;
|
|
65
|
+
const documentedFunctions = (code.match(/\/\*\*[\s\S]*?\*\/\s*(?:export\s+)?(?:async\s+)?(?:function|class|interface)\s+\w+/g) || []).length;
|
|
66
|
+
const documentationCoverage = totalFunctions > 0 ? documentedFunctions / totalFunctions : 0;
|
|
67
|
+
return {
|
|
68
|
+
totalLines: lines.length,
|
|
69
|
+
codeLines: codeLines.length,
|
|
70
|
+
commentLines: commentLines.length,
|
|
71
|
+
blankLines: blankLines.length,
|
|
72
|
+
commentRatio: commentLines.length / (codeLines.length || 1),
|
|
73
|
+
averageComplexity,
|
|
74
|
+
duplicatedCodeRatio,
|
|
75
|
+
documentationCoverage,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Detect common code issues automatically
|
|
80
|
+
*/
|
|
81
|
+
function detectIssues(code, language) {
|
|
82
|
+
const findings = [];
|
|
83
|
+
// Security: SQL Injection risk
|
|
84
|
+
if (code.match(/\bquery\s*\+\s*\w+|SELECT.*\+|sql\s*=\s*['"`].*\+/i)) {
|
|
85
|
+
findings.push({
|
|
86
|
+
severity: 'critical',
|
|
87
|
+
category: 'security',
|
|
88
|
+
title: 'Potential SQL Injection',
|
|
89
|
+
description: 'String concatenation detected in SQL queries',
|
|
90
|
+
suggestion: 'Use parameterized queries or prepared statements',
|
|
91
|
+
autoFixable: false,
|
|
92
|
+
references: ['https://owasp.org/www-community/attacks/SQL_Injection'],
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Security: Eval usage
|
|
96
|
+
if (code.match(/\beval\s*\(/)) {
|
|
97
|
+
findings.push({
|
|
98
|
+
severity: 'critical',
|
|
99
|
+
category: 'security',
|
|
100
|
+
title: 'Dangerous eval() usage',
|
|
101
|
+
description: 'eval() can execute arbitrary code and is a security risk',
|
|
102
|
+
suggestion: 'Avoid eval() - use safer alternatives like JSON.parse() or Function constructor',
|
|
103
|
+
autoFixable: false,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
// Performance: Console.log in production
|
|
107
|
+
if (code.match(/console\.(log|debug|info)/)) {
|
|
108
|
+
findings.push({
|
|
109
|
+
severity: 'minor',
|
|
110
|
+
category: 'performance',
|
|
111
|
+
title: 'Console logging in code',
|
|
112
|
+
description: 'Console statements can impact performance in production',
|
|
113
|
+
suggestion: 'Use a proper logger with log levels or remove before production',
|
|
114
|
+
autoFixable: true,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
// Correctness: Comparison with ==
|
|
118
|
+
if (language === 'javascript' || language === 'typescript') {
|
|
119
|
+
if (code.match(/[^=!]={2}[^=]/)) {
|
|
120
|
+
findings.push({
|
|
121
|
+
severity: 'minor',
|
|
122
|
+
category: 'best-practices',
|
|
123
|
+
title: 'Loose equality (==) instead of strict equality (===)',
|
|
124
|
+
description: 'Using == can lead to unexpected type coercion',
|
|
125
|
+
suggestion: 'Use === for strict equality checks',
|
|
126
|
+
autoFixable: true,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Maintainability: Magic numbers
|
|
131
|
+
const magicNumbers = code.match(/\b\d{3,}\b/g) || [];
|
|
132
|
+
if (magicNumbers.length > 5) {
|
|
133
|
+
findings.push({
|
|
134
|
+
severity: 'minor',
|
|
135
|
+
category: 'maintainability',
|
|
136
|
+
title: 'Too many magic numbers',
|
|
137
|
+
description: `${magicNumbers.length} numeric literals found without explanation`,
|
|
138
|
+
suggestion: 'Extract magic numbers to named constants',
|
|
139
|
+
autoFixable: false,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Reliability: Missing error handling
|
|
143
|
+
if (code.match(/\bawait\s+\w+/) && !code.match(/try\s*{[\s\S]*}catch/)) {
|
|
144
|
+
findings.push({
|
|
145
|
+
severity: 'major',
|
|
146
|
+
category: 'reliability',
|
|
147
|
+
title: 'Missing error handling for async code',
|
|
148
|
+
description: 'Async operations without try-catch can cause unhandled rejections',
|
|
149
|
+
suggestion: 'Wrap async code in try-catch blocks',
|
|
150
|
+
autoFixable: false,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// Architecture: God function
|
|
154
|
+
const functionBodies = code.match(/(?:function|def|fn)\s+\w+[^{]*{([^}]{1000,})}/gs) || [];
|
|
155
|
+
if (functionBodies.length > 0) {
|
|
156
|
+
findings.push({
|
|
157
|
+
severity: 'major',
|
|
158
|
+
category: 'architecture',
|
|
159
|
+
title: 'Overly long function(s)',
|
|
160
|
+
description: `${functionBodies.length} function(s) exceed 50 lines`,
|
|
161
|
+
suggestion: 'Break down large functions into smaller, focused ones',
|
|
162
|
+
autoFixable: false,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
// Documentation: Missing JSDoc
|
|
166
|
+
const publicFunctions = (code.match(/\bexport\s+(?:async\s+)?function\s+\w+/g) || []).length;
|
|
167
|
+
const documentedExports = (code.match(/\/\*\*[\s\S]*?\*\/\s*export\s+(?:async\s+)?function\s+\w+/g) || []).length;
|
|
168
|
+
if (publicFunctions > documentedExports && publicFunctions > 0) {
|
|
169
|
+
findings.push({
|
|
170
|
+
severity: 'minor',
|
|
171
|
+
category: 'documentation',
|
|
172
|
+
title: 'Missing documentation for public APIs',
|
|
173
|
+
description: `${publicFunctions - documentedExports} exported functions lack documentation`,
|
|
174
|
+
suggestion: 'Add JSDoc comments to all public functions',
|
|
175
|
+
autoFixable: false,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return findings;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Calculate grade from score
|
|
182
|
+
*/
|
|
183
|
+
function scoreToGrade(score) {
|
|
184
|
+
if (score >= 97)
|
|
185
|
+
return 'A+';
|
|
186
|
+
if (score >= 90)
|
|
187
|
+
return 'A';
|
|
188
|
+
if (score >= 80)
|
|
189
|
+
return 'B';
|
|
190
|
+
if (score >= 70)
|
|
191
|
+
return 'C';
|
|
192
|
+
if (score >= 60)
|
|
193
|
+
return 'D';
|
|
194
|
+
return 'F';
|
|
195
|
+
}
|
|
196
|
+
// ============================================================================
|
|
197
|
+
// Main Review Function
|
|
198
|
+
// ============================================================================
|
|
199
|
+
/**
|
|
200
|
+
* Comprehensive AI-powered code review
|
|
201
|
+
*/
|
|
202
|
+
export async function reviewCode(options) {
|
|
203
|
+
const timer = createTimer();
|
|
204
|
+
const { code, language, filePath, checkQuality = true, checkSecurity = true, checkPerformance = true, checkArchitecture = true, checkTests = false, checkDocumentation = true, framework, teamStandards, pullRequestContext, } = CodeReviewOptionsSchema.parse(options);
|
|
205
|
+
logger.info({ language, filePath }, 'Starting code review');
|
|
206
|
+
const warnings = [];
|
|
207
|
+
// Static analysis
|
|
208
|
+
const metrics = calculateQualityMetrics(code, language);
|
|
209
|
+
const staticFindings = detectIssues(code, language);
|
|
210
|
+
// Build review prompt
|
|
211
|
+
const aspects = [];
|
|
212
|
+
if (checkQuality)
|
|
213
|
+
aspects.push('code quality');
|
|
214
|
+
if (checkSecurity)
|
|
215
|
+
aspects.push('security vulnerabilities');
|
|
216
|
+
if (checkPerformance)
|
|
217
|
+
aspects.push('performance optimization');
|
|
218
|
+
if (checkArchitecture)
|
|
219
|
+
aspects.push('architecture and design patterns');
|
|
220
|
+
if (checkTests)
|
|
221
|
+
aspects.push('test coverage and quality');
|
|
222
|
+
if (checkDocumentation)
|
|
223
|
+
aspects.push('documentation quality');
|
|
224
|
+
const prompt = `You are a senior code reviewer with 50 years of experience conducting PR reviews. Review this ${language} code.
|
|
225
|
+
|
|
226
|
+
**Code:**
|
|
227
|
+
\`\`\`${language}
|
|
228
|
+
${code}
|
|
229
|
+
\`\`\`
|
|
230
|
+
|
|
231
|
+
**Context:**
|
|
232
|
+
${filePath ? `- File: ${filePath}` : ''}
|
|
233
|
+
${framework ? `- Framework: ${framework}` : ''}
|
|
234
|
+
${pullRequestContext ? `- PR Context: ${pullRequestContext}` : ''}
|
|
235
|
+
${teamStandards ? `- Team Standards:\n${teamStandards}` : ''}
|
|
236
|
+
|
|
237
|
+
**Metrics:**
|
|
238
|
+
- Total Lines: ${metrics.totalLines}
|
|
239
|
+
- Code Lines: ${metrics.codeLines}
|
|
240
|
+
- Comment Ratio: ${(metrics.commentRatio * 100).toFixed(1)}%
|
|
241
|
+
- Average Complexity: ${metrics.averageComplexity.toFixed(1)}
|
|
242
|
+
- Documentation Coverage: ${(metrics.documentationCoverage * 100).toFixed(1)}%
|
|
243
|
+
|
|
244
|
+
**Review Focus:** ${aspects.join(', ')}
|
|
245
|
+
|
|
246
|
+
**Static Analysis Findings:** ${staticFindings.length} issues detected
|
|
247
|
+
|
|
248
|
+
**Instructions:**
|
|
249
|
+
Provide a comprehensive code review covering:
|
|
250
|
+
1. **Quality** (readability, maintainability, complexity)
|
|
251
|
+
2. **Security** (vulnerabilities, input validation, auth)
|
|
252
|
+
3. **Performance** (algorithmic efficiency, resource usage)
|
|
253
|
+
4. **Architecture** (design patterns, separation of concerns)
|
|
254
|
+
5. **Testing** (testability, edge cases)
|
|
255
|
+
6. **Documentation** (clarity, completeness)
|
|
256
|
+
|
|
257
|
+
For each aspect, provide:
|
|
258
|
+
- Score (0-100)
|
|
259
|
+
- Key strengths
|
|
260
|
+
- Key weaknesses
|
|
261
|
+
- Specific findings with severity
|
|
262
|
+
|
|
263
|
+
**Format your response as:**
|
|
264
|
+
|
|
265
|
+
QUALITY: [score]
|
|
266
|
+
Strengths: [strength 1], [strength 2]
|
|
267
|
+
Weaknesses: [weakness 1], [weakness 2]
|
|
268
|
+
|
|
269
|
+
SECURITY: [score]
|
|
270
|
+
Strengths: [strength 1]
|
|
271
|
+
Weaknesses: [weakness 1]
|
|
272
|
+
|
|
273
|
+
PERFORMANCE: [score]
|
|
274
|
+
Strengths: [strength 1]
|
|
275
|
+
Weaknesses: [weakness 1]
|
|
276
|
+
|
|
277
|
+
ARCHITECTURE: [score]
|
|
278
|
+
Strengths: [strength 1]
|
|
279
|
+
Weaknesses: [weakness 1]
|
|
280
|
+
|
|
281
|
+
TESTS: [score]
|
|
282
|
+
Strengths: [strength 1]
|
|
283
|
+
Weaknesses: [weakness 1]
|
|
284
|
+
|
|
285
|
+
DOCUMENTATION: [score]
|
|
286
|
+
Strengths: [strength 1]
|
|
287
|
+
Weaknesses: [weakness 1]
|
|
288
|
+
|
|
289
|
+
FINDINGS:
|
|
290
|
+
- [SEVERITY] [CATEGORY]: [description] - Suggestion: [fix]
|
|
291
|
+
...
|
|
292
|
+
|
|
293
|
+
SUMMARY:
|
|
294
|
+
[2-3 sentence overall assessment]`;
|
|
295
|
+
let allFindings = [...staticFindings];
|
|
296
|
+
let suggestions = [];
|
|
297
|
+
let grades = {
|
|
298
|
+
quality: { score: 70, letter: 'C', issues: 0, strengths: [], weaknesses: [] },
|
|
299
|
+
security: { score: 70, letter: 'C', issues: 0, strengths: [], weaknesses: [] },
|
|
300
|
+
performance: { score: 70, letter: 'C', issues: 0, strengths: [], weaknesses: [] },
|
|
301
|
+
architecture: { score: 70, letter: 'C', issues: 0, strengths: [], weaknesses: [] },
|
|
302
|
+
tests: { score: 0, letter: 'F', issues: 0, strengths: [], weaknesses: [] },
|
|
303
|
+
documentation: { score: Math.round(metrics.documentationCoverage * 100), letter: scoreToGrade(metrics.documentationCoverage * 100), issues: 0, strengths: [], weaknesses: [] },
|
|
304
|
+
};
|
|
305
|
+
let summary = 'Code review completed with static analysis only.';
|
|
306
|
+
if (isNoLLMMode()) {
|
|
307
|
+
warnings.push('No LLM provider - using static analysis only');
|
|
308
|
+
summary = `Static analysis detected ${staticFindings.length} issues. Install an LLM provider for comprehensive AI-powered review.`;
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
const provider = await getActiveProvider();
|
|
312
|
+
try {
|
|
313
|
+
const response = await provider.complete(prompt, {
|
|
314
|
+
maxTokens: 3000,
|
|
315
|
+
temperature: 0.3,
|
|
316
|
+
});
|
|
317
|
+
const responseText = response.text;
|
|
318
|
+
// Parse grades
|
|
319
|
+
const gradePattern = /(\w+):\s*(\d+)\s*Strengths:\s*([^\n]+)\s*Weaknesses:\s*([^\n]+)/gi;
|
|
320
|
+
let match;
|
|
321
|
+
while ((match = gradePattern.exec(responseText)) !== null) {
|
|
322
|
+
const aspect = match[1]?.toLowerCase() || '';
|
|
323
|
+
const score = parseInt(match[2] || '70');
|
|
324
|
+
const strengths = (match[3] || '').split(',').map(s => s.trim()).filter(Boolean);
|
|
325
|
+
const weaknesses = (match[4] || '').split(',').map(s => s.trim()).filter(Boolean);
|
|
326
|
+
const grade = {
|
|
327
|
+
score,
|
|
328
|
+
letter: scoreToGrade(score),
|
|
329
|
+
issues: weaknesses.length,
|
|
330
|
+
strengths,
|
|
331
|
+
weaknesses,
|
|
332
|
+
};
|
|
333
|
+
if (aspect in grades) {
|
|
334
|
+
grades[aspect] = grade;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
// Parse findings
|
|
338
|
+
const findingsSection = responseText.match(/FINDINGS:\s*([\s\S]*?)(?:SUMMARY:|$)/i);
|
|
339
|
+
if (findingsSection && findingsSection[1]) {
|
|
340
|
+
const findingLines = findingsSection[1].trim().split('\n')
|
|
341
|
+
.filter((line) => line.trim().startsWith('-'));
|
|
342
|
+
for (const line of findingLines) {
|
|
343
|
+
const cleanLine = line.replace(/^-\s*/, '').trim();
|
|
344
|
+
const parts = cleanLine.split(' - Suggestion: ');
|
|
345
|
+
if (parts.length >= 2 && parts[0]) {
|
|
346
|
+
const [firstPart, suggestion] = parts;
|
|
347
|
+
const [severityCategory, ...descParts] = firstPart.split(': ');
|
|
348
|
+
const [severityStr, categoryStr] = (severityCategory || '').split(' ');
|
|
349
|
+
allFindings.push({
|
|
350
|
+
severity: severityStr?.toLowerCase() || 'minor',
|
|
351
|
+
category: categoryStr?.toLowerCase() || 'best-practices',
|
|
352
|
+
title: descParts.join(': '),
|
|
353
|
+
description: descParts.join(': '),
|
|
354
|
+
suggestion: suggestion || '',
|
|
355
|
+
autoFixable: false,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
// Parse summary
|
|
361
|
+
const summaryMatch = responseText.match(/SUMMARY:\s*([\s\S]+?)$/i);
|
|
362
|
+
if (summaryMatch && summaryMatch[1]) {
|
|
363
|
+
summary = summaryMatch[1].trim();
|
|
364
|
+
}
|
|
365
|
+
// Generate suggestions
|
|
366
|
+
const criticalIssues = allFindings.filter(f => f.severity === 'blocker' || f.severity === 'critical');
|
|
367
|
+
if (criticalIssues.length > 0) {
|
|
368
|
+
suggestions.push({
|
|
369
|
+
priority: 'must',
|
|
370
|
+
category: 'Critical Issues',
|
|
371
|
+
description: `Fix ${criticalIssues.length} critical/blocker issues before merging`,
|
|
372
|
+
rationale: 'These issues pose security or correctness risks',
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
if (metrics.averageComplexity > 10) {
|
|
376
|
+
suggestions.push({
|
|
377
|
+
priority: 'should',
|
|
378
|
+
category: 'Complexity',
|
|
379
|
+
description: 'Reduce cyclomatic complexity',
|
|
380
|
+
rationale: 'High complexity makes code harder to test and maintain',
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
if (metrics.documentationCoverage < 0.5) {
|
|
384
|
+
suggestions.push({
|
|
385
|
+
priority: 'should',
|
|
386
|
+
category: 'Documentation',
|
|
387
|
+
description: 'Improve documentation coverage',
|
|
388
|
+
rationale: 'Well-documented code is easier for team members to understand',
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
catch (error) {
|
|
393
|
+
logger.error({ error }, 'Review failed');
|
|
394
|
+
warnings.push(`LLM error: ${error instanceof Error ? error.message : 'Unknown'}`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
// Calculate overall score
|
|
398
|
+
const scores = [
|
|
399
|
+
grades.quality.score,
|
|
400
|
+
grades.security.score,
|
|
401
|
+
grades.performance.score,
|
|
402
|
+
grades.architecture.score,
|
|
403
|
+
grades.documentation.score,
|
|
404
|
+
];
|
|
405
|
+
const overallScore = Math.round(scores.reduce((a, b) => a + b, 0) / scores.length);
|
|
406
|
+
const executionTimeMs = timer.elapsed();
|
|
407
|
+
logger.info({
|
|
408
|
+
overallScore,
|
|
409
|
+
findings: allFindings.length,
|
|
410
|
+
executionTimeMs
|
|
411
|
+
}, 'Code review completed');
|
|
412
|
+
return {
|
|
413
|
+
code,
|
|
414
|
+
overallScore,
|
|
415
|
+
grades,
|
|
416
|
+
findings: allFindings,
|
|
417
|
+
suggestions,
|
|
418
|
+
metrics,
|
|
419
|
+
summary,
|
|
420
|
+
executionTimeMs,
|
|
421
|
+
warnings,
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
// ============================================================================
|
|
425
|
+
// Export
|
|
426
|
+
// ============================================================================
|
|
427
|
+
export default reviewCode;
|
|
428
|
+
//# sourceMappingURL=review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/tools/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwGxB,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACxC,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACzC,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClC,kBAAkB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE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AM,eAAe,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IACxC,MAAM,CAAC,IAAI,CAAC;QACV,YAAY;QACZ,QAAQ,EAAE,WAAW,CAAC,MAAM;QAC5B,eAAe;KAChB,EAAE,uBAAuB,CAAC,CAAC;IAE5B,OAAO;QACL,IAAI;QACJ,YAAY;QACZ,MAAM;QACN,QAAQ,EAAE,WAAW;QACrB,WAAW;QACX,OAAO;QACP,OAAO;QACP,eAAe;QACf,QAAQ;KACT,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas Server - Testing Utilities and Fixtures
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive testing infrastructure for all tools:
|
|
5
|
+
* - Mock data generators
|
|
6
|
+
* - Test fixtures and helpers
|
|
7
|
+
* - Performance benchmarking
|
|
8
|
+
* - Integration test utilities
|
|
9
|
+
* - Assertion helpers
|
|
10
|
+
*
|
|
11
|
+
* @module test-utils
|
|
12
|
+
* @version 1.0.0
|
|
13
|
+
*/
|
|
14
|
+
import type { IntentAnalysis, PipelineContext, GitContext, ProjectInfo, CodeSnippet, DecompositionResult, SolutionVariant, Critique } from '../types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Generate mock intent analysis for testing
|
|
17
|
+
*/
|
|
18
|
+
export declare function mockIntentAnalysis(overrides?: Partial<IntentAnalysis>): IntentAnalysis;
|
|
19
|
+
/**
|
|
20
|
+
* Generate mock project info for testing
|
|
21
|
+
*/
|
|
22
|
+
export declare function mockProjectInfo(overrides?: Partial<ProjectInfo>): ProjectInfo;
|
|
23
|
+
/**
|
|
24
|
+
* Generate mock git context for testing
|
|
25
|
+
*/
|
|
26
|
+
export declare function mockGitContext(overrides?: Partial<GitContext>): GitContext;
|
|
27
|
+
/**
|
|
28
|
+
* Generate mock code snippet for testing
|
|
29
|
+
*/
|
|
30
|
+
export declare function mockCodeSnippet(overrides?: Partial<CodeSnippet>): CodeSnippet;
|
|
31
|
+
/**
|
|
32
|
+
* Generate mock pipeline context for testing
|
|
33
|
+
*/
|
|
34
|
+
export declare function mockPipelineContext(overrides?: Partial<PipelineContext>): PipelineContext;
|
|
35
|
+
/**
|
|
36
|
+
* Generate mock decomposition result for testing
|
|
37
|
+
*/
|
|
38
|
+
export declare function mockDecompositionResult(overrides?: Partial<DecompositionResult>): DecompositionResult;
|
|
39
|
+
/**
|
|
40
|
+
* Generate mock solution variant for testing
|
|
41
|
+
*/
|
|
42
|
+
export declare function mockSolutionVariant(overrides?: Partial<SolutionVariant>): SolutionVariant;
|
|
43
|
+
/**
|
|
44
|
+
* Generate mock critique for testing
|
|
45
|
+
*/
|
|
46
|
+
export declare function mockCritique(overrides?: Partial<Critique>): Critique;
|
|
47
|
+
/**
|
|
48
|
+
* Measure async function execution time
|
|
49
|
+
*/
|
|
50
|
+
export declare function measureTime<T>(fn: () => Promise<T>): Promise<{
|
|
51
|
+
result: T;
|
|
52
|
+
durationMs: number;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Assert that a function throws with a specific message
|
|
56
|
+
*/
|
|
57
|
+
export declare function assertThrows(fn: () => Promise<unknown> | unknown, expectedMessage?: string | RegExp): Promise<Error>;
|
|
58
|
+
/**
|
|
59
|
+
* Wait for a condition to be true
|
|
60
|
+
*/
|
|
61
|
+
export declare function waitFor(condition: () => boolean | Promise<boolean>, options?: {
|
|
62
|
+
timeout?: number;
|
|
63
|
+
interval?: number;
|
|
64
|
+
}): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Create a spy function that tracks calls
|
|
67
|
+
*/
|
|
68
|
+
export declare function createSpy<T extends (...args: any[]) => any>(): {
|
|
69
|
+
spy: T;
|
|
70
|
+
calls: Array<{
|
|
71
|
+
args: Parameters<T>;
|
|
72
|
+
result?: ReturnType<T>;
|
|
73
|
+
error?: Error;
|
|
74
|
+
}>;
|
|
75
|
+
reset: () => void;
|
|
76
|
+
};
|
|
77
|
+
export interface BenchmarkResult {
|
|
78
|
+
name: string;
|
|
79
|
+
iterations: number;
|
|
80
|
+
totalMs: number;
|
|
81
|
+
avgMs: number;
|
|
82
|
+
minMs: number;
|
|
83
|
+
maxMs: number;
|
|
84
|
+
opsPerSecond: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Benchmark a function performance
|
|
88
|
+
*/
|
|
89
|
+
export declare function benchmark(name: string, fn: () => Promise<void> | void, iterations?: number): Promise<BenchmarkResult>;
|
|
90
|
+
/**
|
|
91
|
+
* Compare multiple function implementations
|
|
92
|
+
*/
|
|
93
|
+
export declare function benchmarkCompare(tests: Array<{
|
|
94
|
+
name: string;
|
|
95
|
+
fn: () => Promise<void> | void;
|
|
96
|
+
}>, iterations?: number): Promise<BenchmarkResult[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Print benchmark results to console
|
|
99
|
+
*/
|
|
100
|
+
export declare function printBenchmarkResults(results: BenchmarkResult[]): void;
|
|
101
|
+
/**
|
|
102
|
+
* Create a temporary directory for testing
|
|
103
|
+
*/
|
|
104
|
+
export declare function createTempDir(): Promise<string>;
|
|
105
|
+
/**
|
|
106
|
+
* Cleanup a temporary directory
|
|
107
|
+
*/
|
|
108
|
+
export declare function cleanupTempDir(dir: string): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Write test file to a directory
|
|
111
|
+
*/
|
|
112
|
+
export declare function writeTestFile(dir: string, filename: string, content: string): Promise<string>;
|
|
113
|
+
/**
|
|
114
|
+
* Execute test with automatic cleanup
|
|
115
|
+
*/
|
|
116
|
+
export declare function withTestDir<T>(fn: (dir: string) => Promise<T>): Promise<T>;
|
|
117
|
+
/**
|
|
118
|
+
* Assert that two values are deeply equal
|
|
119
|
+
*/
|
|
120
|
+
export declare function assertEqual<T>(actual: T, expected: T, message?: string): void;
|
|
121
|
+
/**
|
|
122
|
+
* Assert that a value is truthy
|
|
123
|
+
*/
|
|
124
|
+
export declare function assertTrue(value: unknown, message?: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Assert that a value is falsy
|
|
127
|
+
*/
|
|
128
|
+
export declare function assertFalse(value: unknown, message?: string): void;
|
|
129
|
+
/**
|
|
130
|
+
* Assert that a value is defined (not null or undefined)
|
|
131
|
+
*/
|
|
132
|
+
export declare function assertDefined<T>(value: T | null | undefined, message?: string): asserts value is T;
|
|
133
|
+
/**
|
|
134
|
+
* Assert that an array contains a value
|
|
135
|
+
*/
|
|
136
|
+
export declare function assertContains<T>(array: T[], value: T, message?: string): void;
|
|
137
|
+
/**
|
|
138
|
+
* Assert that a number is within a range
|
|
139
|
+
*/
|
|
140
|
+
export declare function assertInRange(value: number, min: number, max: number, message?: string): void;
|
|
141
|
+
/**
|
|
142
|
+
* Mock LLM provider for testing without actual API calls
|
|
143
|
+
*/
|
|
144
|
+
export declare class MockLLMProvider {
|
|
145
|
+
private responses;
|
|
146
|
+
callCount: number;
|
|
147
|
+
/**
|
|
148
|
+
* Set a mock response for a specific prompt pattern
|
|
149
|
+
*/
|
|
150
|
+
setResponse(pattern: string | RegExp, response: unknown): void;
|
|
151
|
+
/**
|
|
152
|
+
* Mock complete method
|
|
153
|
+
*/
|
|
154
|
+
complete(prompt: string): Promise<string>;
|
|
155
|
+
/**
|
|
156
|
+
* Mock completeJson method
|
|
157
|
+
*/
|
|
158
|
+
completeJson<T>(prompt: string): Promise<{
|
|
159
|
+
data: T | null;
|
|
160
|
+
}>;
|
|
161
|
+
/**
|
|
162
|
+
* Reset the mock provider
|
|
163
|
+
*/
|
|
164
|
+
reset(): void;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Example test suite demonstrating usage
|
|
168
|
+
*/
|
|
169
|
+
export declare function exampleTestSuite(): Promise<void>;
|
|
170
|
+
//# sourceMappingURL=test-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["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