@planu/cli 0.37.0 → 0.38.0
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/config/license-plans.json +2 -1
- package/dist/engine/reverse-engineer/api-detector.d.ts +3 -0
- package/dist/engine/reverse-engineer/api-detector.d.ts.map +1 -0
- package/dist/engine/reverse-engineer/api-detector.js +170 -0
- package/dist/engine/reverse-engineer/api-detector.js.map +1 -0
- package/dist/engine/reverse-engineer/complexity-analyzer.d.ts +3 -0
- package/dist/engine/reverse-engineer/complexity-analyzer.d.ts.map +1 -0
- package/dist/engine/reverse-engineer/complexity-analyzer.js +230 -0
- package/dist/engine/reverse-engineer/complexity-analyzer.js.map +1 -0
- package/dist/engine/reverse-engineer/config-analyzer.d.ts +3 -0
- package/dist/engine/reverse-engineer/config-analyzer.d.ts.map +1 -0
- package/dist/engine/reverse-engineer/config-analyzer.js +247 -0
- package/dist/engine/reverse-engineer/config-analyzer.js.map +1 -0
- package/dist/engine/reverse-engineer/dependency-graph.d.ts +3 -0
- package/dist/engine/reverse-engineer/dependency-graph.d.ts.map +1 -0
- package/dist/engine/reverse-engineer/dependency-graph.js +197 -0
- package/dist/engine/reverse-engineer/dependency-graph.js.map +1 -0
- package/dist/engine/reverse-engineer/index.d.ts +7 -0
- package/dist/engine/reverse-engineer/index.d.ts.map +1 -0
- package/dist/engine/reverse-engineer/index.js +7 -0
- package/dist/engine/reverse-engineer/index.js.map +1 -0
- package/dist/engine/reverse-engineer/orchestrator.d.ts +5 -0
- package/dist/engine/reverse-engineer/orchestrator.d.ts.map +1 -0
- package/dist/engine/reverse-engineer/orchestrator.js +200 -0
- package/dist/engine/reverse-engineer/orchestrator.js.map +1 -0
- package/dist/engine/reverse-engineer/test-analyzer.d.ts +4 -0
- package/dist/engine/reverse-engineer/test-analyzer.d.ts.map +1 -0
- package/dist/engine/reverse-engineer/test-analyzer.js +130 -0
- package/dist/engine/reverse-engineer/test-analyzer.js.map +1 -0
- package/dist/engine/spec-kit-exporter.d.ts +6 -0
- package/dist/engine/spec-kit-exporter.d.ts.map +1 -0
- package/dist/engine/spec-kit-exporter.js +227 -0
- package/dist/engine/spec-kit-exporter.js.map +1 -0
- package/dist/engine/spec-migrator.d.ts +9 -0
- package/dist/engine/spec-migrator.d.ts.map +1 -1
- package/dist/engine/spec-migrator.js +70 -0
- package/dist/engine/spec-migrator.js.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/tools/create-spec/spec-builder.js +1 -1
- package/dist/tools/create-spec/spec-builder.js.map +1 -1
- package/dist/tools/export-spec.d.ts +3 -0
- package/dist/tools/export-spec.d.ts.map +1 -0
- package/dist/tools/export-spec.js +110 -0
- package/dist/tools/export-spec.js.map +1 -0
- package/dist/tools/init-project/handler.d.ts.map +1 -1
- package/dist/tools/init-project/handler.js +11 -1
- package/dist/tools/init-project/handler.js.map +1 -1
- package/dist/tools/init-project/result-builder.d.ts.map +1 -1
- package/dist/tools/init-project/result-builder.js +1 -0
- package/dist/tools/init-project/result-builder.js.map +1 -1
- package/dist/tools/register-export-tools.d.ts +3 -0
- package/dist/tools/register-export-tools.d.ts.map +1 -0
- package/dist/tools/register-export-tools.js +21 -0
- package/dist/tools/register-export-tools.js.map +1 -0
- package/dist/tools/register-spec-tools/core-spec-tools.d.ts.map +1 -1
- package/dist/tools/register-spec-tools/core-spec-tools.js +4 -1
- package/dist/tools/register-spec-tools/core-spec-tools.js.map +1 -1
- package/dist/tools/reverse-engineer/handler.d.ts.map +1 -1
- package/dist/tools/reverse-engineer/handler.js +156 -128
- package/dist/tools/reverse-engineer/handler.js.map +1 -1
- package/dist/transports/http-transport.d.ts +7 -0
- package/dist/transports/http-transport.d.ts.map +1 -0
- package/dist/transports/http-transport.js +170 -0
- package/dist/transports/http-transport.js.map +1 -0
- package/dist/transports/index.d.ts +4 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/dist/transports/index.js +4 -0
- package/dist/transports/index.js.map +1 -0
- package/dist/transports/transport-factory.d.ts +5 -0
- package/dist/transports/transport-factory.d.ts.map +1 -0
- package/dist/transports/transport-factory.js +48 -0
- package/dist/transports/transport-factory.js.map +1 -0
- package/dist/types/estimation.d.ts +1 -1
- package/dist/types/estimation.d.ts.map +1 -1
- package/dist/types/export.d.ts +24 -0
- package/dist/types/export.d.ts.map +1 -0
- package/dist/types/export.js +3 -0
- package/dist/types/export.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/project/planu-config.d.ts +4 -0
- package/dist/types/project/planu-config.d.ts.map +1 -1
- package/dist/types/reverse-engineer.d.ts +90 -0
- package/dist/types/reverse-engineer.d.ts.map +1 -0
- package/dist/types/reverse-engineer.js +3 -0
- package/dist/types/reverse-engineer.js.map +1 -0
- package/dist/types/transport.d.ts +14 -0
- package/dist/types/transport.d.ts.map +1 -0
- package/dist/types/transport.js +2 -0
- package/dist/types/transport.js.map +1 -0
- package/package.json +11 -2
- package/src/config/license-plans.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-detector.d.ts","sourceRoot":"","sources":["../../../src/engine/reverse-engineer/api-detector.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAgB,MAAM,iCAAiC,CAAC;AA4I9E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,CA8C3D"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
const ROUTE_PATTERNS = [
|
|
4
|
+
// Express/Koa/Hono: app.get('/path', handler) or router.post(...)
|
|
5
|
+
{
|
|
6
|
+
regex: /(?:app|router|server)\.(get|post|put|patch|delete|head|options|all)\s*\(\s*['"`]([^'"`]+)['"`](?:\s*,\s*(\w+))?/gi,
|
|
7
|
+
methodGroup: 1,
|
|
8
|
+
pathGroup: 2,
|
|
9
|
+
handlerGroup: 3,
|
|
10
|
+
},
|
|
11
|
+
// Fastify: fastify.get('/path', opts, handler)
|
|
12
|
+
{
|
|
13
|
+
regex: /fastify\.(get|post|put|patch|delete|head|options)\s*\(\s*['"`]([^'"`]+)['"`]/gi,
|
|
14
|
+
methodGroup: 1,
|
|
15
|
+
pathGroup: 2,
|
|
16
|
+
},
|
|
17
|
+
// Next.js App Router: export async function GET/POST/PUT/DELETE
|
|
18
|
+
{
|
|
19
|
+
regex: /export\s+(?:async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s*\(/gi,
|
|
20
|
+
methodGroup: 1,
|
|
21
|
+
pathGroup: -1, // derived from file path
|
|
22
|
+
},
|
|
23
|
+
// Django: path('url/', view)
|
|
24
|
+
{
|
|
25
|
+
regex: /path\s*\(\s*['"]([^'"]+)['"](?:\s*,\s*(\w+))?/gi,
|
|
26
|
+
methodGroup: -1,
|
|
27
|
+
pathGroup: 1,
|
|
28
|
+
handlerGroup: 2,
|
|
29
|
+
defaultMethod: 'ALL',
|
|
30
|
+
},
|
|
31
|
+
// Flask: @app.route('/path', methods=['GET'])
|
|
32
|
+
{
|
|
33
|
+
regex: /@(?:app|bp|blueprint)\.route\s*\(\s*['"]([^'"]+)['"]\s*(?:,\s*methods\s*=\s*\[['"](\w+)['"])?/gi,
|
|
34
|
+
methodGroup: 2,
|
|
35
|
+
pathGroup: 1,
|
|
36
|
+
},
|
|
37
|
+
// Go net/http: http.HandleFunc("/path", handler)
|
|
38
|
+
{
|
|
39
|
+
regex: /http\.(?:HandleFunc|Handle)\s*\(\s*['"]([^'"]+)['"](?:\s*,\s*(\w+))?/gi,
|
|
40
|
+
methodGroup: -1,
|
|
41
|
+
pathGroup: 1,
|
|
42
|
+
handlerGroup: 2,
|
|
43
|
+
defaultMethod: 'ALL',
|
|
44
|
+
},
|
|
45
|
+
// Gin: r.GET("/path", handler)
|
|
46
|
+
{
|
|
47
|
+
regex: /(?:r|g|router|group)\.(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s*\(\s*['"]([^'"]+)['"](?:\s*,\s*(\w+))?/gi,
|
|
48
|
+
methodGroup: 1,
|
|
49
|
+
pathGroup: 2,
|
|
50
|
+
handlerGroup: 3,
|
|
51
|
+
},
|
|
52
|
+
// Spring Boot: @GetMapping("/path"), @RequestMapping
|
|
53
|
+
{
|
|
54
|
+
regex: /@(Get|Post|Put|Patch|Delete|Request)Mapping\s*\(\s*(?:value\s*=\s*)?['"]([^'"]+)['"]/gi,
|
|
55
|
+
methodGroup: 1,
|
|
56
|
+
pathGroup: 2,
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
const SOURCE_EXTENSIONS = new Set([
|
|
60
|
+
'.ts',
|
|
61
|
+
'.tsx',
|
|
62
|
+
'.js',
|
|
63
|
+
'.jsx',
|
|
64
|
+
'.mjs',
|
|
65
|
+
'.cjs',
|
|
66
|
+
'.py',
|
|
67
|
+
'.go',
|
|
68
|
+
'.java',
|
|
69
|
+
'.kt',
|
|
70
|
+
'.rb',
|
|
71
|
+
]);
|
|
72
|
+
const IGNORE_DIRS = new Set([
|
|
73
|
+
'node_modules',
|
|
74
|
+
'.git',
|
|
75
|
+
'dist',
|
|
76
|
+
'build',
|
|
77
|
+
'out',
|
|
78
|
+
'.next',
|
|
79
|
+
'.nuxt',
|
|
80
|
+
'coverage',
|
|
81
|
+
'vendor',
|
|
82
|
+
'__pycache__',
|
|
83
|
+
]);
|
|
84
|
+
function collectSourceFiles(dir) {
|
|
85
|
+
const results = [];
|
|
86
|
+
const queue = [dir];
|
|
87
|
+
while (queue.length > 0) {
|
|
88
|
+
const current = queue.pop();
|
|
89
|
+
if (!current) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
let entries;
|
|
93
|
+
try {
|
|
94
|
+
entries = fs.readdirSync(current, { withFileTypes: true });
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
for (const entry of entries) {
|
|
100
|
+
if (IGNORE_DIRS.has(entry.name)) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const full = path.join(current, entry.name);
|
|
104
|
+
if (entry.isDirectory()) {
|
|
105
|
+
queue.push(full);
|
|
106
|
+
}
|
|
107
|
+
else if (entry.isFile() && SOURCE_EXTENSIONS.has(path.extname(entry.name))) {
|
|
108
|
+
results.push(full);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return results;
|
|
113
|
+
}
|
|
114
|
+
function extractResource(routePath) {
|
|
115
|
+
const segments = routePath.replace(/^\//, '').split('/');
|
|
116
|
+
const first = segments[0] ?? '';
|
|
117
|
+
// Strip params like :id or {id}
|
|
118
|
+
return first.replace(/[:{].*$/, '') || 'root';
|
|
119
|
+
}
|
|
120
|
+
function normalizeMethod(raw) {
|
|
121
|
+
const upper = raw.toUpperCase();
|
|
122
|
+
if (upper === 'REQUEST') {
|
|
123
|
+
return 'ALL';
|
|
124
|
+
}
|
|
125
|
+
return upper;
|
|
126
|
+
}
|
|
127
|
+
function derivePathFromFile(filePath, rootDir) {
|
|
128
|
+
// Next.js convention: app/api/users/route.ts -> /api/users
|
|
129
|
+
const rel = path.relative(rootDir, filePath);
|
|
130
|
+
const dir = path.dirname(rel);
|
|
131
|
+
return '/' + dir.replace(/\\/g, '/');
|
|
132
|
+
}
|
|
133
|
+
export function detectApiRoutes(rootDir) {
|
|
134
|
+
const files = collectSourceFiles(rootDir);
|
|
135
|
+
const routes = [];
|
|
136
|
+
for (const file of files) {
|
|
137
|
+
let content;
|
|
138
|
+
try {
|
|
139
|
+
content = fs.readFileSync(file, 'utf-8');
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
for (const pattern of ROUTE_PATTERNS) {
|
|
145
|
+
const regex = new RegExp(pattern.regex.source, pattern.regex.flags);
|
|
146
|
+
let match;
|
|
147
|
+
while ((match = regex.exec(content)) !== null) {
|
|
148
|
+
const methodRaw = pattern.methodGroup === -1
|
|
149
|
+
? (pattern.defaultMethod ?? 'ALL')
|
|
150
|
+
: (match[pattern.methodGroup] ?? 'ALL');
|
|
151
|
+
const routePath = pattern.pathGroup === -1
|
|
152
|
+
? derivePathFromFile(file, rootDir)
|
|
153
|
+
: (match[pattern.pathGroup] ?? '/');
|
|
154
|
+
const handler = pattern.handlerGroup
|
|
155
|
+
? (match[pattern.handlerGroup] ?? 'anonymous')
|
|
156
|
+
: 'anonymous';
|
|
157
|
+
routes.push({
|
|
158
|
+
method: normalizeMethod(methodRaw),
|
|
159
|
+
path: routePath,
|
|
160
|
+
handler,
|
|
161
|
+
resource: extractResource(routePath),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return routes.sort((a, b) => a.resource.localeCompare(b.resource) ||
|
|
167
|
+
a.path.localeCompare(b.path) ||
|
|
168
|
+
a.method.localeCompare(b.method));
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=api-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-detector.js","sourceRoot":"","sources":["../../../src/engine/reverse-engineer/api-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,MAAM,cAAc,GAAmB;IACrC,kEAAkE;IAClE;QACE,KAAK,EACH,mHAAmH;QACrH,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;KAChB;IACD,+CAA+C;IAC/C;QACE,KAAK,EAAE,gFAAgF;QACvF,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,CAAC;KACb;IACD,gEAAgE;IAChE;QACE,KAAK,EAAE,kFAAkF;QACzF,WAAW,EAAE,CAAC;QACd,SA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AC,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,CAAC;gBAE5C,MAAM,SAAS,GACb,OAAO,CAAC,SAAS,KAAK,CAAC,CAAC;oBACtB,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC;oBACnC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC;gBAExC,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY;oBAClC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC;oBAC9C,CAAC,CAAC,WAAW,CAAC;gBAEhB,MAAM,CAAC,IAAI,CAAC;oBACV,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC;oBAClC,IAAI,EAAE,SAAS;oBACf,OAAO;oBACP,QAAQ,EAAE,eAAe,CAAC,SAAS,CAAC;iBACrC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAChB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACP,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC;QACpC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5B,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexity-analyzer.d.ts","sourceRoot":"","sources":["../../../src/engine/reverse-engineer/complexity-analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,iCAAiC,CAAC;AA+MzC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAyCrE"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
const SOURCE_EXTENSIONS = new Set([
|
|
4
|
+
'.ts',
|
|
5
|
+
'.tsx',
|
|
6
|
+
'.js',
|
|
7
|
+
'.jsx',
|
|
8
|
+
'.mjs',
|
|
9
|
+
'.cjs',
|
|
10
|
+
'.py',
|
|
11
|
+
'.go',
|
|
12
|
+
'.java',
|
|
13
|
+
'.kt',
|
|
14
|
+
'.rs',
|
|
15
|
+
'.rb',
|
|
16
|
+
]);
|
|
17
|
+
const IGNORE_DIRS = new Set([
|
|
18
|
+
'node_modules',
|
|
19
|
+
'.git',
|
|
20
|
+
'dist',
|
|
21
|
+
'build',
|
|
22
|
+
'out',
|
|
23
|
+
'.next',
|
|
24
|
+
'.nuxt',
|
|
25
|
+
'coverage',
|
|
26
|
+
'vendor',
|
|
27
|
+
'__pycache__',
|
|
28
|
+
]);
|
|
29
|
+
// Patterns that increase cyclomatic complexity
|
|
30
|
+
const BRANCH_PATTERNS = [
|
|
31
|
+
/\bif\s*\(/g,
|
|
32
|
+
/\belse\s+if\s*\(/g,
|
|
33
|
+
/\belse\s*\{/g,
|
|
34
|
+
/\bswitch\s*\(/g,
|
|
35
|
+
/\bcase\s+/g,
|
|
36
|
+
/\bfor\s*\(/g,
|
|
37
|
+
/\bfor\s+\w+/g, // Go/Python for
|
|
38
|
+
/\bwhile\s*\(/g,
|
|
39
|
+
/\bcatch\s*\(/g,
|
|
40
|
+
/\?\?/g, // nullish coalescing
|
|
41
|
+
/&&/g,
|
|
42
|
+
/\|\|/g,
|
|
43
|
+
/\?\s*[^:?]/g, // ternary (approximate)
|
|
44
|
+
];
|
|
45
|
+
// Function declaration patterns
|
|
46
|
+
const FUNCTION_PATTERNS = [
|
|
47
|
+
// JS/TS: function name(, async function name(, export function
|
|
48
|
+
/(?:export\s+)?(?:async\s+)?function\s+\w+\s*\(/g,
|
|
49
|
+
// Arrow functions assigned: const name = (...) =>
|
|
50
|
+
/(?:const|let|var)\s+\w+\s*=\s*(?:async\s+)?\([^)]*\)\s*=>/g,
|
|
51
|
+
// Method definitions: name( or async name(
|
|
52
|
+
/^\s+(?:async\s+)?(?:static\s+)?(?:get\s+|set\s+)?\w+\s*\([^)]*\)\s*(?::\s*\w[^{]*)?{/gm,
|
|
53
|
+
// Python: def name(
|
|
54
|
+
/\bdef\s+\w+\s*\(/g,
|
|
55
|
+
// Go: func name(
|
|
56
|
+
/\bfunc\s+(?:\([^)]*\)\s*)?\w+\s*\(/g,
|
|
57
|
+
// Java: public/private/protected ... name(
|
|
58
|
+
/(?:public|private|protected)\s+(?:static\s+)?[\w<>[\]]+\s+\w+\s*\(/g,
|
|
59
|
+
];
|
|
60
|
+
function collectSourceFiles(dir) {
|
|
61
|
+
const results = [];
|
|
62
|
+
const queue = [dir];
|
|
63
|
+
while (queue.length > 0) {
|
|
64
|
+
const current = queue.pop();
|
|
65
|
+
if (!current) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
let entries;
|
|
69
|
+
try {
|
|
70
|
+
entries = fs.readdirSync(current, { withFileTypes: true });
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
if (IGNORE_DIRS.has(entry.name)) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const full = path.join(current, entry.name);
|
|
80
|
+
if (entry.isDirectory()) {
|
|
81
|
+
queue.push(full);
|
|
82
|
+
}
|
|
83
|
+
else if (entry.isFile() && SOURCE_EXTENSIONS.has(path.extname(entry.name))) {
|
|
84
|
+
results.push(full);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return results;
|
|
89
|
+
}
|
|
90
|
+
function countBranches(content) {
|
|
91
|
+
let count = 0;
|
|
92
|
+
for (const pattern of BRANCH_PATTERNS) {
|
|
93
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
94
|
+
while (regex.exec(content) !== null) {
|
|
95
|
+
count++;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return count + 1; // base complexity of 1
|
|
99
|
+
}
|
|
100
|
+
function extractFunctions(content) {
|
|
101
|
+
const lines = content.split('\n');
|
|
102
|
+
const functions = [];
|
|
103
|
+
for (const pattern of FUNCTION_PATTERNS) {
|
|
104
|
+
const regex = new RegExp(pattern.source, pattern.flags);
|
|
105
|
+
let match;
|
|
106
|
+
while ((match = regex.exec(content)) !== null) {
|
|
107
|
+
const startOffset = match.index;
|
|
108
|
+
const startLine = content.substring(0, startOffset).split('\n').length;
|
|
109
|
+
const name = extractFunctionName(match[0]);
|
|
110
|
+
// Estimate function end by counting braces
|
|
111
|
+
const endLine = findFunctionEnd(lines, startLine - 1);
|
|
112
|
+
const funcLines = endLine - startLine + 1;
|
|
113
|
+
const funcContent = lines.slice(startLine - 1, endLine).join('\n');
|
|
114
|
+
const complexity = countBranches(funcContent);
|
|
115
|
+
functions.push({
|
|
116
|
+
name,
|
|
117
|
+
startLine,
|
|
118
|
+
endLine,
|
|
119
|
+
lines: funcLines,
|
|
120
|
+
complexity,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Deduplicate overlapping detections (keep longest)
|
|
125
|
+
return deduplicateFunctions(functions);
|
|
126
|
+
}
|
|
127
|
+
function extractFunctionName(declaration) {
|
|
128
|
+
const patterns = [
|
|
129
|
+
/function\s+(\w+)/,
|
|
130
|
+
/(?:const|let|var)\s+(\w+)/,
|
|
131
|
+
/def\s+(\w+)/,
|
|
132
|
+
/func\s+(?:\([^)]*\)\s*)?(\w+)/,
|
|
133
|
+
/\s(\w+)\s*\(/,
|
|
134
|
+
];
|
|
135
|
+
for (const p of patterns) {
|
|
136
|
+
const m = declaration.match(p);
|
|
137
|
+
if (m?.[1]) {
|
|
138
|
+
return m[1];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return 'anonymous';
|
|
142
|
+
}
|
|
143
|
+
function findFunctionEnd(lines, startIdx) {
|
|
144
|
+
let braceCount = 0;
|
|
145
|
+
let foundOpen = false;
|
|
146
|
+
for (let i = startIdx; i < lines.length; i++) {
|
|
147
|
+
const line = lines[i] ?? '';
|
|
148
|
+
for (const ch of line) {
|
|
149
|
+
if (ch === '{') {
|
|
150
|
+
braceCount++;
|
|
151
|
+
foundOpen = true;
|
|
152
|
+
}
|
|
153
|
+
else if (ch === '}') {
|
|
154
|
+
braceCount--;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (foundOpen && braceCount <= 0) {
|
|
158
|
+
return i + 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// For Python/other non-brace languages, estimate ~20 lines
|
|
162
|
+
return Math.min(startIdx + 20, lines.length);
|
|
163
|
+
}
|
|
164
|
+
function deduplicateFunctions(functions) {
|
|
165
|
+
if (functions.length === 0) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
// Sort by start line
|
|
169
|
+
const sorted = [...functions].sort((a, b) => a.startLine - b.startLine);
|
|
170
|
+
const first = sorted[0];
|
|
171
|
+
if (!first) {
|
|
172
|
+
return [];
|
|
173
|
+
}
|
|
174
|
+
const result = [first];
|
|
175
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
176
|
+
const prev = result[result.length - 1];
|
|
177
|
+
const curr = sorted[i];
|
|
178
|
+
if (!prev || !curr) {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
// If overlapping, keep the one with more lines
|
|
182
|
+
if (curr.startLine <= prev.endLine) {
|
|
183
|
+
if (curr.lines > prev.lines) {
|
|
184
|
+
result[result.length - 1] = curr;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
result.push(curr);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
export function analyzeComplexity(rootDir) {
|
|
194
|
+
const files = collectSourceFiles(rootDir);
|
|
195
|
+
const metrics = [];
|
|
196
|
+
for (const file of files) {
|
|
197
|
+
let content;
|
|
198
|
+
try {
|
|
199
|
+
content = fs.readFileSync(file, 'utf-8');
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
const lines = content.split('\n');
|
|
205
|
+
const lineCount = lines.length;
|
|
206
|
+
const functions = extractFunctions(content);
|
|
207
|
+
const functionCount = functions.length;
|
|
208
|
+
const maxFunctionLength = functions.reduce((max, f) => Math.max(max, f.lines), 0);
|
|
209
|
+
const avgComplexity = functionCount > 0
|
|
210
|
+
? Math.round((functions.reduce((sum, f) => sum + f.complexity, 0) / functionCount) * 100) /
|
|
211
|
+
100
|
|
212
|
+
: 0;
|
|
213
|
+
// Flag hotspots: functions > 80 lines or > 15 complexity
|
|
214
|
+
const hotspots = functions
|
|
215
|
+
.filter((f) => f.lines > 80 || f.complexity > 15)
|
|
216
|
+
.map((f) => ({ name: f.name, complexity: f.complexity, lines: f.lines }))
|
|
217
|
+
.sort((a, b) => b.complexity - a.complexity);
|
|
218
|
+
metrics.push({
|
|
219
|
+
file: path.relative(rootDir, file),
|
|
220
|
+
lineCount,
|
|
221
|
+
functionCount,
|
|
222
|
+
maxFunctionLength,
|
|
223
|
+
avgComplexity,
|
|
224
|
+
hotspots,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
// Return top 10 by complexity
|
|
228
|
+
return metrics.sort((a, b) => b.avgComplexity - a.avgComplexity).slice(0, 10);
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=complexity-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexity-analyzer.js","sourceRoot":"","sources":["../../../src/engine/reverse-engineer/complexity-analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAOlC,MAAM,iBAAiB,GAAG,IAAI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