@mycodemap/mycodemap 0.1.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/CHANGELOG.md +17 -0
- package/LICENSE +21 -0
- package/README.md +559 -0
- package/dist/ai/claude.d.ts +38 -0
- package/dist/ai/claude.d.ts.map +1 -0
- package/dist/ai/claude.js +169 -0
- package/dist/ai/claude.js.map +1 -0
- package/dist/ai/codex.d.ts +38 -0
- package/dist/ai/codex.d.ts.map +1 -0
- package/dist/ai/codex.js +169 -0
- package/dist/ai/codex.js.map +1 -0
- package/dist/ai/factory.d.ts +48 -0
- package/dist/ai/factory.d.ts.map +1 -0
- package/dist/ai/factory.js +95 -0
- package/dist/ai/factory.js.map +1 -0
- package/dist/ai/index.d.ts +12 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +29 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/provider.d.ts +70 -0
- package/dist/ai/provider.d.ts.map +1 -0
- package/dist/ai/provider.js +31 -0
- package/dist/ai/provider.js.map +1 -0
- package/dist/ai/subagent-caller.d.ts +90 -0
- package/dist/ai/subagent-caller.d.ts.map +1 -0
- package/dist/ai/subagent-caller.js +280 -0
- package/dist/ai/subagent-caller.js.map +1 -0
- package/dist/ai/types.d.ts +70 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +5 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/cache/file-hash-cache.d.ts +76 -0
- package/dist/cache/file-hash-cache.d.ts.map +1 -0
- package/dist/cache/file-hash-cache.js +159 -0
- package/dist/cache/file-hash-cache.js.map +1 -0
- package/dist/cache/index.d.ts +151 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +303 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/lru-cache.d.ts +93 -0
- package/dist/cache/lru-cache.d.ts.map +1 -0
- package/dist/cache/lru-cache.js +194 -0
- package/dist/cache/lru-cache.js.map +1 -0
- package/dist/cache/parse-cache.d.ts +68 -0
- package/dist/cache/parse-cache.d.ts.map +1 -0
- package/dist/cache/parse-cache.js +173 -0
- package/dist/cache/parse-cache.js.map +1 -0
- package/dist/cli/commands/analyze.d.ts +96 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +567 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/ci.d.ts +25 -0
- package/dist/cli/commands/ci.d.ts.map +1 -0
- package/dist/cli/commands/ci.js +481 -0
- package/dist/cli/commands/ci.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +70 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +479 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/cycles.d.ts +10 -0
- package/dist/cli/commands/cycles.d.ts.map +1 -0
- package/dist/cli/commands/cycles.js +202 -0
- package/dist/cli/commands/cycles.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +61 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +340 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/generate.d.ts +8 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +61 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +55 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +455 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +50 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/query.d.ts +22 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +718 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/watch-foreground.d.ts +9 -0
- package/dist/cli/commands/watch-foreground.d.ts.map +1 -0
- package/dist/cli/commands/watch-foreground.js +67 -0
- package/dist/cli/commands/watch-foreground.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +12 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +114 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/workflow.d.ts +25 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +488 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +115 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/paths.d.ts +90 -0
- package/dist/cli/paths.d.ts.map +1 -0
- package/dist/cli/paths.js +136 -0
- package/dist/cli/paths.js.map +1 -0
- package/dist/cli/runtime-logger.d.ts +13 -0
- package/dist/cli/runtime-logger.d.ts.map +1 -0
- package/dist/cli/runtime-logger.js +213 -0
- package/dist/cli/runtime-logger.js.map +1 -0
- package/dist/core/analyzer.d.ts +3 -0
- package/dist/core/analyzer.d.ts.map +1 -0
- package/dist/core/analyzer.js +359 -0
- package/dist/core/analyzer.js.map +1 -0
- package/dist/core/ast-complexity-analyzer.d.ts +40 -0
- package/dist/core/ast-complexity-analyzer.d.ts.map +1 -0
- package/dist/core/ast-complexity-analyzer.js +279 -0
- package/dist/core/ast-complexity-analyzer.js.map +1 -0
- package/dist/core/global-index.d.ts +69 -0
- package/dist/core/global-index.d.ts.map +1 -0
- package/dist/core/global-index.js +388 -0
- package/dist/core/global-index.js.map +1 -0
- package/dist/generator/ai-overview.d.ts +51 -0
- package/dist/generator/ai-overview.d.ts.map +1 -0
- package/dist/generator/ai-overview.js +160 -0
- package/dist/generator/ai-overview.js.map +1 -0
- package/dist/generator/context.d.ts +5 -0
- package/dist/generator/context.d.ts.map +1 -0
- package/dist/generator/context.js +514 -0
- package/dist/generator/context.js.map +1 -0
- package/dist/generator/file-describer.d.ts +93 -0
- package/dist/generator/file-describer.d.ts.map +1 -0
- package/dist/generator/file-describer.js +375 -0
- package/dist/generator/file-describer.js.map +1 -0
- package/dist/generator/index.d.ts +8 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +259 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.d.ts +75 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.js +242 -0
- package/dist/orchestrator/adapters/ast-grep-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/base-adapter.d.ts +24 -0
- package/dist/orchestrator/adapters/base-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/base-adapter.js +2 -0
- package/dist/orchestrator/adapters/base-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/codemap-adapter.d.ts +56 -0
- package/dist/orchestrator/adapters/codemap-adapter.d.ts.map +1 -0
- package/dist/orchestrator/adapters/codemap-adapter.js +163 -0
- package/dist/orchestrator/adapters/codemap-adapter.js.map +1 -0
- package/dist/orchestrator/adapters/index.d.ts +10 -0
- package/dist/orchestrator/adapters/index.d.ts.map +1 -0
- package/dist/orchestrator/adapters/index.js +3 -0
- package/dist/orchestrator/adapters/index.js.map +1 -0
- package/dist/orchestrator/ai-feed-generator.d.ts +210 -0
- package/dist/orchestrator/ai-feed-generator.d.ts.map +1 -0
- package/dist/orchestrator/ai-feed-generator.js +377 -0
- package/dist/orchestrator/ai-feed-generator.js.map +1 -0
- package/dist/orchestrator/commit-validator.d.ts +30 -0
- package/dist/orchestrator/commit-validator.d.ts.map +1 -0
- package/dist/orchestrator/commit-validator.js +87 -0
- package/dist/orchestrator/commit-validator.js.map +1 -0
- package/dist/orchestrator/confidence.d.ts +25 -0
- package/dist/orchestrator/confidence.d.ts.map +1 -0
- package/dist/orchestrator/confidence.js +138 -0
- package/dist/orchestrator/confidence.js.map +1 -0
- package/dist/orchestrator/file-header-scanner.d.ts +48 -0
- package/dist/orchestrator/file-header-scanner.d.ts.map +1 -0
- package/dist/orchestrator/file-header-scanner.js +158 -0
- package/dist/orchestrator/file-header-scanner.js.map +1 -0
- package/dist/orchestrator/git-analyzer.d.ts +192 -0
- package/dist/orchestrator/git-analyzer.d.ts.map +1 -0
- package/dist/orchestrator/git-analyzer.js +539 -0
- package/dist/orchestrator/git-analyzer.js.map +1 -0
- package/dist/orchestrator/index.d.ts +20 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +16 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/intent-router.d.ts +41 -0
- package/dist/orchestrator/intent-router.d.ts.map +1 -0
- package/dist/orchestrator/intent-router.js +98 -0
- package/dist/orchestrator/intent-router.js.map +1 -0
- package/dist/orchestrator/result-fusion.d.ts +114 -0
- package/dist/orchestrator/result-fusion.d.ts.map +1 -0
- package/dist/orchestrator/result-fusion.js +332 -0
- package/dist/orchestrator/result-fusion.js.map +1 -0
- package/dist/orchestrator/test-linker.d.ts +166 -0
- package/dist/orchestrator/test-linker.d.ts.map +1 -0
- package/dist/orchestrator/test-linker.js +570 -0
- package/dist/orchestrator/test-linker.js.map +1 -0
- package/dist/orchestrator/tool-orchestrator.d.ts +108 -0
- package/dist/orchestrator/tool-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/tool-orchestrator.js +247 -0
- package/dist/orchestrator/tool-orchestrator.js.map +1 -0
- package/dist/orchestrator/types.d.ts +162 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +39 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/orchestrator/workflow/ci-executor.d.ts +157 -0
- package/dist/orchestrator/workflow/ci-executor.d.ts.map +1 -0
- package/dist/orchestrator/workflow/ci-executor.js +423 -0
- package/dist/orchestrator/workflow/ci-executor.js.map +1 -0
- package/dist/orchestrator/workflow/config.d.ts +97 -0
- package/dist/orchestrator/workflow/config.d.ts.map +1 -0
- package/dist/orchestrator/workflow/config.js +115 -0
- package/dist/orchestrator/workflow/config.js.map +1 -0
- package/dist/orchestrator/workflow/git-analyzer.d.ts +173 -0
- package/dist/orchestrator/workflow/git-analyzer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/git-analyzer.js +473 -0
- package/dist/orchestrator/workflow/git-analyzer.js.map +1 -0
- package/dist/orchestrator/workflow/index.d.ts +21 -0
- package/dist/orchestrator/workflow/index.d.ts.map +1 -0
- package/dist/orchestrator/workflow/index.js +21 -0
- package/dist/orchestrator/workflow/index.js.map +1 -0
- package/dist/orchestrator/workflow/phase-checkpoint.d.ts +38 -0
- package/dist/orchestrator/workflow/phase-checkpoint.d.ts.map +1 -0
- package/dist/orchestrator/workflow/phase-checkpoint.js +75 -0
- package/dist/orchestrator/workflow/phase-checkpoint.js.map +1 -0
- package/dist/orchestrator/workflow/phase-inheritance.d.ts +128 -0
- package/dist/orchestrator/workflow/phase-inheritance.d.ts.map +1 -0
- package/dist/orchestrator/workflow/phase-inheritance.js +266 -0
- package/dist/orchestrator/workflow/phase-inheritance.js.map +1 -0
- package/dist/orchestrator/workflow/result-fusion.d.ts +117 -0
- package/dist/orchestrator/workflow/result-fusion.d.ts.map +1 -0
- package/dist/orchestrator/workflow/result-fusion.js +246 -0
- package/dist/orchestrator/workflow/result-fusion.js.map +1 -0
- package/dist/orchestrator/workflow/templates.d.ts +116 -0
- package/dist/orchestrator/workflow/templates.d.ts.map +1 -0
- package/dist/orchestrator/workflow/templates.js +546 -0
- package/dist/orchestrator/workflow/templates.js.map +1 -0
- package/dist/orchestrator/workflow/test-linker.d.ts +152 -0
- package/dist/orchestrator/workflow/test-linker.d.ts.map +1 -0
- package/dist/orchestrator/workflow/test-linker.js +342 -0
- package/dist/orchestrator/workflow/test-linker.js.map +1 -0
- package/dist/orchestrator/workflow/types.d.ts +202 -0
- package/dist/orchestrator/workflow/types.d.ts.map +1 -0
- package/dist/orchestrator/workflow/types.js +4 -0
- package/dist/orchestrator/workflow/types.js.map +1 -0
- package/dist/orchestrator/workflow/visualizer.d.ts +56 -0
- package/dist/orchestrator/workflow/visualizer.d.ts.map +1 -0
- package/dist/orchestrator/workflow/visualizer.js +300 -0
- package/dist/orchestrator/workflow/visualizer.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-context.d.ts +50 -0
- package/dist/orchestrator/workflow/workflow-context.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-context.js +105 -0
- package/dist/orchestrator/workflow/workflow-context.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts +126 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.js +489 -0
- package/dist/orchestrator/workflow/workflow-orchestrator.js.map +1 -0
- package/dist/orchestrator/workflow/workflow-persistence.d.ts +38 -0
- package/dist/orchestrator/workflow/workflow-persistence.d.ts.map +1 -0
- package/dist/orchestrator/workflow/workflow-persistence.js +166 -0
- package/dist/orchestrator/workflow/workflow-persistence.js.map +1 -0
- package/dist/parser/implementations/fast-parser.d.ts +65 -0
- package/dist/parser/implementations/fast-parser.d.ts.map +1 -0
- package/dist/parser/implementations/fast-parser.js +299 -0
- package/dist/parser/implementations/fast-parser.js.map +1 -0
- package/dist/parser/implementations/smart-parser.d.ts +220 -0
- package/dist/parser/implementations/smart-parser.d.ts.map +1 -0
- package/dist/parser/implementations/smart-parser.js +1536 -0
- package/dist/parser/implementations/smart-parser.js.map +1 -0
- package/dist/parser/implementations/tree-sitter-parser.d.ts +57 -0
- package/dist/parser/implementations/tree-sitter-parser.d.ts.map +1 -0
- package/dist/parser/implementations/tree-sitter-parser.js +375 -0
- package/dist/parser/implementations/tree-sitter-parser.js.map +1 -0
- package/dist/parser/index.d.ts +19 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +449 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/interfaces/IParser.d.ts +218 -0
- package/dist/parser/interfaces/IParser.d.ts.map +1 -0
- package/dist/parser/interfaces/IParser.js +22 -0
- package/dist/parser/interfaces/IParser.js.map +1 -0
- package/dist/plugins/built-in/call-graph.d.ts +38 -0
- package/dist/plugins/built-in/call-graph.d.ts.map +1 -0
- package/dist/plugins/built-in/call-graph.js +135 -0
- package/dist/plugins/built-in/call-graph.js.map +1 -0
- package/dist/plugins/built-in/complexity-analyzer.d.ts +45 -0
- package/dist/plugins/built-in/complexity-analyzer.d.ts.map +1 -0
- package/dist/plugins/built-in/complexity-analyzer.js +155 -0
- package/dist/plugins/built-in/complexity-analyzer.js.map +1 -0
- package/dist/plugins/index.d.ts +34 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +103 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/plugin-loader.d.ts +22 -0
- package/dist/plugins/plugin-loader.d.ts.map +1 -0
- package/dist/plugins/plugin-loader.js +200 -0
- package/dist/plugins/plugin-loader.js.map +1 -0
- package/dist/plugins/plugin-registry.d.ts +20 -0
- package/dist/plugins/plugin-registry.d.ts.map +1 -0
- package/dist/plugins/plugin-registry.js +143 -0
- package/dist/plugins/plugin-registry.js.map +1 -0
- package/dist/plugins/types.d.ts +72 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +5 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/types/index.d.ts +373 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/watcher/daemon.d.ts +64 -0
- package/dist/watcher/daemon.d.ts.map +1 -0
- package/dist/watcher/daemon.js +189 -0
- package/dist/watcher/daemon.js.map +1 -0
- package/dist/watcher/file-watcher.d.ts +70 -0
- package/dist/watcher/file-watcher.d.ts.map +1 -0
- package/dist/watcher/file-watcher.js +127 -0
- package/dist/watcher/file-watcher.js.map +1 -0
- package/dist/watcher/index.d.ts +5 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/index.js +6 -0
- package/dist/watcher/index.js.map +1 -0
- package/dist/watcher/watch-worker.d.ts +2 -0
- package/dist/watcher/watch-worker.d.ts.map +1 -0
- package/dist/watcher/watch-worker.js +57 -0
- package/dist/watcher/watch-worker.js.map +1 -0
- package/dist/worker/index.d.ts +76 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +155 -0
- package/dist/worker/index.js.map +1 -0
- package/dist/worker/parse-worker.d.ts +2 -0
- package/dist/worker/parse-worker.d.ts.map +1 -0
- package/dist/worker/parse-worker.js +202 -0
- package/dist/worker/parse-worker.js.map +1 -0
- package/mycodemap.config.schema.json +42 -0
- package/package.json +69 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import type { IParser, ParseResult, ParserOptions } from '../interfaces/IParser.js';
|
|
2
|
+
/**
|
|
3
|
+
* Smart Parser - 使用 TypeScript Compiler API 进行深度分析
|
|
4
|
+
*/
|
|
5
|
+
export declare class SmartParser implements IParser {
|
|
6
|
+
readonly name = "smart-parser";
|
|
7
|
+
readonly mode = "smart";
|
|
8
|
+
constructor(_options: ParserOptions);
|
|
9
|
+
/**
|
|
10
|
+
* 解析单个文件
|
|
11
|
+
*/
|
|
12
|
+
parseFile(filePath: string): Promise<ParseResult>;
|
|
13
|
+
/**
|
|
14
|
+
* 批量解析文件
|
|
15
|
+
*/
|
|
16
|
+
parseFiles(filePaths: string[]): Promise<ParseResult[]>;
|
|
17
|
+
/**
|
|
18
|
+
* 释放资源
|
|
19
|
+
*/
|
|
20
|
+
dispose(): void;
|
|
21
|
+
/**
|
|
22
|
+
* 提取导出信息
|
|
23
|
+
*/
|
|
24
|
+
private extractExports;
|
|
25
|
+
/**
|
|
26
|
+
* 检查节点是否可导出
|
|
27
|
+
*/
|
|
28
|
+
private isExportable;
|
|
29
|
+
/**
|
|
30
|
+
* 获取节点名称
|
|
31
|
+
*/
|
|
32
|
+
private getNodeName;
|
|
33
|
+
/**
|
|
34
|
+
* 获取符号类型
|
|
35
|
+
*/
|
|
36
|
+
private getSymbolKind;
|
|
37
|
+
/**
|
|
38
|
+
* 获取字符串字面量
|
|
39
|
+
*/
|
|
40
|
+
private getStringLiteral;
|
|
41
|
+
/**
|
|
42
|
+
* 提取导入信息
|
|
43
|
+
*/
|
|
44
|
+
private extractImports;
|
|
45
|
+
/**
|
|
46
|
+
* 提取符号信息 - 增强版,包含详细签名
|
|
47
|
+
*/
|
|
48
|
+
private extractSymbols;
|
|
49
|
+
/**
|
|
50
|
+
* 创建函数符号 - 包含签名信息
|
|
51
|
+
*/
|
|
52
|
+
private createFunctionSymbol;
|
|
53
|
+
/**
|
|
54
|
+
* 创建类符号 - 包含成员信息
|
|
55
|
+
*/
|
|
56
|
+
private createClassSymbol;
|
|
57
|
+
/**
|
|
58
|
+
* 创建接口符号 - 包含成员信息
|
|
59
|
+
*/
|
|
60
|
+
private createInterfaceSymbol;
|
|
61
|
+
/**
|
|
62
|
+
* 创建类型别名符号
|
|
63
|
+
*/
|
|
64
|
+
private createTypeAliasSymbol;
|
|
65
|
+
/**
|
|
66
|
+
* 创建枚举符号
|
|
67
|
+
*/
|
|
68
|
+
private createEnumSymbol;
|
|
69
|
+
/**
|
|
70
|
+
* 创建变量符号
|
|
71
|
+
*/
|
|
72
|
+
private createVariableSymbol;
|
|
73
|
+
/**
|
|
74
|
+
* 创建基础符号
|
|
75
|
+
*/
|
|
76
|
+
private createBaseSymbol;
|
|
77
|
+
/**
|
|
78
|
+
* 提取 JSDoc 注释
|
|
79
|
+
*/
|
|
80
|
+
private extractJSDoc;
|
|
81
|
+
/**
|
|
82
|
+
* 解析 JSDoc 文本
|
|
83
|
+
*/
|
|
84
|
+
private parseJSDocText;
|
|
85
|
+
/**
|
|
86
|
+
* 处理单个 JSDoc tag
|
|
87
|
+
*/
|
|
88
|
+
private processJSDocTag;
|
|
89
|
+
/**
|
|
90
|
+
* 提取函数签名 - 增强版,包含调用关系
|
|
91
|
+
*/
|
|
92
|
+
private extractFunctionSignature;
|
|
93
|
+
/**
|
|
94
|
+
* 从函数体内提取调用
|
|
95
|
+
*/
|
|
96
|
+
private extractCallsFromFunction;
|
|
97
|
+
/**
|
|
98
|
+
* 提取函数体关键代码片段
|
|
99
|
+
*
|
|
100
|
+
* 参考 Repomix 的 --compress 模式:
|
|
101
|
+
* - 保留控制流结构(if/loop/try/switch)
|
|
102
|
+
* - 省略实现细节,用 // ⋮ 标记
|
|
103
|
+
* - 提取 guard clauses 和早期返回
|
|
104
|
+
*/
|
|
105
|
+
private extractBodySnippets;
|
|
106
|
+
/**
|
|
107
|
+
* 检查是否是 guard clause(早期返回)
|
|
108
|
+
*/
|
|
109
|
+
private isGuardClause;
|
|
110
|
+
/**
|
|
111
|
+
* 压缩代码(保留结构,省略实现)
|
|
112
|
+
*
|
|
113
|
+
* 参考 Repomix 风格:
|
|
114
|
+
* if (condition) {
|
|
115
|
+
* // ⋮ implementation
|
|
116
|
+
* }
|
|
117
|
+
*/
|
|
118
|
+
private compressCode;
|
|
119
|
+
/**
|
|
120
|
+
* 提取类成员
|
|
121
|
+
*/
|
|
122
|
+
private extractClassMembers;
|
|
123
|
+
/**
|
|
124
|
+
* 提取接口成员
|
|
125
|
+
*/
|
|
126
|
+
private extractInterfaceMembers;
|
|
127
|
+
/**
|
|
128
|
+
* 获取成员名称
|
|
129
|
+
*/
|
|
130
|
+
private getMemberName;
|
|
131
|
+
/**
|
|
132
|
+
* 获取可见性
|
|
133
|
+
*/
|
|
134
|
+
private getVisibility;
|
|
135
|
+
/**
|
|
136
|
+
* 检查是否为 static
|
|
137
|
+
*/
|
|
138
|
+
private isStatic;
|
|
139
|
+
/**
|
|
140
|
+
* 检查是否为 abstract
|
|
141
|
+
*/
|
|
142
|
+
private isAbstract;
|
|
143
|
+
/**
|
|
144
|
+
* 检查是否为 readonly
|
|
145
|
+
*/
|
|
146
|
+
private isReadonly;
|
|
147
|
+
/**
|
|
148
|
+
* 提取装饰器信息
|
|
149
|
+
*/
|
|
150
|
+
private extractDecorators;
|
|
151
|
+
/**
|
|
152
|
+
* 解析装饰器,获取名称和参数
|
|
153
|
+
*/
|
|
154
|
+
private parseDecorator;
|
|
155
|
+
/**
|
|
156
|
+
* 解析装饰器参数
|
|
157
|
+
*/
|
|
158
|
+
private parseDecoratorArg;
|
|
159
|
+
/**
|
|
160
|
+
* 解析表达式为 JavaScript 值
|
|
161
|
+
*/
|
|
162
|
+
private parseExpression;
|
|
163
|
+
/**
|
|
164
|
+
* 提取依赖列表
|
|
165
|
+
*/
|
|
166
|
+
private extractDependencies;
|
|
167
|
+
/**
|
|
168
|
+
* 提取类型信息 - 增强版
|
|
169
|
+
*/
|
|
170
|
+
private extractTypeInfo;
|
|
171
|
+
/**
|
|
172
|
+
* 从成员获取类型
|
|
173
|
+
*/
|
|
174
|
+
private getTypeFromMember;
|
|
175
|
+
/**
|
|
176
|
+
* 提取调用图 - 增强版
|
|
177
|
+
*/
|
|
178
|
+
private extractCallGraph;
|
|
179
|
+
/**
|
|
180
|
+
* 提取被调用函数的名称
|
|
181
|
+
*/
|
|
182
|
+
private extractCalleeName;
|
|
183
|
+
/**
|
|
184
|
+
* 计算复杂度
|
|
185
|
+
*/
|
|
186
|
+
private calculateComplexity;
|
|
187
|
+
/**
|
|
188
|
+
* 计算函数圈复杂度
|
|
189
|
+
*/
|
|
190
|
+
private calculateFunctionCyclomatic;
|
|
191
|
+
/**
|
|
192
|
+
* 计算函数认知复杂度
|
|
193
|
+
*/
|
|
194
|
+
private calculateFunctionCognitive;
|
|
195
|
+
/**
|
|
196
|
+
* 计算可维护性指数 (Microsoft Maintainability Index)
|
|
197
|
+
*
|
|
198
|
+
* 基于微软的可维护性指数公式进行适应性调整:
|
|
199
|
+
* MI = MAX(0, (171 - 5.2 * ln(Halstead Volume) - 0.23 * Cyclomatic - 16.2 * ln(LOC)) * 100 / 171)
|
|
200
|
+
*
|
|
201
|
+
* 简化版本(无需 Halstead Volume):
|
|
202
|
+
* - 基于圈复杂度和代码行数计算
|
|
203
|
+
* - 结果范围 0-100
|
|
204
|
+
* - 考虑了文件大小和复杂度的平衡
|
|
205
|
+
*/
|
|
206
|
+
private calculateMaintainabilityIndex;
|
|
207
|
+
/**
|
|
208
|
+
* 获取模块类型
|
|
209
|
+
*/
|
|
210
|
+
private getModuleType;
|
|
211
|
+
/**
|
|
212
|
+
* 获取文件统计
|
|
213
|
+
*/
|
|
214
|
+
private getFileStats;
|
|
215
|
+
/**
|
|
216
|
+
* 生成 ID
|
|
217
|
+
*/
|
|
218
|
+
private generateId;
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=smart-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-parser.d.ts","sourceRoot":"","sources":["../../../src/parser/implementations/smart-parser.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAA0C,MAAM,0BAA0B,CAAC;AAiB5H;;GAEG;AACH,qBAAa,WAAY,YAAW,OAAO;IACzC,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,IAAI,WAAW;gBAEZ,QAAQ,EAAE,aAAa;IAGnC;;OAEG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IA+BvD;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAe7D;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;OAEG;IACH,OAAO,CAAC,cAAc;IAmCtB;;OAEG;IACH,OAAO,CAAC,YAAY;IASpB;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB;;OAEG;IACH,OAAO,CAAC,aAAa;IAWrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAOxB;;OAEG;IACH,OAAO,CAAC,cAAc;IAwCtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAqCtB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAY5B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmBzB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAc7B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAW7B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAW5B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA4BxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAuBpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAgDtB;;OAEG;IACH,OAAO,CAAC,eAAe;IAmDvB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAgDhC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA4BhC;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IAiE3B;;OAEG;IACH,OAAO,CAAC,aAAa;IAsBrB;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAkEpB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA+D3B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAgD/B;;OAEG;IACH,OAAO,CAAC,aAAa;IAOrB;;OAEG;IACH,OAAO,CAAC,aAAa;IAarB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAKhB;;OAEG;IACH,OAAO,CAAC,UAAU;IAKlB;;OAEG;IACH,OAAO,CAAC,UAAU;IAKlB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAoBzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAyCtB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAoDzB;;OAEG;IACH,OAAO,CAAC,eAAe;IAsBvB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAoB3B;;OAEG;IACH,OAAO,CAAC,eAAe;IA4NvB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAwFxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAiBzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA0E3B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA0BnC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IA4BlC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,6BAA6B;IAuBrC;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAyBpB;;OAEG;IACH,OAAO,CAAC,UAAU;CASnB"}
|