@wundr.io/analysis-engine-simple 1.0.0 → 1.0.2-dev.20260530174250.ef0ec927
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/package.json +10 -10
- package/src/analyzers/index.ts +9 -9
- package/.turbo/turbo-build.log +0 -4
- package/.turbo/turbo-typecheck.log +0 -4
- package/dist/analyzers/BaseAnalysisServiceOptimizations.d.ts +0 -93
- package/dist/analyzers/BaseAnalysisServiceOptimizations.d.ts.map +0 -1
- package/dist/analyzers/BaseAnalysisServiceOptimizations.js +0 -419
- package/dist/analyzers/BaseAnalysisServiceOptimizations.js.map +0 -1
- package/dist/analyzers/index.d.ts +0 -58
- package/dist/analyzers/index.d.ts.map +0 -1
- package/dist/analyzers/index.js +0 -105
- package/dist/analyzers/index.js.map +0 -1
- package/dist/engines/DuplicateDetectionEngineSimple.d.ts +0 -46
- package/dist/engines/DuplicateDetectionEngineSimple.d.ts.map +0 -1
- package/dist/engines/DuplicateDetectionEngineSimple.js +0 -135
- package/dist/engines/DuplicateDetectionEngineSimple.js.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -27
- package/dist/index.js.map +0 -1
- package/dist/metrics/index.d.ts +0 -39
- package/dist/metrics/index.d.ts.map +0 -1
- package/dist/metrics/index.js +0 -42
- package/dist/metrics/index.js.map +0 -1
- package/dist/monitoring/MemoryMonitorSimple.d.ts +0 -79
- package/dist/monitoring/MemoryMonitorSimple.d.ts.map +0 -1
- package/dist/monitoring/MemoryMonitorSimple.js +0 -184
- package/dist/monitoring/MemoryMonitorSimple.js.map +0 -1
- package/dist/optimization/PerformanceBenchmarkSuiteSimple.d.ts +0 -37
- package/dist/optimization/PerformanceBenchmarkSuiteSimple.d.ts.map +0 -1
- package/dist/optimization/PerformanceBenchmarkSuiteSimple.js +0 -62
- package/dist/optimization/PerformanceBenchmarkSuiteSimple.js.map +0 -1
- package/dist/reporters/index.d.ts +0 -65
- package/dist/reporters/index.d.ts.map +0 -1
- package/dist/reporters/index.js +0 -211
- package/dist/reporters/index.js.map +0 -1
- package/dist/streaming/StreamingFileProcessorSimple.d.ts +0 -58
- package/dist/streaming/StreamingFileProcessorSimple.d.ts.map +0 -1
- package/dist/streaming/StreamingFileProcessorSimple.js +0 -170
- package/dist/streaming/StreamingFileProcessorSimple.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wundr.io/analysis-engine-simple",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2-dev.20260530174250.ef0ec927",
|
|
4
4
|
"description": "Code analysis and quality metrics engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,24 +16,24 @@
|
|
|
16
16
|
"typecheck": "tsc --noEmit"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"ts-morph": "^21.0.1",
|
|
20
|
-
"glob": "^10.3.10",
|
|
21
|
-
"minimatch": "^9.0.3",
|
|
22
19
|
"@typescript-eslint/parser": "^6.21.0",
|
|
23
20
|
"@typescript-eslint/typescript-estree": "^6.21.0",
|
|
24
|
-
"@wundr.io/core-simple": "
|
|
21
|
+
"@wundr.io/core-simple": "^1.0.0",
|
|
22
|
+
"glob": "^10.3.10",
|
|
23
|
+
"minimatch": "^9.0.3",
|
|
24
|
+
"ts-morph": "^21.0.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/jest": "^29.5.8",
|
|
28
|
-
"jest": "^29.7.0",
|
|
29
|
-
"typescript": "^5.2.2",
|
|
30
|
-
"eslint": "^8.57.1",
|
|
31
28
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
32
29
|
"@typescript-eslint/parser": "^6.21.0",
|
|
33
|
-
"eslint
|
|
30
|
+
"eslint": "^8.57.1",
|
|
34
31
|
"eslint-plugin-import": "^2.30.0",
|
|
32
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
35
33
|
"eslint-plugin-prettier": "^5.2.1",
|
|
36
|
-
"
|
|
34
|
+
"jest": "^29.7.0",
|
|
35
|
+
"prettier": "^3.3.3",
|
|
36
|
+
"typescript": "^5.2.2"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
package/src/analyzers/index.ts
CHANGED
|
@@ -56,17 +56,21 @@ export interface AnalyzerConfig {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export class CodeAnalyzer {
|
|
59
|
-
|
|
59
|
+
private readonly maxFiles: number;
|
|
60
|
+
|
|
61
|
+
constructor(_config?: Record<string, AnalyzerConfig>, maxFiles = 1000) {
|
|
60
62
|
// Initialize analyzer with optional configuration
|
|
63
|
+
this.maxFiles = maxFiles;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
async analyze(projectPath: string): Promise<AnalysisReport> {
|
|
64
67
|
const startTime = Date.now();
|
|
65
68
|
const filePaths = await this.getFileList(projectPath);
|
|
69
|
+
const filesToAnalyze = filePaths.slice(0, this.maxFiles);
|
|
66
70
|
const results: AnalysisResult[] = [];
|
|
67
71
|
|
|
68
72
|
// Simple analysis implementation
|
|
69
|
-
for (const filePath of
|
|
73
|
+
for (const filePath of filesToAnalyze) {
|
|
70
74
|
if (filePath.includes('.test.') || filePath.includes('.spec.')) {
|
|
71
75
|
results.push({
|
|
72
76
|
id: `test-file-${Date.now()}`,
|
|
@@ -87,7 +91,7 @@ export class CodeAnalyzer {
|
|
|
87
91
|
timestamp: new Date(),
|
|
88
92
|
projectPath,
|
|
89
93
|
totalFiles: filePaths.length,
|
|
90
|
-
analyzedFiles:
|
|
94
|
+
analyzedFiles: filesToAnalyze.length,
|
|
91
95
|
results,
|
|
92
96
|
summary: {
|
|
93
97
|
totalIssues: results.length,
|
|
@@ -125,11 +129,7 @@ export class CodeAnalyzer {
|
|
|
125
129
|
for (const pattern of patterns) {
|
|
126
130
|
try {
|
|
127
131
|
const files = await glob(pattern, {
|
|
128
|
-
ignore: [
|
|
129
|
-
'**/node_modules/**',
|
|
130
|
-
'**/dist/**',
|
|
131
|
-
'**/build/**',
|
|
132
|
-
],
|
|
132
|
+
ignore: ['**/node_modules/**', '**/dist/**', '**/build/**'],
|
|
133
133
|
});
|
|
134
134
|
allFiles.push(...files);
|
|
135
135
|
} catch (error) {
|
|
@@ -155,4 +155,4 @@ export const DEFAULT_ANALYZER_CONFIG: Record<string, AnalyzerConfig> = {
|
|
|
155
155
|
rules: {},
|
|
156
156
|
severity: 'warning',
|
|
157
157
|
},
|
|
158
|
-
};
|
|
158
|
+
};
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Optimized Base Analysis Service with streaming and worker pool support
|
|
3
|
-
* Provides memory-efficient analysis with concurrent processing for large codebases
|
|
4
|
-
*/
|
|
5
|
-
import { EventEmitter } from 'events';
|
|
6
|
-
import type { AnalysisReport, AnalysisResult } from './index';
|
|
7
|
-
export interface DuplicateGroup {
|
|
8
|
-
type: string;
|
|
9
|
-
files: string[];
|
|
10
|
-
size: number;
|
|
11
|
-
similarity: number;
|
|
12
|
-
}
|
|
13
|
-
export interface QualityMetrics {
|
|
14
|
-
circularDependencies: number;
|
|
15
|
-
codeSmells: number;
|
|
16
|
-
technicalDebt: number;
|
|
17
|
-
}
|
|
18
|
-
export interface ReportData {
|
|
19
|
-
analysis: AnalysisReport;
|
|
20
|
-
duplicates: DuplicateGroup[];
|
|
21
|
-
quality: QualityMetrics;
|
|
22
|
-
timestamp: Date;
|
|
23
|
-
config: OptimizedAnalysisConfig;
|
|
24
|
-
}
|
|
25
|
-
export interface OptimizedAnalysisConfig {
|
|
26
|
-
targetDir: string;
|
|
27
|
-
outputDir: string;
|
|
28
|
-
includePatterns: string[];
|
|
29
|
-
excludePatterns: string[];
|
|
30
|
-
outputFormats: string[];
|
|
31
|
-
verbose: boolean;
|
|
32
|
-
performance: {
|
|
33
|
-
maxConcurrency: number;
|
|
34
|
-
chunkSize: number;
|
|
35
|
-
enableCaching: boolean;
|
|
36
|
-
maxMemoryUsage: number;
|
|
37
|
-
enableStreaming: boolean;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export interface AnalysisPhaseResult {
|
|
41
|
-
phase: string;
|
|
42
|
-
duration: number;
|
|
43
|
-
filesProcessed: number;
|
|
44
|
-
errors: string[];
|
|
45
|
-
metrics: {
|
|
46
|
-
memoryUsed: number;
|
|
47
|
-
throughput: number;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export interface OptimizedAnalysisResult {
|
|
51
|
-
success: boolean;
|
|
52
|
-
error?: Error | null;
|
|
53
|
-
data?: {
|
|
54
|
-
files: number;
|
|
55
|
-
duplicates: DuplicateGroup[];
|
|
56
|
-
violations: AnalysisResult[];
|
|
57
|
-
summary: {
|
|
58
|
-
totalFiles: number;
|
|
59
|
-
duplicateGroups: number;
|
|
60
|
-
violationCount: number;
|
|
61
|
-
totalEntities: number;
|
|
62
|
-
duplicateClusters: number;
|
|
63
|
-
circularDependencies: number;
|
|
64
|
-
codeSmells: number;
|
|
65
|
-
technicalDebt: number;
|
|
66
|
-
};
|
|
67
|
-
phases: AnalysisPhaseResult[];
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Optimized Analysis Service with streaming capabilities and worker pool management
|
|
72
|
-
*/
|
|
73
|
-
export declare class OptimizedBaseAnalysisService extends EventEmitter {
|
|
74
|
-
private config;
|
|
75
|
-
private analyzer;
|
|
76
|
-
private workers;
|
|
77
|
-
private cache;
|
|
78
|
-
private isInitialized;
|
|
79
|
-
constructor(config: OptimizedAnalysisConfig);
|
|
80
|
-
initialize(): Promise<void>;
|
|
81
|
-
startAnalysis(options?: Record<string, unknown>): Promise<OptimizedAnalysisResult>;
|
|
82
|
-
analyze(directory: string, _options?: Record<string, unknown>): Promise<OptimizedAnalysisResult>;
|
|
83
|
-
private discoverFiles;
|
|
84
|
-
private runContentAnalysis;
|
|
85
|
-
private detectDuplicates;
|
|
86
|
-
private analyzeCodeQuality;
|
|
87
|
-
private generateReports;
|
|
88
|
-
private generateHtmlReport;
|
|
89
|
-
private generateMarkdownReport;
|
|
90
|
-
private chunkArray;
|
|
91
|
-
cleanup(): Promise<void>;
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=BaseAnalysisServiceOptimizations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAnalysisServiceOptimizations.d.ts","sourceRoot":"","sources":["../../src/analyzers/BaseAnalysisServiceOptimizations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAQtC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAA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AK,CAA8B;IAC3C,OAAO,CAAC,aAAa,CAAS;gBAElB,MAAM,EAAE,uBAAuB;IAMrC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB3B,aAAa,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAItF,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;YAgK5F,aAAa;YAkBb,kBAAkB;YAgFlB,gBAAgB;YAkChB,kBAAkB;YA6BlB,eAAe;YAgCf,kBAAkB;YA4BlB,sBAAsB;IA+BpC,OAAO,CAAC,UAAU;IAQZ,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAY/B"}
|
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @fileoverview Optimized Base Analysis Service with streaming and worker pool support
|
|
4
|
-
* Provides memory-efficient analysis with concurrent processing for large codebases
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.OptimizedBaseAnalysisService = void 0;
|
|
8
|
-
const tslib_1 = require("tslib");
|
|
9
|
-
const events_1 = require("events");
|
|
10
|
-
const path = tslib_1.__importStar(require("path"));
|
|
11
|
-
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
12
|
-
const glob_1 = require("glob");
|
|
13
|
-
const index_1 = require("./index");
|
|
14
|
-
/**
|
|
15
|
-
* Optimized Analysis Service with streaming capabilities and worker pool management
|
|
16
|
-
*/
|
|
17
|
-
class OptimizedBaseAnalysisService extends events_1.EventEmitter {
|
|
18
|
-
constructor(config) {
|
|
19
|
-
super();
|
|
20
|
-
this.workers = [];
|
|
21
|
-
this.cache = new Map();
|
|
22
|
-
this.isInitialized = false;
|
|
23
|
-
this.config = config;
|
|
24
|
-
this.analyzer = new index_1.CodeAnalyzer();
|
|
25
|
-
}
|
|
26
|
-
async initialize() {
|
|
27
|
-
if (this.isInitialized) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
// Ensure output directory exists
|
|
31
|
-
await fs.ensureDir(this.config.outputDir);
|
|
32
|
-
// Initialize cache directory if caching is enabled
|
|
33
|
-
if (this.config.performance.enableCaching) {
|
|
34
|
-
await fs.ensureDir(path.join(this.config.outputDir, '.cache'));
|
|
35
|
-
}
|
|
36
|
-
this.isInitialized = true;
|
|
37
|
-
this.emit('initialized');
|
|
38
|
-
}
|
|
39
|
-
async startAnalysis(options = {}) {
|
|
40
|
-
return this.analyze(this.config.targetDir, options);
|
|
41
|
-
}
|
|
42
|
-
async analyze(directory, _options = {}) {
|
|
43
|
-
const startTime = Date.now();
|
|
44
|
-
const phases = [];
|
|
45
|
-
try {
|
|
46
|
-
await this.initialize();
|
|
47
|
-
this.emit('progress', {
|
|
48
|
-
type: 'phase',
|
|
49
|
-
message: 'Starting optimized analysis...',
|
|
50
|
-
});
|
|
51
|
-
// Phase 1: File Discovery
|
|
52
|
-
const discoveryStart = Date.now();
|
|
53
|
-
this.emit('progress', {
|
|
54
|
-
type: 'phase',
|
|
55
|
-
message: 'Discovering files...',
|
|
56
|
-
});
|
|
57
|
-
const files = await this.discoverFiles(directory);
|
|
58
|
-
phases.push({
|
|
59
|
-
phase: 'discovery',
|
|
60
|
-
duration: Date.now() - discoveryStart,
|
|
61
|
-
filesProcessed: files.length,
|
|
62
|
-
errors: [],
|
|
63
|
-
metrics: {
|
|
64
|
-
memoryUsed: process.memoryUsage().heapUsed,
|
|
65
|
-
throughput: files.length / ((Date.now() - discoveryStart) / 1000),
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
this.emit('progress', {
|
|
69
|
-
type: 'progress',
|
|
70
|
-
message: `Discovered ${files.length} files`,
|
|
71
|
-
progress: files.length,
|
|
72
|
-
total: files.length,
|
|
73
|
-
});
|
|
74
|
-
// Phase 2: Content Analysis
|
|
75
|
-
const analysisStart = Date.now();
|
|
76
|
-
this.emit('progress', {
|
|
77
|
-
type: 'phase',
|
|
78
|
-
message: 'Analyzing content...',
|
|
79
|
-
});
|
|
80
|
-
const analysisReport = await this.runContentAnalysis(files, directory);
|
|
81
|
-
phases.push({
|
|
82
|
-
phase: 'analysis',
|
|
83
|
-
duration: Date.now() - analysisStart,
|
|
84
|
-
filesProcessed: files.length,
|
|
85
|
-
errors: [],
|
|
86
|
-
metrics: {
|
|
87
|
-
memoryUsed: process.memoryUsage().heapUsed,
|
|
88
|
-
throughput: files.length / ((Date.now() - analysisStart) / 1000),
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
// Phase 3: Duplicate Detection
|
|
92
|
-
const duplicateStart = Date.now();
|
|
93
|
-
this.emit('progress', {
|
|
94
|
-
type: 'phase',
|
|
95
|
-
message: 'Detecting duplicates...',
|
|
96
|
-
});
|
|
97
|
-
const duplicates = await this.detectDuplicates(files);
|
|
98
|
-
phases.push({
|
|
99
|
-
phase: 'duplicates',
|
|
100
|
-
duration: Date.now() - duplicateStart,
|
|
101
|
-
filesProcessed: files.length,
|
|
102
|
-
errors: [],
|
|
103
|
-
metrics: {
|
|
104
|
-
memoryUsed: process.memoryUsage().heapUsed,
|
|
105
|
-
throughput: files.length / ((Date.now() - duplicateStart) / 1000),
|
|
106
|
-
},
|
|
107
|
-
});
|
|
108
|
-
// Phase 4: Quality Analysis
|
|
109
|
-
const qualityStart = Date.now();
|
|
110
|
-
this.emit('progress', {
|
|
111
|
-
type: 'phase',
|
|
112
|
-
message: 'Analyzing code quality...',
|
|
113
|
-
});
|
|
114
|
-
const qualityMetrics = await this.analyzeCodeQuality(files);
|
|
115
|
-
phases.push({
|
|
116
|
-
phase: 'quality',
|
|
117
|
-
duration: Date.now() - qualityStart,
|
|
118
|
-
filesProcessed: files.length,
|
|
119
|
-
errors: [],
|
|
120
|
-
metrics: {
|
|
121
|
-
memoryUsed: process.memoryUsage().heapUsed,
|
|
122
|
-
throughput: files.length / ((Date.now() - qualityStart) / 1000),
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
// Phase 5: Report Generation
|
|
126
|
-
const reportStart = Date.now();
|
|
127
|
-
this.emit('progress', {
|
|
128
|
-
type: 'phase',
|
|
129
|
-
message: 'Generating reports...',
|
|
130
|
-
});
|
|
131
|
-
await this.generateReports(analysisReport, duplicates, qualityMetrics);
|
|
132
|
-
phases.push({
|
|
133
|
-
phase: 'reporting',
|
|
134
|
-
duration: Date.now() - reportStart,
|
|
135
|
-
filesProcessed: 0,
|
|
136
|
-
errors: [],
|
|
137
|
-
metrics: {
|
|
138
|
-
memoryUsed: process.memoryUsage().heapUsed,
|
|
139
|
-
throughput: 0,
|
|
140
|
-
},
|
|
141
|
-
});
|
|
142
|
-
const totalDuration = Date.now() - startTime;
|
|
143
|
-
this.emit('progress', {
|
|
144
|
-
type: 'complete',
|
|
145
|
-
message: `Analysis completed in ${totalDuration}ms`,
|
|
146
|
-
});
|
|
147
|
-
return {
|
|
148
|
-
success: true,
|
|
149
|
-
error: null,
|
|
150
|
-
data: {
|
|
151
|
-
files: files.length,
|
|
152
|
-
duplicates: duplicates,
|
|
153
|
-
violations: analysisReport.results,
|
|
154
|
-
summary: {
|
|
155
|
-
totalFiles: files.length,
|
|
156
|
-
duplicateGroups: duplicates.length,
|
|
157
|
-
violationCount: analysisReport.summary.totalIssues,
|
|
158
|
-
totalEntities: analysisReport.summary.filesCovered,
|
|
159
|
-
duplicateClusters: duplicates.length,
|
|
160
|
-
circularDependencies: qualityMetrics.circularDependencies,
|
|
161
|
-
codeSmells: qualityMetrics.codeSmells,
|
|
162
|
-
technicalDebt: qualityMetrics.technicalDebt,
|
|
163
|
-
},
|
|
164
|
-
phases,
|
|
165
|
-
},
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
this.emit('progress', {
|
|
170
|
-
type: 'error',
|
|
171
|
-
message: error instanceof Error ? error.message : 'Unknown error',
|
|
172
|
-
});
|
|
173
|
-
return {
|
|
174
|
-
success: false,
|
|
175
|
-
error: error instanceof Error ? error : new Error(String(error)),
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
async discoverFiles(directory) {
|
|
180
|
-
const allFiles = [];
|
|
181
|
-
for (const pattern of this.config.includePatterns) {
|
|
182
|
-
try {
|
|
183
|
-
const fullPattern = path.join(directory, pattern);
|
|
184
|
-
const files = await (0, glob_1.glob)(fullPattern, {
|
|
185
|
-
ignore: this.config.excludePatterns.map(p => path.join(directory, p)),
|
|
186
|
-
});
|
|
187
|
-
allFiles.push(...files);
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
console.warn('Error globbing pattern:', pattern, error);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return [...new Set(allFiles)];
|
|
194
|
-
}
|
|
195
|
-
async runContentAnalysis(files, projectPath) {
|
|
196
|
-
// Use the existing analyzer but with chunked processing
|
|
197
|
-
const chunkSize = Math.min(this.config.performance.chunkSize, files.length);
|
|
198
|
-
const chunks = this.chunkArray(files, chunkSize);
|
|
199
|
-
let totalReport = null;
|
|
200
|
-
for (let i = 0; i < chunks.length; i++) {
|
|
201
|
-
// Process chunk ${i + 1}/${chunks.length} - placeholder for future enhancement
|
|
202
|
-
this.emit('progress', {
|
|
203
|
-
type: 'progress',
|
|
204
|
-
message: `Analyzing chunk ${i + 1}/${chunks.length}`,
|
|
205
|
-
progress: i + 1,
|
|
206
|
-
total: chunks.length,
|
|
207
|
-
});
|
|
208
|
-
// For this implementation, we'll use the existing analyzer
|
|
209
|
-
// In a real implementation, this would process the specific chunk
|
|
210
|
-
const chunkReport = await this.analyzer.analyze(projectPath);
|
|
211
|
-
if (totalReport === null) {
|
|
212
|
-
totalReport = chunkReport;
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
// Merge reports
|
|
216
|
-
totalReport.results.push(...chunkReport.results);
|
|
217
|
-
totalReport.analyzedFiles += chunkReport.analyzedFiles;
|
|
218
|
-
totalReport.summary.totalIssues += chunkReport.summary.totalIssues;
|
|
219
|
-
totalReport.summary.criticalIssues += chunkReport.summary.criticalIssues;
|
|
220
|
-
totalReport.summary.errorIssues += chunkReport.summary.errorIssues;
|
|
221
|
-
totalReport.summary.warningIssues += chunkReport.summary.warningIssues;
|
|
222
|
-
totalReport.summary.infoIssues += chunkReport.summary.infoIssues;
|
|
223
|
-
}
|
|
224
|
-
// Memory check
|
|
225
|
-
const memoryUsage = process.memoryUsage().heapUsed;
|
|
226
|
-
if (memoryUsage > this.config.performance.maxMemoryUsage * 0.9) {
|
|
227
|
-
this.emit('memory-leak-warning', {
|
|
228
|
-
severity: 'high',
|
|
229
|
-
growthRate: 0,
|
|
230
|
-
current: memoryUsage,
|
|
231
|
-
});
|
|
232
|
-
// Force garbage collection if available
|
|
233
|
-
if (typeof global.gc === 'function') {
|
|
234
|
-
global.gc();
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return totalReport ?? {
|
|
239
|
-
timestamp: new Date(),
|
|
240
|
-
projectPath,
|
|
241
|
-
totalFiles: files.length,
|
|
242
|
-
analyzedFiles: 0,
|
|
243
|
-
results: [],
|
|
244
|
-
summary: {
|
|
245
|
-
totalIssues: 0,
|
|
246
|
-
criticalIssues: 0,
|
|
247
|
-
errorIssues: 0,
|
|
248
|
-
warningIssues: 0,
|
|
249
|
-
infoIssues: 0,
|
|
250
|
-
ruleViolations: {},
|
|
251
|
-
filesCovered: 0,
|
|
252
|
-
analysisTime: 0,
|
|
253
|
-
},
|
|
254
|
-
metrics: {
|
|
255
|
-
codeComplexity: 0,
|
|
256
|
-
duplicateLines: 0,
|
|
257
|
-
unusedImports: 0,
|
|
258
|
-
circularDependencies: 0,
|
|
259
|
-
codeSmells: 0,
|
|
260
|
-
technicalDebt: {
|
|
261
|
-
hours: 0,
|
|
262
|
-
priority: 'low',
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
async detectDuplicates(files) {
|
|
268
|
-
// Simple duplicate detection based on file size and basic content hashing
|
|
269
|
-
const duplicates = [];
|
|
270
|
-
const sizeGroups = new Map();
|
|
271
|
-
for (const file of files) {
|
|
272
|
-
try {
|
|
273
|
-
const stats = await fs.stat(file);
|
|
274
|
-
const size = stats.size;
|
|
275
|
-
if (!sizeGroups.has(size)) {
|
|
276
|
-
sizeGroups.set(size, []);
|
|
277
|
-
}
|
|
278
|
-
sizeGroups.get(size).push(file);
|
|
279
|
-
}
|
|
280
|
-
catch (error) {
|
|
281
|
-
// Skip files that can't be read
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
// Find groups with more than one file (potential duplicates)
|
|
285
|
-
for (const [size, fileList] of sizeGroups.entries()) {
|
|
286
|
-
if (fileList.length > 1 && size > 0) {
|
|
287
|
-
duplicates.push({
|
|
288
|
-
type: 'potential-duplicate',
|
|
289
|
-
files: fileList,
|
|
290
|
-
size,
|
|
291
|
-
similarity: 0.8, // Mock similarity score
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
return duplicates;
|
|
296
|
-
}
|
|
297
|
-
async analyzeCodeQuality(files) {
|
|
298
|
-
await Promise.resolve(); // Add await expression to satisfy linter
|
|
299
|
-
// Simple code quality analysis
|
|
300
|
-
let circularDependencies = 0;
|
|
301
|
-
let codeSmells = 0;
|
|
302
|
-
let technicalDebt = 0;
|
|
303
|
-
// Mock analysis based on file patterns
|
|
304
|
-
for (const file of files) {
|
|
305
|
-
if (file.includes('legacy') || file.includes('old')) {
|
|
306
|
-
technicalDebt += 10;
|
|
307
|
-
}
|
|
308
|
-
if (file.includes('temp') || file.includes('hack')) {
|
|
309
|
-
codeSmells += 5;
|
|
310
|
-
}
|
|
311
|
-
// Simple circular dependency detection would require AST parsing
|
|
312
|
-
// For now, just mock some results
|
|
313
|
-
if (Math.random() < 0.1) {
|
|
314
|
-
circularDependencies += 1;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
return {
|
|
318
|
-
circularDependencies,
|
|
319
|
-
codeSmells,
|
|
320
|
-
technicalDebt,
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
async generateReports(analysisReport, duplicates, qualityMetrics) {
|
|
324
|
-
for (const format of this.config.outputFormats) {
|
|
325
|
-
const reportData = {
|
|
326
|
-
analysis: analysisReport,
|
|
327
|
-
duplicates,
|
|
328
|
-
quality: qualityMetrics,
|
|
329
|
-
timestamp: new Date(),
|
|
330
|
-
config: this.config,
|
|
331
|
-
};
|
|
332
|
-
switch (format) {
|
|
333
|
-
case 'json':
|
|
334
|
-
await fs.writeJSON(path.join(this.config.outputDir, 'analysis-report.json'), reportData, { spaces: 2 });
|
|
335
|
-
break;
|
|
336
|
-
case 'html':
|
|
337
|
-
await this.generateHtmlReport(reportData);
|
|
338
|
-
break;
|
|
339
|
-
case 'markdown':
|
|
340
|
-
await this.generateMarkdownReport(reportData);
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
async generateHtmlReport(data) {
|
|
346
|
-
const html = `
|
|
347
|
-
<!DOCTYPE html>
|
|
348
|
-
<html>
|
|
349
|
-
<head>
|
|
350
|
-
<title>Analysis Report</title>
|
|
351
|
-
<style>
|
|
352
|
-
body { font-family: Arial, sans-serif; margin: 20px; }
|
|
353
|
-
.summary { background: #f5f5f5; padding: 15px; border-radius: 5px; }
|
|
354
|
-
.metric { display: inline-block; margin: 10px; }
|
|
355
|
-
</style>
|
|
356
|
-
</head>
|
|
357
|
-
<body>
|
|
358
|
-
<h1>Code Analysis Report</h1>
|
|
359
|
-
<div class="summary">
|
|
360
|
-
<h2>Summary</h2>
|
|
361
|
-
<div class="metric">Total Files: <strong>${data.analysis.totalFiles}</strong></div>
|
|
362
|
-
<div class="metric">Issues Found: <strong>${data.analysis.summary.totalIssues}</strong></div>
|
|
363
|
-
<div class="metric">Duplicates: <strong>${data.duplicates.length}</strong></div>
|
|
364
|
-
<div class="metric">Code Smells: <strong>${data.quality.codeSmells}</strong></div>
|
|
365
|
-
</div>
|
|
366
|
-
<p>Generated on: ${data.timestamp.toString()}</p>
|
|
367
|
-
</body>
|
|
368
|
-
</html>`;
|
|
369
|
-
await fs.writeFile(path.join(this.config.outputDir, 'analysis-report.html'), html);
|
|
370
|
-
}
|
|
371
|
-
async generateMarkdownReport(data) {
|
|
372
|
-
const markdown = `# Code Analysis Report
|
|
373
|
-
|
|
374
|
-
## Summary
|
|
375
|
-
|
|
376
|
-
- **Total Files**: ${data.analysis.totalFiles}
|
|
377
|
-
- **Issues Found**: ${data.analysis.summary.totalIssues}
|
|
378
|
-
- **Duplicates**: ${data.duplicates.length}
|
|
379
|
-
- **Code Smells**: ${data.quality.codeSmells}
|
|
380
|
-
- **Technical Debt**: ${data.quality.technicalDebt}
|
|
381
|
-
|
|
382
|
-
## Analysis Details
|
|
383
|
-
|
|
384
|
-
### Issues by Severity
|
|
385
|
-
- Critical: ${data.analysis.summary.criticalIssues}
|
|
386
|
-
- Error: ${data.analysis.summary.errorIssues}
|
|
387
|
-
- Warning: ${data.analysis.summary.warningIssues}
|
|
388
|
-
- Info: ${data.analysis.summary.infoIssues}
|
|
389
|
-
|
|
390
|
-
### Quality Metrics
|
|
391
|
-
- Circular Dependencies: ${data.quality.circularDependencies}
|
|
392
|
-
- Code Smells: ${data.quality.codeSmells}
|
|
393
|
-
- Technical Debt Score: ${data.quality.technicalDebt}
|
|
394
|
-
|
|
395
|
-
---
|
|
396
|
-
*Generated on: ${data.timestamp.toString()}*
|
|
397
|
-
`;
|
|
398
|
-
await fs.writeFile(path.join(this.config.outputDir, 'analysis-report.md'), markdown);
|
|
399
|
-
}
|
|
400
|
-
chunkArray(array, chunkSize) {
|
|
401
|
-
const chunks = [];
|
|
402
|
-
for (let i = 0; i < array.length; i += chunkSize) {
|
|
403
|
-
chunks.push(array.slice(i, i + chunkSize));
|
|
404
|
-
}
|
|
405
|
-
return chunks;
|
|
406
|
-
}
|
|
407
|
-
async cleanup() {
|
|
408
|
-
// Cleanup workers
|
|
409
|
-
for (const worker of this.workers) {
|
|
410
|
-
await worker.terminate();
|
|
411
|
-
}
|
|
412
|
-
this.workers = [];
|
|
413
|
-
// Clear cache
|
|
414
|
-
this.cache.clear();
|
|
415
|
-
this.emit('cleanup-complete');
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
exports.OptimizedBaseAnalysisService = OptimizedBaseAnalysisService;
|
|
419
|
-
//# sourceMappingURL=BaseAnalysisServiceOptimizations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAnalysisServiceOptimizations.js","sourceRoot":"","sources":["../../src/analyzers/BaseAnalysisServiceOptimizations.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,mCAAsC;AACtC,mDAA6B;AAE7B,qDAA+B;AAC/B,+BAA4B;AAE5B,mCAAuC;AA0EvC;;GAEG;AACH,MAAa,4BAA6B,SAAQ,qBAAY;IAO5D,YAAY,MAA+B;QACzC,KAAK,EAAE,CAAC;QALF,YAAO,GAAa,EAAE,CAAC;QACvB,UAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;QACnC,kBAAa,GAAG,KAAK,CAAC;QAI5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAY,EAAE,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,UAAU;QACd,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YAC7B,OAAO;QACP,CAAC;QAEG,iCAAiC;QACjC,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAE1C,mDAAmD;QACnD,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;YAC1C,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC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