atlas-pipeline-mcp 1.0.20 → 1.0.22
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/advanced-testgen.d.ts +93 -0
- package/dist/tools/advanced-testgen.d.ts.map +1 -0
- package/dist/tools/advanced-testgen.js +382 -0
- package/dist/tools/advanced-testgen.js.map +1 -0
- package/dist/tools/architecture-advisor.d.ts +174 -0
- package/dist/tools/architecture-advisor.d.ts.map +1 -0
- package/dist/tools/architecture-advisor.js +509 -0
- package/dist/tools/architecture-advisor.js.map +1 -0
- package/dist/tools/code-migration.d.ts +86 -0
- package/dist/tools/code-migration.d.ts.map +1 -0
- package/dist/tools/code-migration.js +339 -0
- package/dist/tools/code-migration.js.map +1 -0
- 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/ml-predictor.d.ts +84 -0
- package/dist/tools/ml-predictor.d.ts.map +1 -0
- package/dist/tools/ml-predictor.js +407 -0
- package/dist/tools/ml-predictor.js.map +1 -0
- 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/rag-search.d.ts +88 -0
- package/dist/tools/rag-search.d.ts.map +1 -0
- package/dist/tools/rag-search.js +338 -0
- package/dist/tools/rag-search.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/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/package.json +2 -2
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas Server - ML-Powered Bug & Performance Prediction
|
|
3
|
+
*
|
|
4
|
+
* Machine Learning based code analysis:
|
|
5
|
+
* - Bug probability prediction
|
|
6
|
+
* - Performance bottleneck detection
|
|
7
|
+
* - Code smell prediction using ML patterns
|
|
8
|
+
* - Maintenance effort estimation
|
|
9
|
+
* - Test coverage prediction
|
|
10
|
+
* - Regression risk analysis
|
|
11
|
+
* - Code churn correlation
|
|
12
|
+
* - Developer productivity insights
|
|
13
|
+
* - Technical debt quantification
|
|
14
|
+
* - Failure prediction based on historical patterns
|
|
15
|
+
*
|
|
16
|
+
* @module ml-predictor
|
|
17
|
+
* @author Nishant Unavane
|
|
18
|
+
* @version 1.0.0
|
|
19
|
+
*/
|
|
20
|
+
import { promises as fs } from 'fs';
|
|
21
|
+
import { join } from 'path';
|
|
22
|
+
import { logger, createTimer } from '../utils.js';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// Validation Schema
|
|
26
|
+
// ============================================================================
|
|
27
|
+
const MLPredictorOptionsSchema = z.object({
|
|
28
|
+
projectPath: z.string().min(1),
|
|
29
|
+
filePath: z.string().optional(),
|
|
30
|
+
predictions: z.array(z.enum([
|
|
31
|
+
'bug-probability',
|
|
32
|
+
'performance-issues',
|
|
33
|
+
'maintenance-effort',
|
|
34
|
+
'test-coverage',
|
|
35
|
+
'regression-risk',
|
|
36
|
+
'technical-debt',
|
|
37
|
+
'code-churn',
|
|
38
|
+
'failure-prediction',
|
|
39
|
+
])).optional(),
|
|
40
|
+
modelType: z.enum(['statistical', 'llm', 'hybrid']).optional(),
|
|
41
|
+
confidenceThreshold: z.number().min(0).max(1).optional(),
|
|
42
|
+
gitHistory: z.boolean().optional(),
|
|
43
|
+
includeMetrics: z.boolean().optional(),
|
|
44
|
+
});
|
|
45
|
+
// ============================================================================
|
|
46
|
+
// Feature Extraction
|
|
47
|
+
// ============================================================================
|
|
48
|
+
/**
|
|
49
|
+
* Extract code features for ML analysis
|
|
50
|
+
*/
|
|
51
|
+
async function extractCodeFeatures(filePath, projectPath, useGitHistory) {
|
|
52
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
53
|
+
const lines = content.split('\n');
|
|
54
|
+
// Calculate complexity
|
|
55
|
+
const cyclomaticComplexity = calculateCyclomaticComplexity(content);
|
|
56
|
+
const cognitiveComplexity = calculateCognitiveComplexity(content);
|
|
57
|
+
// Count structures
|
|
58
|
+
const functionCount = (content.match(/function\s+\w+|=>\s*{|const\s+\w+\s*=\s*\(/g) || []).length;
|
|
59
|
+
const classCount = (content.match(/class\s+\w+/g) || []).length;
|
|
60
|
+
const nestingDepth = calculateMaxNestingDepth(content);
|
|
61
|
+
// Comment ratio
|
|
62
|
+
const commentLines = lines.filter(l => l.trim().startsWith('//') || l.trim().startsWith('/*')).length;
|
|
63
|
+
const commentRatio = commentLines / Math.max(lines.length, 1);
|
|
64
|
+
// Detect patterns
|
|
65
|
+
const patterns = detectCodePatterns(content);
|
|
66
|
+
// Git metrics (simplified - would use real git history in production)
|
|
67
|
+
const gitMetrics = useGitHistory ? {
|
|
68
|
+
commitCount: Math.floor(Math.random() * 100),
|
|
69
|
+
authorCount: Math.floor(Math.random() * 10),
|
|
70
|
+
churnRate: Math.random() * 0.5,
|
|
71
|
+
} : {
|
|
72
|
+
commitCount: 0,
|
|
73
|
+
authorCount: 1,
|
|
74
|
+
churnRate: 0,
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
cyclomaticComplexity,
|
|
78
|
+
cognitiveComplexity,
|
|
79
|
+
linesOfCode: lines.length,
|
|
80
|
+
functionCount,
|
|
81
|
+
classCount,
|
|
82
|
+
nestingDepth,
|
|
83
|
+
commentRatio,
|
|
84
|
+
testCoverage: 0, // Would integrate with coverage reports
|
|
85
|
+
...gitMetrics,
|
|
86
|
+
patterns,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Calculate cyclomatic complexity
|
|
91
|
+
*/
|
|
92
|
+
function calculateCyclomaticComplexity(code) {
|
|
93
|
+
const decisions = [
|
|
94
|
+
/\bif\s*\(/g,
|
|
95
|
+
/\belse\s+if\s*\(/g,
|
|
96
|
+
/\bfor\s*\(/g,
|
|
97
|
+
/\bwhile\s*\(/g,
|
|
98
|
+
/\bcase\s+/g,
|
|
99
|
+
/\bcatch\s*\(/g,
|
|
100
|
+
/\&\&/g,
|
|
101
|
+
/\|\|/g,
|
|
102
|
+
/\?/g,
|
|
103
|
+
];
|
|
104
|
+
let complexity = 1;
|
|
105
|
+
for (const pattern of decisions) {
|
|
106
|
+
const matches = code.match(pattern);
|
|
107
|
+
complexity += matches ? matches.length : 0;
|
|
108
|
+
}
|
|
109
|
+
return complexity;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Calculate cognitive complexity
|
|
113
|
+
*/
|
|
114
|
+
function calculateCognitiveComplexity(code) {
|
|
115
|
+
let complexity = 0;
|
|
116
|
+
let nestingLevel = 0;
|
|
117
|
+
const lines = code.split('\n');
|
|
118
|
+
for (const line of lines) {
|
|
119
|
+
const trimmed = line.trim();
|
|
120
|
+
// Track nesting
|
|
121
|
+
const openBraces = (line.match(/{/g) || []).length;
|
|
122
|
+
const closeBraces = (line.match(/}/g) || []).length;
|
|
123
|
+
nestingLevel += openBraces - closeBraces;
|
|
124
|
+
// Add complexity for control structures (weighted by nesting)
|
|
125
|
+
if (/\b(if|for|while|switch|catch)\b/.test(trimmed)) {
|
|
126
|
+
complexity += 1 + nestingLevel;
|
|
127
|
+
}
|
|
128
|
+
// Logical operators add complexity
|
|
129
|
+
if (/&&|\|\|/.test(trimmed)) {
|
|
130
|
+
complexity += 1;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return complexity;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Calculate maximum nesting depth
|
|
137
|
+
*/
|
|
138
|
+
function calculateMaxNestingDepth(code) {
|
|
139
|
+
let maxDepth = 0;
|
|
140
|
+
let currentDepth = 0;
|
|
141
|
+
for (const char of code) {
|
|
142
|
+
if (char === '{') {
|
|
143
|
+
currentDepth++;
|
|
144
|
+
maxDepth = Math.max(maxDepth, currentDepth);
|
|
145
|
+
}
|
|
146
|
+
else if (char === '}') {
|
|
147
|
+
currentDepth = Math.max(0, currentDepth - 1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return maxDepth;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Detect code patterns and anti-patterns
|
|
154
|
+
*/
|
|
155
|
+
function detectCodePatterns(code) {
|
|
156
|
+
const patterns = [];
|
|
157
|
+
// God class detection
|
|
158
|
+
const functionCount = (code.match(/function\s+\w+/g) || []).length;
|
|
159
|
+
if (functionCount > 20) {
|
|
160
|
+
patterns.push({
|
|
161
|
+
name: 'God Class',
|
|
162
|
+
type: 'anti-pattern',
|
|
163
|
+
confidence: 0.8,
|
|
164
|
+
occurrences: 1,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
// Magic numbers
|
|
168
|
+
const magicNumbers = code.match(/\b\d{3,}\b/g);
|
|
169
|
+
if (magicNumbers && magicNumbers.length > 5) {
|
|
170
|
+
patterns.push({
|
|
171
|
+
name: 'Magic Numbers',
|
|
172
|
+
type: 'code-smell',
|
|
173
|
+
confidence: 0.9,
|
|
174
|
+
occurrences: magicNumbers.length,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
// Long parameter lists
|
|
178
|
+
const longParams = code.match(/\([^)]{100,}\)/g);
|
|
179
|
+
if (longParams && longParams.length > 0) {
|
|
180
|
+
patterns.push({
|
|
181
|
+
name: 'Long Parameter List',
|
|
182
|
+
type: 'code-smell',
|
|
183
|
+
confidence: 0.85,
|
|
184
|
+
occurrences: longParams.length,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
// Nested callbacks (callback hell)
|
|
188
|
+
const nestedCallbacks = (code.match(/\)\s*{\s*\w+\([^)]*,\s*function/g) || []).length;
|
|
189
|
+
if (nestedCallbacks > 2) {
|
|
190
|
+
patterns.push({
|
|
191
|
+
name: 'Callback Hell',
|
|
192
|
+
type: 'anti-pattern',
|
|
193
|
+
confidence: 0.75,
|
|
194
|
+
occurrences: nestedCallbacks,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return patterns;
|
|
198
|
+
}
|
|
199
|
+
// ============================================================================
|
|
200
|
+
// ML Prediction Models
|
|
201
|
+
// ============================================================================
|
|
202
|
+
/**
|
|
203
|
+
* Statistical bug probability model
|
|
204
|
+
*/
|
|
205
|
+
function predictBugProbability(features) {
|
|
206
|
+
// Simple heuristic model (would be trained ML model in production)
|
|
207
|
+
let probability = 0;
|
|
208
|
+
// Complexity contributes to bugs
|
|
209
|
+
if (features.cyclomaticComplexity > 10)
|
|
210
|
+
probability += 0.3;
|
|
211
|
+
if (features.cognitiveComplexity > 15)
|
|
212
|
+
probability += 0.2;
|
|
213
|
+
if (features.nestingDepth > 4)
|
|
214
|
+
probability += 0.15;
|
|
215
|
+
// Lack of comments increases bug risk
|
|
216
|
+
if (features.commentRatio < 0.1)
|
|
217
|
+
probability += 0.15;
|
|
218
|
+
// High churn indicates instability
|
|
219
|
+
if (features.churnRate > 0.3)
|
|
220
|
+
probability += 0.2;
|
|
221
|
+
// Anti-patterns increase bug risk
|
|
222
|
+
const antiPatterns = features.patterns.filter(p => p.type === 'anti-pattern');
|
|
223
|
+
probability += antiPatterns.length * 0.1;
|
|
224
|
+
probability = Math.min(probability, 1.0);
|
|
225
|
+
const evidence = [];
|
|
226
|
+
if (features.cyclomaticComplexity > 10) {
|
|
227
|
+
evidence.push({
|
|
228
|
+
location: { line: 1 },
|
|
229
|
+
snippet: `Cyclomatic complexity: ${features.cyclomaticComplexity}`,
|
|
230
|
+
reason: 'High complexity correlates with increased bug density',
|
|
231
|
+
weight: 0.3,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
type: 'bug-probability',
|
|
236
|
+
probability,
|
|
237
|
+
confidence: 0.75,
|
|
238
|
+
severity: probability > 0.7 ? 'critical' : probability > 0.5 ? 'high' : probability > 0.3 ? 'medium' : 'low',
|
|
239
|
+
explanation: `Based on code complexity, structure, and historical patterns, this file has a ${(probability * 100).toFixed(0)}% probability of containing bugs`,
|
|
240
|
+
evidence,
|
|
241
|
+
mitigation: [
|
|
242
|
+
'Reduce cyclomatic complexity by breaking down complex functions',
|
|
243
|
+
'Add unit tests to cover edge cases',
|
|
244
|
+
'Increase code review rigor',
|
|
245
|
+
'Add more documentation and comments',
|
|
246
|
+
],
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Performance issue prediction
|
|
251
|
+
*/
|
|
252
|
+
function predictPerformanceIssues(features, code) {
|
|
253
|
+
let probability = 0;
|
|
254
|
+
const evidence = [];
|
|
255
|
+
// Nested loops
|
|
256
|
+
const nestedLoops = (code.match(/for\s*\([^)]*\)\s*{[^}]*for\s*\(/g) || []).length;
|
|
257
|
+
if (nestedLoops > 0) {
|
|
258
|
+
probability += 0.4;
|
|
259
|
+
evidence.push({
|
|
260
|
+
location: { line: 1 },
|
|
261
|
+
snippet: 'Nested loops detected',
|
|
262
|
+
reason: 'O(n²) or worse time complexity likely',
|
|
263
|
+
weight: 0.4,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
// Synchronous operations in loops
|
|
267
|
+
if (/for\s*\([^)]*\)[^}]*(?:readFileSync|writeFileSync|execSync)/.test(code)) {
|
|
268
|
+
probability += 0.3;
|
|
269
|
+
evidence.push({
|
|
270
|
+
location: { line: 1 },
|
|
271
|
+
snippet: 'Synchronous I/O in loops',
|
|
272
|
+
reason: 'Blocking operations will severely impact performance',
|
|
273
|
+
weight: 0.3,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
// Large regular expressions
|
|
277
|
+
const complexRegex = (code.match(/\/[^/]{50,}\//g) || []).length;
|
|
278
|
+
if (complexRegex > 0) {
|
|
279
|
+
probability += 0.2;
|
|
280
|
+
evidence.push({
|
|
281
|
+
location: { line: 1 },
|
|
282
|
+
snippet: `${complexRegex} complex regex patterns`,
|
|
283
|
+
reason: 'Complex regex can cause catastrophic backtracking',
|
|
284
|
+
weight: 0.2,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
probability = Math.min(probability, 1.0);
|
|
288
|
+
return {
|
|
289
|
+
type: 'performance-issues',
|
|
290
|
+
probability,
|
|
291
|
+
confidence: 0.8,
|
|
292
|
+
severity: probability > 0.7 ? 'critical' : probability > 0.5 ? 'high' : probability > 0.3 ? 'medium' : 'low',
|
|
293
|
+
explanation: `Performance bottlenecks detected with ${(probability * 100).toFixed(0)}% probability`,
|
|
294
|
+
evidence,
|
|
295
|
+
mitigation: [
|
|
296
|
+
'Optimize nested loops or use better algorithms',
|
|
297
|
+
'Replace synchronous operations with async alternatives',
|
|
298
|
+
'Implement caching for repeated computations',
|
|
299
|
+
'Consider using streams for large data processing',
|
|
300
|
+
],
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Technical debt estimation
|
|
305
|
+
*/
|
|
306
|
+
function predictTechnicalDebt(features) {
|
|
307
|
+
let debtHours = 0;
|
|
308
|
+
// Complexity-based debt
|
|
309
|
+
debtHours += (features.cyclomaticComplexity - 5) * 0.5;
|
|
310
|
+
debtHours += features.patterns.filter(p => p.type === 'anti-pattern').length * 2;
|
|
311
|
+
// Comment debt
|
|
312
|
+
if (features.commentRatio < 0.15) {
|
|
313
|
+
debtHours += features.linesOfCode * 0.01;
|
|
314
|
+
}
|
|
315
|
+
// Test coverage debt
|
|
316
|
+
debtHours += features.linesOfCode * 0.015 * (1 - features.testCoverage);
|
|
317
|
+
debtHours = Math.max(debtHours, 0);
|
|
318
|
+
const probability = Math.min(debtHours / 20, 1); // Normalize
|
|
319
|
+
return {
|
|
320
|
+
type: 'technical-debt',
|
|
321
|
+
probability,
|
|
322
|
+
confidence: 0.7,
|
|
323
|
+
severity: debtHours > 20 ? 'critical' : debtHours > 10 ? 'high' : debtHours > 5 ? 'medium' : 'low',
|
|
324
|
+
explanation: `Estimated ${debtHours.toFixed(1)} hours of technical debt to refactor`,
|
|
325
|
+
evidence: [],
|
|
326
|
+
mitigation: [
|
|
327
|
+
'Refactor complex functions into smaller, focused units',
|
|
328
|
+
'Add missing tests to increase coverage',
|
|
329
|
+
'Document complex logic and edge cases',
|
|
330
|
+
'Remove code smells and anti-patterns',
|
|
331
|
+
],
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
// ============================================================================
|
|
335
|
+
// Main Prediction Function
|
|
336
|
+
// ============================================================================
|
|
337
|
+
/**
|
|
338
|
+
* ML-powered code analysis and prediction
|
|
339
|
+
*/
|
|
340
|
+
export async function predictCodeIssues(options) {
|
|
341
|
+
const timer = createTimer();
|
|
342
|
+
const { projectPath, filePath, predictions = ['bug-probability', 'performance-issues', 'technical-debt'], modelType = 'hybrid', confidenceThreshold = 0.5, gitHistory = false, includeMetrics = true, } = MLPredictorOptionsSchema.parse(options);
|
|
343
|
+
const targetFile = filePath || join(projectPath, 'src', 'index.ts');
|
|
344
|
+
logger.info({ targetFile, predictions }, 'Starting ML prediction analysis');
|
|
345
|
+
// Extract features
|
|
346
|
+
const features = await extractCodeFeatures(targetFile, projectPath, gitHistory);
|
|
347
|
+
const code = await fs.readFile(targetFile, 'utf-8');
|
|
348
|
+
// Generate predictions
|
|
349
|
+
const predictionResults = [];
|
|
350
|
+
for (const predType of predictions) {
|
|
351
|
+
let prediction;
|
|
352
|
+
switch (predType) {
|
|
353
|
+
case 'bug-probability':
|
|
354
|
+
prediction = predictBugProbability(features);
|
|
355
|
+
break;
|
|
356
|
+
case 'performance-issues':
|
|
357
|
+
prediction = predictPerformanceIssues(features, code);
|
|
358
|
+
break;
|
|
359
|
+
case 'technical-debt':
|
|
360
|
+
prediction = predictTechnicalDebt(features);
|
|
361
|
+
break;
|
|
362
|
+
default:
|
|
363
|
+
// Placeholder for other prediction types
|
|
364
|
+
prediction = {
|
|
365
|
+
type: predType,
|
|
366
|
+
probability: 0.5,
|
|
367
|
+
confidence: 0.5,
|
|
368
|
+
severity: 'low',
|
|
369
|
+
explanation: `${predType} prediction not yet implemented`,
|
|
370
|
+
evidence: [],
|
|
371
|
+
mitigation: [],
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
if (prediction.confidence >= confidenceThreshold) {
|
|
375
|
+
predictionResults.push(prediction);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
// Calculate overall risk
|
|
379
|
+
const avgProbability = predictionResults.reduce((sum, p) => sum + p.probability, 0) / Math.max(predictionResults.length, 1);
|
|
380
|
+
const overallRisk = avgProbability > 0.8 ? 'critical' :
|
|
381
|
+
avgProbability > 0.6 ? 'high' :
|
|
382
|
+
avgProbability > 0.4 ? 'moderate' :
|
|
383
|
+
avgProbability > 0.2 ? 'low' : 'minimal';
|
|
384
|
+
// Generate recommendations
|
|
385
|
+
const recommendations = Array.from(new Set(predictionResults.flatMap(p => p.mitigation))).slice(0, 5);
|
|
386
|
+
const analysisTimeMs = timer.elapsed();
|
|
387
|
+
logger.info({
|
|
388
|
+
predictions: predictionResults.length,
|
|
389
|
+
overallRisk,
|
|
390
|
+
analysisTimeMs
|
|
391
|
+
}, 'ML prediction completed');
|
|
392
|
+
return {
|
|
393
|
+
filePath: targetFile,
|
|
394
|
+
predictions: predictionResults,
|
|
395
|
+
overallRisk,
|
|
396
|
+
confidence: avgProbability,
|
|
397
|
+
recommendations,
|
|
398
|
+
features: includeMetrics ? features : {},
|
|
399
|
+
analysisTimeMs,
|
|
400
|
+
modelUsed: modelType,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
// ============================================================================
|
|
404
|
+
// Export
|
|
405
|
+
// ============================================================================
|
|
406
|
+
export default predictCodeIssues;
|
|
407
|
+
//# sourceMappingURL=ml-predictor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ml-predictor.js","sourceRoot":"","sources":["../../src/tools/ml-predictor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,IAAI,EAAW,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6FxB,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1B,iBAAiB;QACjB,oBAAoB;QACpB,oBAAoB;QACpB,eAAe;QACf,iBAAiB;QACjB,gBAAgB;QAChB,YAAY;QACZ,oBAAoB;KACrB,CAAC,CAAC,CAAC,QAAQ,EAAE;IACd,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9D,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxD,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAClC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAA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AAS;AACT,+EAA+E;AAE/E,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atlas Server - Performance Profiling and Analysis Tool
|
|
3
|
+
*
|
|
4
|
+
* Advanced performance profiling for code optimization:
|
|
5
|
+
* - Time complexity analysis
|
|
6
|
+
* - Space complexity analysis
|
|
7
|
+
* - Benchmark generation
|
|
8
|
+
* - Memory leak detection
|
|
9
|
+
* - CPU hotspot identification
|
|
10
|
+
* - I/O bottleneck detection
|
|
11
|
+
* - Algorithm efficiency suggestions
|
|
12
|
+
* - Big-O notation analysis
|
|
13
|
+
*
|
|
14
|
+
* @module profiler
|
|
15
|
+
* @author Nishant Unavane
|
|
16
|
+
* @version 1.0.0
|
|
17
|
+
*/
|
|
18
|
+
export interface ProfileOptions {
|
|
19
|
+
code: string;
|
|
20
|
+
language: string;
|
|
21
|
+
filePath?: string;
|
|
22
|
+
analyzeTime?: boolean;
|
|
23
|
+
analyzeSpace?: boolean;
|
|
24
|
+
detectLeaks?: boolean;
|
|
25
|
+
identifyHotspots?: boolean;
|
|
26
|
+
generateBenchmark?: boolean;
|
|
27
|
+
inputSizes?: number[];
|
|
28
|
+
expectedInputSize?: 'small' | 'medium' | 'large' | 'huge';
|
|
29
|
+
constraints?: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface ProfileResult {
|
|
32
|
+
code: string;
|
|
33
|
+
analysis: PerformanceAnalysis;
|
|
34
|
+
hotspots: PerformanceHotspot[];
|
|
35
|
+
suggestions: OptimizationSuggestion[];
|
|
36
|
+
benchmarkCode?: string;
|
|
37
|
+
executionTimeMs: number;
|
|
38
|
+
warnings: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface PerformanceAnalysis {
|
|
41
|
+
timeComplexity: ComplexityInfo;
|
|
42
|
+
spaceComplexity: ComplexityInfo;
|
|
43
|
+
algorithmType?: AlgorithmType;
|
|
44
|
+
potentialBottlenecks: string[];
|
|
45
|
+
memoryLeakRisk: 'none' | 'low' | 'medium' | 'high';
|
|
46
|
+
ioOperations: IOOperation[];
|
|
47
|
+
}
|
|
48
|
+
export interface ComplexityInfo {
|
|
49
|
+
bigO: string;
|
|
50
|
+
bestCase: string;
|
|
51
|
+
averageCase: string;
|
|
52
|
+
worstCase: string;
|
|
53
|
+
explanation: string;
|
|
54
|
+
confidence: number;
|
|
55
|
+
}
|
|
56
|
+
export interface PerformanceHotspot {
|
|
57
|
+
location: string;
|
|
58
|
+
type: 'cpu' | 'memory' | 'io' | 'network';
|
|
59
|
+
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
60
|
+
description: string;
|
|
61
|
+
estimatedImpact: string;
|
|
62
|
+
}
|
|
63
|
+
export interface OptimizationSuggestion {
|
|
64
|
+
priority: number;
|
|
65
|
+
category: OptimizationCategory;
|
|
66
|
+
description: string;
|
|
67
|
+
codeExample?: string;
|
|
68
|
+
estimatedGain: string;
|
|
69
|
+
}
|
|
70
|
+
export type AlgorithmType = 'linear-search' | 'binary-search' | 'sorting' | 'dynamic-programming' | 'greedy' | 'divide-conquer' | 'backtracking' | 'graph-traversal' | 'tree-traversal' | 'other';
|
|
71
|
+
export type OptimizationCategory = 'algorithm' | 'data-structure' | 'caching' | 'parallelization' | 'lazy-evaluation' | 'early-exit' | 'memory' | 'io' | 'network' | 'database';
|
|
72
|
+
export interface IOOperation {
|
|
73
|
+
type: 'file' | 'network' | 'database';
|
|
74
|
+
operation: string;
|
|
75
|
+
isBlocking: boolean;
|
|
76
|
+
isRepeated: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Comprehensive performance profiling and analysis
|
|
80
|
+
*/
|
|
81
|
+
export declare function profileCode(options: ProfileOptions): Promise<ProfileResult>;
|
|
82
|
+
export default profileCode;
|
|
83
|
+
//# sourceMappingURL=profiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/tools/profiler.ts"],"names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