@wundr.io/analysis-engine-simple 1.0.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wundr.io/analysis-engine-simple",
3
- "version": "1.0.1",
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": "^1.0.0"
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-plugin-jest": "^27.9.0",
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
- "prettier": "^3.3.3"
34
+ "jest": "^29.7.0",
35
+ "prettier": "^3.3.3",
36
+ "typescript": "^5.2.2"
37
37
  },
38
38
  "publishConfig": {
39
39
  "access": "public"
@@ -56,17 +56,21 @@ export interface AnalyzerConfig {
56
56
  }
57
57
 
58
58
  export class CodeAnalyzer {
59
- constructor(_config?: Record<string, AnalyzerConfig>) {
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 filePaths.slice(0, 5)) { // Limit for demo
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: Math.min(5, filePaths.length),
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
+ };