driftdetect-core 0.8.1 → 0.8.2
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/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/java/index.d.ts +8 -0
- package/dist/java/index.d.ts.map +1 -0
- package/dist/java/index.js +7 -0
- package/dist/java/index.js.map +1 -0
- package/dist/java/java-analyzer.d.ts +142 -0
- package/dist/java/java-analyzer.d.ts.map +1 -0
- package/dist/java/java-analyzer.js +515 -0
- package/dist/java/java-analyzer.js.map +1 -0
- package/dist/php/index.d.ts +8 -0
- package/dist/php/index.d.ts.map +1 -0
- package/dist/php/index.js +7 -0
- package/dist/php/index.js.map +1 -0
- package/dist/php/php-analyzer.d.ts +149 -0
- package/dist/php/php-analyzer.d.ts.map +1 -0
- package/dist/php/php-analyzer.js +546 -0
- package/dist/php/php-analyzer.js.map +1 -0
- package/dist/python/index.d.ts +8 -0
- package/dist/python/index.d.ts.map +1 -0
- package/dist/python/index.js +7 -0
- package/dist/python/index.js.map +1 -0
- package/dist/python/python-analyzer.d.ts +156 -0
- package/dist/python/python-analyzer.d.ts.map +1 -0
- package/dist/python/python-analyzer.js +535 -0
- package/dist/python/python-analyzer.js.map +1 -0
- package/dist/typescript/index.d.ts +13 -0
- package/dist/typescript/index.d.ts.map +1 -0
- package/dist/typescript/index.js +12 -0
- package/dist/typescript/index.js.map +1 -0
- package/dist/typescript/typescript-analyzer.d.ts +194 -0
- package/dist/typescript/typescript-analyzer.d.ts.map +1 -0
- package/dist/typescript/typescript-analyzer.js +762 -0
- package/dist/typescript/typescript-analyzer.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python Analyzer
|
|
3
|
+
*
|
|
4
|
+
* Main analyzer for Python projects. Provides comprehensive analysis of:
|
|
5
|
+
* - HTTP routes (Flask, FastAPI, Django, Starlette)
|
|
6
|
+
* - Classes and functions
|
|
7
|
+
* - Error handling patterns
|
|
8
|
+
* - Data access patterns (Django ORM, SQLAlchemy, Tortoise, Peewee)
|
|
9
|
+
* - Async patterns
|
|
10
|
+
* - Decorators
|
|
11
|
+
*/
|
|
12
|
+
import * as fs from 'fs';
|
|
13
|
+
import * as path from 'path';
|
|
14
|
+
import { createPythonHybridExtractor } from '../call-graph/extractors/python-hybrid-extractor.js';
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Default Configuration
|
|
17
|
+
// ============================================================================
|
|
18
|
+
const DEFAULT_CONFIG = {
|
|
19
|
+
verbose: false,
|
|
20
|
+
includePatterns: ['**/*.py'],
|
|
21
|
+
excludePatterns: ['**/venv/**', '**/.venv/**', '**/site-packages/**', '**/__pycache__/**', '**/.git/**'],
|
|
22
|
+
};
|
|
23
|
+
const PY_EXTENSIONS = ['.py', '.pyw', '.pyi'];
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// Python Analyzer Implementation
|
|
26
|
+
// ============================================================================
|
|
27
|
+
export class PythonAnalyzer {
|
|
28
|
+
config;
|
|
29
|
+
extractor;
|
|
30
|
+
constructor(config) {
|
|
31
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
32
|
+
this.extractor = createPythonHybridExtractor();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Full project analysis
|
|
36
|
+
*/
|
|
37
|
+
async analyze() {
|
|
38
|
+
const startTime = Date.now();
|
|
39
|
+
const files = await this.findFiles();
|
|
40
|
+
const projectInfo = await this.parseProjectInfo();
|
|
41
|
+
const allFunctions = [];
|
|
42
|
+
const allClasses = [];
|
|
43
|
+
const allCalls = [];
|
|
44
|
+
const allImports = [];
|
|
45
|
+
const detectedFrameworks = new Set();
|
|
46
|
+
let linesOfCode = 0;
|
|
47
|
+
let testFileCount = 0;
|
|
48
|
+
let asyncFunctionCount = 0;
|
|
49
|
+
let decoratorCount = 0;
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
const source = await fs.promises.readFile(file, 'utf-8');
|
|
52
|
+
linesOfCode += source.split('\n').length;
|
|
53
|
+
const isTestFile = this.isTestFile(file);
|
|
54
|
+
if (isTestFile)
|
|
55
|
+
testFileCount++;
|
|
56
|
+
const result = this.extractor.extract(source, file);
|
|
57
|
+
// Detect frameworks from imports
|
|
58
|
+
for (const imp of result.imports) {
|
|
59
|
+
const framework = this.detectFramework(imp.source);
|
|
60
|
+
if (framework)
|
|
61
|
+
detectedFrameworks.add(framework);
|
|
62
|
+
}
|
|
63
|
+
// Count async functions
|
|
64
|
+
asyncFunctionCount += result.functions.filter(f => f.isAsync).length;
|
|
65
|
+
// Count decorators
|
|
66
|
+
decoratorCount += result.functions.reduce((sum, f) => sum + f.decorators.length, 0);
|
|
67
|
+
allFunctions.push(...result.functions);
|
|
68
|
+
allClasses.push(...result.classes);
|
|
69
|
+
allCalls.push(...result.calls);
|
|
70
|
+
allImports.push(...result.imports);
|
|
71
|
+
}
|
|
72
|
+
const analysisTimeMs = Date.now() - startTime;
|
|
73
|
+
return {
|
|
74
|
+
projectInfo: {
|
|
75
|
+
name: projectInfo.name,
|
|
76
|
+
version: projectInfo.version,
|
|
77
|
+
files: files.length,
|
|
78
|
+
},
|
|
79
|
+
detectedFrameworks: Array.from(detectedFrameworks),
|
|
80
|
+
stats: {
|
|
81
|
+
fileCount: files.length,
|
|
82
|
+
functionCount: allFunctions.length,
|
|
83
|
+
classCount: allClasses.length,
|
|
84
|
+
asyncFunctionCount,
|
|
85
|
+
decoratorCount,
|
|
86
|
+
linesOfCode,
|
|
87
|
+
testFileCount,
|
|
88
|
+
analysisTimeMs,
|
|
89
|
+
},
|
|
90
|
+
functions: allFunctions,
|
|
91
|
+
classes: allClasses,
|
|
92
|
+
calls: allCalls,
|
|
93
|
+
imports: allImports,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Analyze HTTP routes
|
|
98
|
+
*/
|
|
99
|
+
async analyzeRoutes() {
|
|
100
|
+
const files = await this.findFiles();
|
|
101
|
+
const routes = [];
|
|
102
|
+
for (const file of files) {
|
|
103
|
+
const source = await fs.promises.readFile(file, 'utf-8');
|
|
104
|
+
const fileRoutes = this.extractRoutes(source, file);
|
|
105
|
+
routes.push(...fileRoutes);
|
|
106
|
+
}
|
|
107
|
+
const byFramework = {};
|
|
108
|
+
for (const route of routes) {
|
|
109
|
+
byFramework[route.framework] = (byFramework[route.framework] || 0) + 1;
|
|
110
|
+
}
|
|
111
|
+
return { routes, byFramework };
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Analyze error handling patterns
|
|
115
|
+
*/
|
|
116
|
+
async analyzeErrorHandling() {
|
|
117
|
+
const files = await this.findFiles();
|
|
118
|
+
let tryExceptBlocks = 0;
|
|
119
|
+
let raiseStatements = 0;
|
|
120
|
+
let customExceptions = 0;
|
|
121
|
+
let contextManagers = 0;
|
|
122
|
+
const patterns = [];
|
|
123
|
+
const issues = [];
|
|
124
|
+
for (const file of files) {
|
|
125
|
+
const source = await fs.promises.readFile(file, 'utf-8');
|
|
126
|
+
const lines = source.split('\n');
|
|
127
|
+
for (let i = 0; i < lines.length; i++) {
|
|
128
|
+
const line = lines[i];
|
|
129
|
+
const lineNum = i + 1;
|
|
130
|
+
// Try-except blocks
|
|
131
|
+
if (/^\s*try\s*:/.test(line)) {
|
|
132
|
+
tryExceptBlocks++;
|
|
133
|
+
patterns.push({ type: 'try-except', file, line: lineNum, context: line.trim() });
|
|
134
|
+
}
|
|
135
|
+
// Raise statements
|
|
136
|
+
if (/\braise\s+/.test(line)) {
|
|
137
|
+
raiseStatements++;
|
|
138
|
+
patterns.push({ type: 'raise', file, line: lineNum, context: line.trim() });
|
|
139
|
+
}
|
|
140
|
+
// Custom exception classes
|
|
141
|
+
if (/class\s+\w+.*\(.*Exception.*\)/.test(line) || /class\s+\w+.*\(.*Error.*\)/.test(line)) {
|
|
142
|
+
customExceptions++;
|
|
143
|
+
patterns.push({ type: 'custom-exception', file, line: lineNum, context: line.trim() });
|
|
144
|
+
}
|
|
145
|
+
// Context managers (with statement)
|
|
146
|
+
if (/^\s*with\s+/.test(line)) {
|
|
147
|
+
contextManagers++;
|
|
148
|
+
patterns.push({ type: 'context-manager', file, line: lineNum, context: line.trim() });
|
|
149
|
+
}
|
|
150
|
+
// Bare except (bad practice)
|
|
151
|
+
if (/except\s*:/.test(line) && !/except\s+\w+/.test(line)) {
|
|
152
|
+
issues.push({
|
|
153
|
+
type: 'bare-except',
|
|
154
|
+
file,
|
|
155
|
+
line: lineNum,
|
|
156
|
+
message: 'Bare except catches all exceptions including KeyboardInterrupt',
|
|
157
|
+
suggestion: 'Use except Exception: or catch specific exceptions',
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
// Pass in except (swallowed exception)
|
|
161
|
+
if (/except.*:\s*$/.test(line) && i + 1 < lines.length && /^\s*pass\s*$/.test(lines[i + 1])) {
|
|
162
|
+
issues.push({
|
|
163
|
+
type: 'swallowed-exception',
|
|
164
|
+
file,
|
|
165
|
+
line: lineNum,
|
|
166
|
+
message: 'Exception is caught but silently ignored',
|
|
167
|
+
suggestion: 'Log the exception or handle it appropriately',
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
stats: { tryExceptBlocks, raiseStatements, customExceptions, contextManagers },
|
|
174
|
+
patterns,
|
|
175
|
+
issues,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Analyze data access patterns
|
|
180
|
+
*/
|
|
181
|
+
async analyzeDataAccess() {
|
|
182
|
+
const files = await this.findFiles();
|
|
183
|
+
const accessPoints = [];
|
|
184
|
+
const models = new Set();
|
|
185
|
+
for (const file of files) {
|
|
186
|
+
const source = await fs.promises.readFile(file, 'utf-8');
|
|
187
|
+
const fileAccessPoints = this.extractDataAccess(source, file);
|
|
188
|
+
accessPoints.push(...fileAccessPoints);
|
|
189
|
+
for (const ap of fileAccessPoints) {
|
|
190
|
+
if (ap.model && ap.model !== 'unknown') {
|
|
191
|
+
models.add(ap.model);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const byFramework = {};
|
|
196
|
+
const byOperation = {};
|
|
197
|
+
for (const ap of accessPoints) {
|
|
198
|
+
byFramework[ap.framework] = (byFramework[ap.framework] || 0) + 1;
|
|
199
|
+
byOperation[ap.operation] = (byOperation[ap.operation] || 0) + 1;
|
|
200
|
+
}
|
|
201
|
+
return { accessPoints, byFramework, byOperation, models: Array.from(models) };
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Analyze decorators
|
|
205
|
+
*/
|
|
206
|
+
async analyzeDecorators() {
|
|
207
|
+
const files = await this.findFiles();
|
|
208
|
+
const decorators = [];
|
|
209
|
+
for (const file of files) {
|
|
210
|
+
const source = await fs.promises.readFile(file, 'utf-8');
|
|
211
|
+
const fileDecorators = this.extractDecorators(source, file);
|
|
212
|
+
decorators.push(...fileDecorators);
|
|
213
|
+
}
|
|
214
|
+
const byName = {};
|
|
215
|
+
for (const dec of decorators) {
|
|
216
|
+
byName[dec.name] = (byName[dec.name] || 0) + 1;
|
|
217
|
+
}
|
|
218
|
+
return { decorators, byName };
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Analyze async patterns
|
|
222
|
+
*/
|
|
223
|
+
async analyzeAsync() {
|
|
224
|
+
const files = await this.findFiles();
|
|
225
|
+
const asyncFunctions = [];
|
|
226
|
+
let awaitCalls = 0;
|
|
227
|
+
let asyncContextManagers = 0;
|
|
228
|
+
for (const file of files) {
|
|
229
|
+
const source = await fs.promises.readFile(file, 'utf-8');
|
|
230
|
+
const result = this.extractor.extract(source, file);
|
|
231
|
+
const lines = source.split('\n');
|
|
232
|
+
// Find async functions
|
|
233
|
+
for (const func of result.functions) {
|
|
234
|
+
if (func.isAsync) {
|
|
235
|
+
// Count awaits in function body
|
|
236
|
+
let funcAwaitCount = 0;
|
|
237
|
+
for (let i = func.bodyStartLine - 1; i < func.bodyEndLine && i < lines.length; i++) {
|
|
238
|
+
const matches = lines[i].match(/\bawait\b/g);
|
|
239
|
+
if (matches)
|
|
240
|
+
funcAwaitCount += matches.length;
|
|
241
|
+
}
|
|
242
|
+
asyncFunctions.push({
|
|
243
|
+
name: func.qualifiedName,
|
|
244
|
+
file,
|
|
245
|
+
line: func.startLine,
|
|
246
|
+
awaitCount: funcAwaitCount,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// Count total awaits and async context managers
|
|
251
|
+
for (const line of lines) {
|
|
252
|
+
const awaitMatches = line.match(/\bawait\b/g);
|
|
253
|
+
if (awaitMatches)
|
|
254
|
+
awaitCalls += awaitMatches.length;
|
|
255
|
+
if (/async\s+with\b/.test(line))
|
|
256
|
+
asyncContextManagers++;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return { asyncFunctions, awaitCalls, asyncContextManagers };
|
|
260
|
+
}
|
|
261
|
+
// ============================================================================
|
|
262
|
+
// Private Helper Methods
|
|
263
|
+
// ============================================================================
|
|
264
|
+
async findFiles() {
|
|
265
|
+
const results = [];
|
|
266
|
+
const excludePatterns = this.config.excludePatterns ?? ['venv', '.venv', 'site-packages', '__pycache__', '.git'];
|
|
267
|
+
const walk = async (dir) => {
|
|
268
|
+
let entries;
|
|
269
|
+
try {
|
|
270
|
+
entries = await fs.promises.readdir(dir, { withFileTypes: true });
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
for (const entry of entries) {
|
|
276
|
+
const fullPath = path.join(dir, entry.name);
|
|
277
|
+
const relativePath = path.relative(this.config.rootDir, fullPath);
|
|
278
|
+
const shouldExclude = excludePatterns.some((pattern) => {
|
|
279
|
+
if (pattern.includes('*')) {
|
|
280
|
+
const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$');
|
|
281
|
+
return regex.test(relativePath);
|
|
282
|
+
}
|
|
283
|
+
return relativePath.includes(pattern);
|
|
284
|
+
});
|
|
285
|
+
if (shouldExclude)
|
|
286
|
+
continue;
|
|
287
|
+
if (entry.isDirectory()) {
|
|
288
|
+
await walk(fullPath);
|
|
289
|
+
}
|
|
290
|
+
else if (entry.isFile()) {
|
|
291
|
+
const ext = path.extname(entry.name);
|
|
292
|
+
if (PY_EXTENSIONS.includes(ext)) {
|
|
293
|
+
results.push(fullPath);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
await walk(this.config.rootDir);
|
|
299
|
+
return results;
|
|
300
|
+
}
|
|
301
|
+
async parseProjectInfo() {
|
|
302
|
+
// Try pyproject.toml
|
|
303
|
+
const pyprojectPath = path.join(this.config.rootDir, 'pyproject.toml');
|
|
304
|
+
try {
|
|
305
|
+
const content = await fs.promises.readFile(pyprojectPath, 'utf-8');
|
|
306
|
+
const nameMatch = content.match(/name\s*=\s*["']([^"']+)["']/);
|
|
307
|
+
const versionMatch = content.match(/version\s*=\s*["']([^"']+)["']/);
|
|
308
|
+
return {
|
|
309
|
+
name: nameMatch?.[1] ?? null,
|
|
310
|
+
version: versionMatch?.[1] ?? null,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
catch {
|
|
314
|
+
// Try setup.py
|
|
315
|
+
const setupPath = path.join(this.config.rootDir, 'setup.py');
|
|
316
|
+
try {
|
|
317
|
+
const content = await fs.promises.readFile(setupPath, 'utf-8');
|
|
318
|
+
const nameMatch = content.match(/name\s*=\s*["']([^"']+)["']/);
|
|
319
|
+
const versionMatch = content.match(/version\s*=\s*["']([^"']+)["']/);
|
|
320
|
+
return {
|
|
321
|
+
name: nameMatch?.[1] ?? null,
|
|
322
|
+
version: versionMatch?.[1] ?? null,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
return { name: null, version: null };
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
detectFramework(importSource) {
|
|
331
|
+
const frameworks = {
|
|
332
|
+
'flask': 'flask',
|
|
333
|
+
'fastapi': 'fastapi',
|
|
334
|
+
'django': 'django',
|
|
335
|
+
'starlette': 'starlette',
|
|
336
|
+
'tornado': 'tornado',
|
|
337
|
+
'aiohttp': 'aiohttp',
|
|
338
|
+
'sanic': 'sanic',
|
|
339
|
+
'sqlalchemy': 'sqlalchemy',
|
|
340
|
+
'tortoise': 'tortoise',
|
|
341
|
+
'peewee': 'peewee',
|
|
342
|
+
'mongoengine': 'mongoengine',
|
|
343
|
+
'pymongo': 'pymongo',
|
|
344
|
+
'redis': 'redis',
|
|
345
|
+
'celery': 'celery',
|
|
346
|
+
'pytest': 'pytest',
|
|
347
|
+
'unittest': 'unittest',
|
|
348
|
+
};
|
|
349
|
+
for (const [prefix, name] of Object.entries(frameworks)) {
|
|
350
|
+
if (importSource.startsWith(prefix))
|
|
351
|
+
return name;
|
|
352
|
+
}
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
isTestFile(file) {
|
|
356
|
+
const testPatterns = [
|
|
357
|
+
/test_.*\.py$/,
|
|
358
|
+
/.*_test\.py$/,
|
|
359
|
+
/tests?\/.*\.py$/,
|
|
360
|
+
/conftest\.py$/,
|
|
361
|
+
];
|
|
362
|
+
return testPatterns.some((p) => p.test(file));
|
|
363
|
+
}
|
|
364
|
+
extractRoutes(source, file) {
|
|
365
|
+
const routes = [];
|
|
366
|
+
const lines = source.split('\n');
|
|
367
|
+
// Flask patterns: @app.route('/path'), @blueprint.route('/path')
|
|
368
|
+
const flaskPattern = /@(?:app|blueprint|\w+)\.route\s*\(\s*['"]([^'"]+)['"]/gi;
|
|
369
|
+
// FastAPI patterns: @app.get('/path'), @router.post('/path')
|
|
370
|
+
const fastapiPattern = /@(?:app|router|\w+)\.(get|post|put|delete|patch|head|options)\s*\(\s*['"]([^'"]+)['"]/gi;
|
|
371
|
+
// Django patterns: path('route/', view)
|
|
372
|
+
const djangoPattern = /path\s*\(\s*['"]([^'"]+)['"]\s*,\s*(\w+)/gi;
|
|
373
|
+
for (let i = 0; i < lines.length; i++) {
|
|
374
|
+
const line = lines[i];
|
|
375
|
+
const lineNum = i + 1;
|
|
376
|
+
let match;
|
|
377
|
+
// Flask
|
|
378
|
+
while ((match = flaskPattern.exec(line)) !== null) {
|
|
379
|
+
const methods = this.extractFlaskMethods(line);
|
|
380
|
+
for (const method of methods) {
|
|
381
|
+
routes.push({
|
|
382
|
+
method,
|
|
383
|
+
path: match[1],
|
|
384
|
+
handler: this.extractNextFunction(lines, i),
|
|
385
|
+
framework: 'flask',
|
|
386
|
+
file,
|
|
387
|
+
line: lineNum,
|
|
388
|
+
decorators: [line.trim()],
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
flaskPattern.lastIndex = 0;
|
|
393
|
+
// FastAPI
|
|
394
|
+
while ((match = fastapiPattern.exec(line)) !== null) {
|
|
395
|
+
routes.push({
|
|
396
|
+
method: match[1].toUpperCase(),
|
|
397
|
+
path: match[2],
|
|
398
|
+
handler: this.extractNextFunction(lines, i),
|
|
399
|
+
framework: 'fastapi',
|
|
400
|
+
file,
|
|
401
|
+
line: lineNum,
|
|
402
|
+
decorators: [line.trim()],
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
fastapiPattern.lastIndex = 0;
|
|
406
|
+
// Django
|
|
407
|
+
while ((match = djangoPattern.exec(line)) !== null) {
|
|
408
|
+
routes.push({
|
|
409
|
+
method: 'ALL',
|
|
410
|
+
path: '/' + match[1],
|
|
411
|
+
handler: match[2],
|
|
412
|
+
framework: 'django',
|
|
413
|
+
file,
|
|
414
|
+
line: lineNum,
|
|
415
|
+
decorators: [],
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
djangoPattern.lastIndex = 0;
|
|
419
|
+
}
|
|
420
|
+
return routes;
|
|
421
|
+
}
|
|
422
|
+
extractFlaskMethods(line) {
|
|
423
|
+
const methodsMatch = line.match(/methods\s*=\s*\[([^\]]+)\]/i);
|
|
424
|
+
if (methodsMatch) {
|
|
425
|
+
return methodsMatch[1]
|
|
426
|
+
.split(',')
|
|
427
|
+
.map(m => m.trim().replace(/['"]/g, '').toUpperCase())
|
|
428
|
+
.filter(m => m);
|
|
429
|
+
}
|
|
430
|
+
return ['GET'];
|
|
431
|
+
}
|
|
432
|
+
extractNextFunction(lines, decoratorLine) {
|
|
433
|
+
for (let i = decoratorLine + 1; i < Math.min(decoratorLine + 10, lines.length); i++) {
|
|
434
|
+
const match = lines[i].match(/(?:async\s+)?def\s+(\w+)/);
|
|
435
|
+
if (match)
|
|
436
|
+
return match[1];
|
|
437
|
+
// Stop if we hit another decorator or non-decorator line
|
|
438
|
+
if (!lines[i].trim().startsWith('@') && lines[i].trim() !== '') {
|
|
439
|
+
break;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return 'unknown';
|
|
443
|
+
}
|
|
444
|
+
extractDataAccess(source, file) {
|
|
445
|
+
const accessPoints = [];
|
|
446
|
+
const lines = source.split('\n');
|
|
447
|
+
// Django ORM: Model.objects.filter()
|
|
448
|
+
const djangoPattern = /(\w+)\.objects\.(filter|get|create|update|delete|all|first|last|count|exists)/gi;
|
|
449
|
+
// SQLAlchemy: session.query(Model)
|
|
450
|
+
const sqlalchemyPattern = /session\.query\s*\(\s*(\w+)\s*\)/gi;
|
|
451
|
+
// Raw SQL: cursor.execute(), connection.execute()
|
|
452
|
+
const rawSqlPattern = /(?:cursor|connection|conn|db)\.execute\s*\(/gi;
|
|
453
|
+
for (let i = 0; i < lines.length; i++) {
|
|
454
|
+
const line = lines[i];
|
|
455
|
+
const lineNum = i + 1;
|
|
456
|
+
let match;
|
|
457
|
+
// Django ORM
|
|
458
|
+
while ((match = djangoPattern.exec(line)) !== null) {
|
|
459
|
+
accessPoints.push({
|
|
460
|
+
model: match[1],
|
|
461
|
+
operation: this.normalizeOperation(match[2]),
|
|
462
|
+
framework: 'django',
|
|
463
|
+
file,
|
|
464
|
+
line: lineNum,
|
|
465
|
+
isRawSql: false,
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
djangoPattern.lastIndex = 0;
|
|
469
|
+
// SQLAlchemy
|
|
470
|
+
while ((match = sqlalchemyPattern.exec(line)) !== null) {
|
|
471
|
+
accessPoints.push({
|
|
472
|
+
model: match[1],
|
|
473
|
+
operation: 'read',
|
|
474
|
+
framework: 'sqlalchemy',
|
|
475
|
+
file,
|
|
476
|
+
line: lineNum,
|
|
477
|
+
isRawSql: false,
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
sqlalchemyPattern.lastIndex = 0;
|
|
481
|
+
// Raw SQL
|
|
482
|
+
if (rawSqlPattern.test(line)) {
|
|
483
|
+
accessPoints.push({
|
|
484
|
+
model: 'raw',
|
|
485
|
+
operation: 'query',
|
|
486
|
+
framework: 'raw-sql',
|
|
487
|
+
file,
|
|
488
|
+
line: lineNum,
|
|
489
|
+
isRawSql: true,
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
rawSqlPattern.lastIndex = 0;
|
|
493
|
+
}
|
|
494
|
+
return accessPoints;
|
|
495
|
+
}
|
|
496
|
+
normalizeOperation(op) {
|
|
497
|
+
const opLower = op.toLowerCase();
|
|
498
|
+
if (['filter', 'get', 'all', 'first', 'last', 'count', 'exists'].includes(opLower))
|
|
499
|
+
return 'read';
|
|
500
|
+
if (['create', 'save', 'insert'].includes(opLower))
|
|
501
|
+
return 'write';
|
|
502
|
+
if (['update'].includes(opLower))
|
|
503
|
+
return 'update';
|
|
504
|
+
if (['delete', 'remove'].includes(opLower))
|
|
505
|
+
return 'delete';
|
|
506
|
+
return 'unknown';
|
|
507
|
+
}
|
|
508
|
+
extractDecorators(source, file) {
|
|
509
|
+
const decorators = [];
|
|
510
|
+
const lines = source.split('\n');
|
|
511
|
+
const decoratorPattern = /@(\w+)(?:\s*\(([^)]*)\))?/g;
|
|
512
|
+
for (let i = 0; i < lines.length; i++) {
|
|
513
|
+
const line = lines[i];
|
|
514
|
+
const lineNum = i + 1;
|
|
515
|
+
let match;
|
|
516
|
+
while ((match = decoratorPattern.exec(line)) !== null) {
|
|
517
|
+
decorators.push({
|
|
518
|
+
name: match[1],
|
|
519
|
+
file,
|
|
520
|
+
line: lineNum,
|
|
521
|
+
arguments: match[2] ? match[2].split(',').map(a => a.trim()) : [],
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
decoratorPattern.lastIndex = 0;
|
|
525
|
+
}
|
|
526
|
+
return decorators;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Factory function
|
|
531
|
+
*/
|
|
532
|
+
export function createPythonAnalyzer(config) {
|
|
533
|
+
return new PythonAnalyzer(config);
|
|
534
|
+
}
|
|
535
|
+
//# sourceMappingURL=python-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python-analyzer.js","sourceRoot":"","sources":["../../src/python/python-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,qDAAqD,CAAC;AAyHlG,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E,MAAM,cAAc,GAAkC;IACpD,OAAO,EAAE,KAAK;IACd,eAAe,EAAE,CAAC,SAAS,CAAC;IAC5B,eAAe,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,YAAY,CAAC;CACzG,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,+EAA+E;AAC/E,iCAAiC;AACjC,+EAA+E;AAE/E,MAAM,OAAO,cAAc;IACjB,MAAM,CAAuB;IAC7B,SAAS,CAAiD;IAEl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CACF;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA4B;IAC/D,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript/JavaScript Language Support
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive analysis for TypeScript and JavaScript projects:
|
|
5
|
+
* - HTTP routes (Express, NestJS, Next.js, Fastify)
|
|
6
|
+
* - React components and hooks
|
|
7
|
+
* - Error handling patterns
|
|
8
|
+
* - Data access patterns (Prisma, TypeORM, Drizzle, Sequelize, Mongoose)
|
|
9
|
+
* - Decorator usage (NestJS, TypeORM)
|
|
10
|
+
*/
|
|
11
|
+
export { TypeScriptAnalyzer, createTypeScriptAnalyzer, } from './typescript-analyzer.js';
|
|
12
|
+
export type { TypeScriptAnalyzerConfig, TypeScriptAnalysisResult, TypeScriptAnalysisStats, TSRoute, TSRoutesResult, TSComponent, TSComponentsResult, TSHook, TSHooksResult, TSErrorPattern, TSErrorIssue, TSErrorHandlingResult, TSDataAccessPoint, TSDataAccessResult, TSDecorator, TSDecoratorsResult, } from './typescript-analyzer.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typescript/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,OAAO,EACP,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,aAAa,EACb,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript/JavaScript Language Support
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive analysis for TypeScript and JavaScript projects:
|
|
5
|
+
* - HTTP routes (Express, NestJS, Next.js, Fastify)
|
|
6
|
+
* - React components and hooks
|
|
7
|
+
* - Error handling patterns
|
|
8
|
+
* - Data access patterns (Prisma, TypeORM, Drizzle, Sequelize, Mongoose)
|
|
9
|
+
* - Decorator usage (NestJS, TypeORM)
|
|
10
|
+
*/
|
|
11
|
+
export { TypeScriptAnalyzer, createTypeScriptAnalyzer, } from './typescript-analyzer.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/typescript/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC"}
|