@grafema/core 0.2.5-beta → 0.2.7
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/README.md +61 -23
- package/dist/DiscoveryManager.d.ts +59 -0
- package/dist/DiscoveryManager.d.ts.map +1 -0
- package/dist/DiscoveryManager.js +249 -0
- package/dist/DiscoveryManager.js.map +1 -0
- package/dist/GraphInitializer.d.ts +44 -0
- package/dist/GraphInitializer.d.ts.map +1 -0
- package/dist/GraphInitializer.js +121 -0
- package/dist/GraphInitializer.js.map +1 -0
- package/dist/GuaranteeChecker.d.ts +35 -0
- package/dist/GuaranteeChecker.d.ts.map +1 -0
- package/dist/GuaranteeChecker.js +81 -0
- package/dist/GuaranteeChecker.js.map +1 -0
- package/dist/Orchestrator.d.ts +34 -151
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +173 -741
- package/dist/Orchestrator.js.map +1 -1
- package/dist/OrchestratorTypes.d.ts +115 -0
- package/dist/OrchestratorTypes.d.ts.map +1 -0
- package/dist/OrchestratorTypes.js +6 -0
- package/dist/OrchestratorTypes.js.map +1 -0
- package/dist/ParallelAnalysisRunner.d.ts +43 -0
- package/dist/ParallelAnalysisRunner.d.ts.map +1 -0
- package/dist/ParallelAnalysisRunner.js +161 -0
- package/dist/ParallelAnalysisRunner.js.map +1 -0
- package/dist/PhaseRunner.d.ts +94 -0
- package/dist/PhaseRunner.d.ts.map +1 -0
- package/dist/PhaseRunner.js +332 -0
- package/dist/PhaseRunner.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +51 -1
- package/dist/config/ConfigLoader.d.ts.map +1 -1
- package/dist/config/ConfigLoader.js +121 -1
- package/dist/config/ConfigLoader.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/core/ASTWorker.d.ts +2 -0
- package/dist/core/ASTWorker.d.ts.map +1 -1
- package/dist/core/ASTWorker.js +6 -2
- package/dist/core/ASTWorker.js.map +1 -1
- package/dist/core/FileOverview.d.ts +124 -0
- package/dist/core/FileOverview.d.ts.map +1 -0
- package/dist/core/FileOverview.js +257 -0
- package/dist/core/FileOverview.js.map +1 -0
- package/dist/core/GraphFreshnessChecker.d.ts +1 -1
- package/dist/core/GraphFreshnessChecker.d.ts.map +1 -1
- package/dist/core/GraphFreshnessChecker.js +7 -5
- package/dist/core/GraphFreshnessChecker.js.map +1 -1
- package/dist/core/GuaranteeManager.d.ts +13 -0
- package/dist/core/GuaranteeManager.d.ts.map +1 -1
- package/dist/core/GuaranteeManager.js +63 -2
- package/dist/core/GuaranteeManager.js.map +1 -1
- package/dist/core/IncrementalReanalyzer.d.ts.map +1 -1
- package/dist/core/IncrementalReanalyzer.js +6 -3
- package/dist/core/IncrementalReanalyzer.js.map +1 -1
- package/dist/core/NodeFactory.d.ts +81 -415
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +139 -336
- package/dist/core/NodeFactory.js.map +1 -1
- package/dist/core/ResourceRegistry.d.ts +17 -0
- package/dist/core/ResourceRegistry.d.ts.map +1 -0
- package/dist/core/ResourceRegistry.js +32 -0
- package/dist/core/ResourceRegistry.js.map +1 -0
- package/dist/core/ScopeTracker.d.ts +12 -0
- package/dist/core/ScopeTracker.d.ts.map +1 -1
- package/dist/core/ScopeTracker.js +24 -0
- package/dist/core/ScopeTracker.js.map +1 -1
- package/dist/core/SemanticId.d.ts +69 -0
- package/dist/core/SemanticId.d.ts.map +1 -1
- package/dist/core/SemanticId.js +134 -0
- package/dist/core/SemanticId.js.map +1 -1
- package/dist/core/brandNodeInternal.d.ts +14 -0
- package/dist/core/brandNodeInternal.d.ts.map +1 -0
- package/dist/core/brandNodeInternal.js +4 -0
- package/dist/core/brandNodeInternal.js.map +1 -0
- package/dist/core/buildDependencyGraph.d.ts +36 -0
- package/dist/core/buildDependencyGraph.d.ts.map +1 -0
- package/dist/core/buildDependencyGraph.js +78 -0
- package/dist/core/buildDependencyGraph.js.map +1 -0
- package/dist/core/factories/CoreFactory.d.ts +223 -0
- package/dist/core/factories/CoreFactory.d.ts.map +1 -0
- package/dist/core/factories/CoreFactory.js +127 -0
- package/dist/core/factories/CoreFactory.js.map +1 -0
- package/dist/core/factories/DatabaseFactory.d.ts +29 -0
- package/dist/core/factories/DatabaseFactory.d.ts.map +1 -0
- package/dist/core/factories/DatabaseFactory.js +25 -0
- package/dist/core/factories/DatabaseFactory.js.map +1 -0
- package/dist/core/factories/ExternalFactory.d.ts +11 -0
- package/dist/core/factories/ExternalFactory.d.ts.map +1 -0
- package/dist/core/factories/ExternalFactory.js +16 -0
- package/dist/core/factories/ExternalFactory.js.map +1 -0
- package/dist/core/factories/HttpFactory.d.ts +22 -0
- package/dist/core/factories/HttpFactory.d.ts.map +1 -0
- package/dist/core/factories/HttpFactory.js +32 -0
- package/dist/core/factories/HttpFactory.js.map +1 -0
- package/dist/core/factories/ReactFactory.d.ts +14 -0
- package/dist/core/factories/ReactFactory.d.ts.map +1 -0
- package/dist/core/factories/ReactFactory.js +13 -0
- package/dist/core/factories/ReactFactory.js.map +1 -0
- package/dist/core/factories/RustFactory.d.ts +62 -0
- package/dist/core/factories/RustFactory.d.ts.map +1 -0
- package/dist/core/factories/RustFactory.js +32 -0
- package/dist/core/factories/RustFactory.js.map +1 -0
- package/dist/core/factories/ServiceFactory.d.ts +12 -0
- package/dist/core/factories/ServiceFactory.d.ts.map +1 -0
- package/dist/core/factories/ServiceFactory.js +22 -0
- package/dist/core/factories/ServiceFactory.js.map +1 -0
- package/dist/core/factories/SocketFactory.d.ts +31 -0
- package/dist/core/factories/SocketFactory.d.ts.map +1 -0
- package/dist/core/factories/SocketFactory.js +35 -0
- package/dist/core/factories/SocketFactory.js.map +1 -0
- package/dist/core/nodes/DatabaseNode.d.ts +85 -0
- package/dist/core/nodes/DatabaseNode.d.ts.map +1 -0
- package/dist/core/nodes/DatabaseNode.js +118 -0
- package/dist/core/nodes/DatabaseNode.js.map +1 -0
- package/dist/core/nodes/ExpressMiddlewareNode.d.ts +47 -0
- package/dist/core/nodes/ExpressMiddlewareNode.d.ts.map +1 -0
- package/dist/core/nodes/ExpressMiddlewareNode.js +63 -0
- package/dist/core/nodes/ExpressMiddlewareNode.js.map +1 -0
- package/dist/core/nodes/ExpressMountNode.d.ts +44 -0
- package/dist/core/nodes/ExpressMountNode.d.ts.map +1 -0
- package/dist/core/nodes/ExpressMountNode.js +61 -0
- package/dist/core/nodes/ExpressMountNode.js.map +1 -0
- package/dist/core/nodes/ExternalApiNode.d.ts +29 -0
- package/dist/core/nodes/ExternalApiNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalApiNode.js +41 -0
- package/dist/core/nodes/ExternalApiNode.js.map +1 -0
- package/dist/core/nodes/ExternalFunctionNode.d.ts +40 -0
- package/dist/core/nodes/ExternalFunctionNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalFunctionNode.js +54 -0
- package/dist/core/nodes/ExternalFunctionNode.js.map +1 -0
- package/dist/core/nodes/FetchRequestNode.d.ts +54 -0
- package/dist/core/nodes/FetchRequestNode.d.ts.map +1 -0
- package/dist/core/nodes/FetchRequestNode.js +67 -0
- package/dist/core/nodes/FetchRequestNode.js.map +1 -0
- package/dist/core/nodes/HttpRouteNode.d.ts +58 -0
- package/dist/core/nodes/HttpRouteNode.d.ts.map +1 -0
- package/dist/core/nodes/HttpRouteNode.js +72 -0
- package/dist/core/nodes/HttpRouteNode.js.map +1 -0
- package/dist/core/nodes/NodeKind.d.ts +1 -0
- package/dist/core/nodes/NodeKind.d.ts.map +1 -1
- package/dist/core/nodes/NodeKind.js +1 -0
- package/dist/core/nodes/NodeKind.js.map +1 -1
- package/dist/core/nodes/ReactNode.d.ts +53 -0
- package/dist/core/nodes/ReactNode.d.ts.map +1 -0
- package/dist/core/nodes/ReactNode.js +70 -0
- package/dist/core/nodes/ReactNode.js.map +1 -0
- package/dist/core/nodes/RustCallNode.d.ts +46 -0
- package/dist/core/nodes/RustCallNode.d.ts.map +1 -0
- package/dist/core/nodes/RustCallNode.js +62 -0
- package/dist/core/nodes/RustCallNode.js.map +1 -0
- package/dist/core/nodes/RustFunctionNode.d.ts +58 -0
- package/dist/core/nodes/RustFunctionNode.d.ts.map +1 -0
- package/dist/core/nodes/RustFunctionNode.js +67 -0
- package/dist/core/nodes/RustFunctionNode.js.map +1 -0
- package/dist/core/nodes/RustImplNode.d.ts +35 -0
- package/dist/core/nodes/RustImplNode.d.ts.map +1 -0
- package/dist/core/nodes/RustImplNode.js +55 -0
- package/dist/core/nodes/RustImplNode.js.map +1 -0
- package/dist/core/nodes/RustMethodNode.d.ts +64 -0
- package/dist/core/nodes/RustMethodNode.d.ts.map +1 -0
- package/dist/core/nodes/RustMethodNode.js +76 -0
- package/dist/core/nodes/RustMethodNode.js.map +1 -0
- package/dist/core/nodes/RustModuleNode.d.ts +40 -0
- package/dist/core/nodes/RustModuleNode.d.ts.map +1 -0
- package/dist/core/nodes/RustModuleNode.js +57 -0
- package/dist/core/nodes/RustModuleNode.js.map +1 -0
- package/dist/core/nodes/RustStructNode.d.ts +38 -0
- package/dist/core/nodes/RustStructNode.d.ts.map +1 -0
- package/dist/core/nodes/RustStructNode.js +54 -0
- package/dist/core/nodes/RustStructNode.js.map +1 -0
- package/dist/core/nodes/RustTraitNode.d.ts +40 -0
- package/dist/core/nodes/RustTraitNode.d.ts.map +1 -0
- package/dist/core/nodes/RustTraitNode.js +52 -0
- package/dist/core/nodes/RustTraitNode.js.map +1 -0
- package/dist/core/nodes/ServiceLayerNode.d.ts +85 -0
- package/dist/core/nodes/ServiceLayerNode.d.ts.map +1 -0
- package/dist/core/nodes/ServiceLayerNode.js +122 -0
- package/dist/core/nodes/ServiceLayerNode.js.map +1 -0
- package/dist/core/nodes/SocketIONode.d.ts +71 -0
- package/dist/core/nodes/SocketIONode.d.ts.map +1 -0
- package/dist/core/nodes/SocketIONode.js +111 -0
- package/dist/core/nodes/SocketIONode.js.map +1 -0
- package/dist/core/nodes/SocketNode.d.ts +87 -0
- package/dist/core/nodes/SocketNode.d.ts.map +1 -0
- package/dist/core/nodes/SocketNode.js +124 -0
- package/dist/core/nodes/SocketNode.js.map +1 -0
- package/dist/core/nodes/TypeNode.d.ts +26 -1
- package/dist/core/nodes/TypeNode.d.ts.map +1 -1
- package/dist/core/nodes/TypeNode.js +21 -3
- package/dist/core/nodes/TypeNode.js.map +1 -1
- package/dist/core/nodes/TypeParameterNode.d.ts +44 -0
- package/dist/core/nodes/TypeParameterNode.d.ts.map +1 -0
- package/dist/core/nodes/TypeParameterNode.js +64 -0
- package/dist/core/nodes/TypeParameterNode.js.map +1 -0
- package/dist/core/nodes/index.d.ts +19 -0
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +26 -0
- package/dist/core/nodes/index.js.map +1 -1
- package/dist/index.d.ts +33 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/InfraAnalyzer.d.ts +110 -0
- package/dist/plugins/InfraAnalyzer.d.ts.map +1 -0
- package/dist/plugins/InfraAnalyzer.js +170 -0
- package/dist/plugins/InfraAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/DatabaseAnalyzer.js +18 -15
- package/dist/plugins/analysis/DatabaseAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +27 -26
- package/dist/plugins/analysis/ExpressAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js +5 -3
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +36 -39
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +23 -39
- package/dist/plugins/analysis/FetchAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +3 -2
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +23 -85
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +351 -1887
- package/dist/plugins/analysis/JSASTAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/NestJSRouteAnalyzer.d.ts +28 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.js +196 -0
- package/dist/plugins/analysis/NestJSRouteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ReactAnalyzer.d.ts +1 -61
- package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ReactAnalyzer.js +24 -915
- package/dist/plugins/analysis/ReactAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.js +31 -66
- package/dist/plugins/analysis/RustAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +13 -6
- package/dist/plugins/analysis/SQLiteAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +10 -7
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SocketAnalyzer.d.ts +81 -0
- package/dist/plugins/analysis/SocketAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/SocketAnalyzer.js +475 -0
- package/dist/plugins/analysis/SocketAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SocketIOAnalyzer.js +13 -18
- package/dist/plugins/analysis/SocketIOAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.js +8 -5
- package/dist/plugins/analysis/SystemDbAnalyzer.js.map +1 -1
- package/dist/plugins/analysis/ast/CollisionResolver.d.ts +65 -0
- package/dist/plugins/analysis/ast/CollisionResolver.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/CollisionResolver.js +106 -0
- package/dist/plugins/analysis/ast/CollisionResolver.js.map +1 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.d.ts +124 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.js +151 -0
- package/dist/plugins/analysis/ast/FunctionBodyContext.js.map +1 -0
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts +26 -261
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +251 -2494
- package/dist/plugins/analysis/ast/GraphBuilder.js.map +1 -1
- package/dist/plugins/analysis/ast/IdGenerator.d.ts +42 -0
- package/dist/plugins/analysis/ast/IdGenerator.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/IdGenerator.js +61 -1
- package/dist/plugins/analysis/ast/IdGenerator.js.map +1 -1
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.d.ts +15 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.js +274 -0
- package/dist/plugins/analysis/ast/builders/AssignmentBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.d.ts +22 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.js +178 -0
- package/dist/plugins/analysis/ast/builders/CallFlowBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.d.ts +76 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.js +387 -0
- package/dist/plugins/analysis/ast/builders/ControlFlowBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.d.ts +38 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.js +240 -0
- package/dist/plugins/analysis/ast/builders/CoreBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.d.ts +53 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.js +355 -0
- package/dist/plugins/analysis/ast/builders/ModuleRuntimeBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.d.ts +46 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.js +264 -0
- package/dist/plugins/analysis/ast/builders/MutationBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.d.ts +23 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.js +206 -0
- package/dist/plugins/analysis/ast/builders/ReturnBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.d.ts +64 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.js +370 -0
- package/dist/plugins/analysis/ast/builders/TypeSystemBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.d.ts +46 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.js +191 -0
- package/dist/plugins/analysis/ast/builders/UpdateExpressionBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.d.ts +30 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.js +214 -0
- package/dist/plugins/analysis/ast/builders/YieldBuilder.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/index.d.ts +12 -0
- package/dist/plugins/analysis/ast/builders/index.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/index.js +11 -0
- package/dist/plugins/analysis/ast/builders/index.js.map +1 -0
- package/dist/plugins/analysis/ast/builders/types.d.ts +30 -0
- package/dist/plugins/analysis/ast/builders/types.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/builders/types.js +8 -0
- package/dist/plugins/analysis/ast/builders/types.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.d.ts +50 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.js +2 -0
- package/dist/plugins/analysis/ast/handlers/AnalyzerDelegate.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.d.ts +18 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.js +244 -0
- package/dist/plugins/analysis/ast/handlers/BranchHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.d.ts +7 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.js +295 -0
- package/dist/plugins/analysis/ast/handlers/CallExpressionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.d.ts +22 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.js +9 -0
- package/dist/plugins/analysis/ast/handlers/FunctionBodyHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.js +207 -0
- package/dist/plugins/analysis/ast/handlers/LoopHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.js +174 -0
- package/dist/plugins/analysis/ast/handlers/NestedFunctionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.js +135 -0
- package/dist/plugins/analysis/ast/handlers/NewExpressionHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.js +71 -0
- package/dist/plugins/analysis/ast/handlers/PropertyAccessHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.js +135 -0
- package/dist/plugins/analysis/ast/handlers/ReturnYieldHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.js +82 -0
- package/dist/plugins/analysis/ast/handlers/ThrowHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.d.ts +14 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.js +220 -0
- package/dist/plugins/analysis/ast/handlers/TryCatchHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.d.ts +12 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.js +57 -0
- package/dist/plugins/analysis/ast/handlers/VariableHandler.js.map +1 -0
- package/dist/plugins/analysis/ast/handlers/index.d.ts +13 -0
- package/dist/plugins/analysis/ast/handlers/index.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/handlers/index.js +12 -0
- package/dist/plugins/analysis/ast/handlers/index.js.map +1 -0
- package/dist/plugins/analysis/ast/types.d.ts +57 -6
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +5 -4
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js +94 -13
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js.map +1 -1
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.d.ts +81 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.js +140 -0
- package/dist/plugins/analysis/ast/utils/extractNamesFromPattern.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.d.ts +22 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.js +35 -0
- package/dist/plugins/analysis/ast/utils/getExpressionValue.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.d.ts +25 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.js +21 -0
- package/dist/plugins/analysis/ast/utils/getMemberExpressionName.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/index.d.ts +2 -0
- package/dist/plugins/analysis/ast/utils/index.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/index.js +2 -0
- package/dist/plugins/analysis/ast/utils/index.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.d.ts +23 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.js +241 -0
- package/dist/plugins/analysis/ast/visitors/ArgumentExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.js +110 -0
- package/dist/plugins/analysis/ast/visitors/ArrayElementExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +15 -142
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +304 -937
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +26 -11
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +21 -6
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/MutationDetector.d.ts +25 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.js +181 -0
- package/dist/plugins/analysis/ast/visitors/MutationDetector.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.js +155 -0
- package/dist/plugins/analysis/ast/visitors/ObjectPropertyExtractor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts +9 -1
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js +51 -3
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +20 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +188 -12
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +6 -4
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js.map +1 -1
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.d.ts +19 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.js +57 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-helpers.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.d.ts +168 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.js +7 -0
- package/dist/plugins/analysis/ast/visitors/call-expression-types.js.map +1 -0
- package/dist/plugins/analysis/react-internal/browser-api.d.ts +20 -0
- package/dist/plugins/analysis/react-internal/browser-api.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/browser-api.js +140 -0
- package/dist/plugins/analysis/react-internal/browser-api.js.map +1 -0
- package/dist/plugins/analysis/react-internal/hooks.d.ts +31 -0
- package/dist/plugins/analysis/react-internal/hooks.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/hooks.js +465 -0
- package/dist/plugins/analysis/react-internal/hooks.js.map +1 -0
- package/dist/plugins/analysis/react-internal/jsx.d.ts +43 -0
- package/dist/plugins/analysis/react-internal/jsx.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/jsx.js +231 -0
- package/dist/plugins/analysis/react-internal/jsx.js.map +1 -0
- package/dist/plugins/analysis/react-internal/types.d.ts +116 -0
- package/dist/plugins/analysis/react-internal/types.d.ts.map +1 -0
- package/dist/plugins/analysis/react-internal/types.js +83 -0
- package/dist/plugins/analysis/react-internal/types.js.map +1 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +6 -13
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js.map +1 -1
- package/dist/plugins/enrichment/AliasTracker.d.ts.map +1 -1
- package/dist/plugins/enrichment/AliasTracker.js +3 -1
- package/dist/plugins/enrichment/AliasTracker.js.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js +3 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js.map +1 -1
- package/dist/plugins/enrichment/CallbackCallResolver.d.ts +42 -0
- package/dist/plugins/enrichment/CallbackCallResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/CallbackCallResolver.js +311 -0
- package/dist/plugins/enrichment/CallbackCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js +3 -1
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.d.ts +17 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.d.ts.map +1 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.js +55 -0
- package/dist/plugins/enrichment/ConfigRoutingMapBuilder.js.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExpressHandlerLinker.js +3 -1
- package/dist/plugins/enrichment/ExpressHandlerLinker.js.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js +5 -8
- package/dist/plugins/enrichment/ExternalCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.js +6 -9
- package/dist/plugins/enrichment/FunctionCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +3 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js +5 -3
- package/dist/plugins/enrichment/ImportExportLinker.js.map +1 -1
- package/dist/plugins/enrichment/InstanceOfResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/InstanceOfResolver.js +3 -1
- package/dist/plugins/enrichment/InstanceOfResolver.js.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.d.ts +17 -68
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.js +42 -517
- package/dist/plugins/enrichment/MethodCallResolver.js.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +9 -2
- package/dist/plugins/enrichment/MountPointResolver.js.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +7 -16
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.js +6 -2
- package/dist/plugins/enrichment/PrefixEvaluator.js.map +1 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js +3 -1
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js +3 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js.map +1 -1
- package/dist/plugins/enrichment/ServiceConnectionEnricher.d.ts +76 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.js +355 -0
- package/dist/plugins/enrichment/ServiceConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.d.ts +42 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.js +166 -0
- package/dist/plugins/enrichment/SocketConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +3 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js.map +1 -1
- package/dist/plugins/enrichment/method-call/MethodCallData.d.ts +68 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.js +227 -0
- package/dist/plugins/enrichment/method-call/MethodCallData.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.d.ts +21 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.js +52 -0
- package/dist/plugins/enrichment/method-call/MethodCallDetectors.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.d.ts +22 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.js +105 -0
- package/dist/plugins/enrichment/method-call/MethodCallErrorAnalysis.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.d.ts +19 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.js +63 -0
- package/dist/plugins/enrichment/method-call/MethodCallIndexers.js.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.d.ts +30 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.d.ts.map +1 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.js +138 -0
- package/dist/plugins/enrichment/method-call/MethodCallResolution.js.map +1 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +2 -8
- package/dist/plugins/indexing/IncrementalModuleIndexer.js.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +13 -20
- package/dist/plugins/indexing/JSModuleIndexer.js.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +4 -8
- package/dist/plugins/indexing/RustModuleIndexer.js.map +1 -1
- package/dist/plugins/validation/AwaitInLoopValidator.d.ts +24 -0
- package/dist/plugins/validation/AwaitInLoopValidator.d.ts.map +1 -0
- package/dist/plugins/validation/AwaitInLoopValidator.js +69 -0
- package/dist/plugins/validation/AwaitInLoopValidator.js.map +1 -0
- package/dist/plugins/validation/PackageCoverageValidator.d.ts +33 -0
- package/dist/plugins/validation/PackageCoverageValidator.d.ts.map +1 -0
- package/dist/plugins/validation/PackageCoverageValidator.js +149 -0
- package/dist/plugins/validation/PackageCoverageValidator.js.map +1 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.d.ts +18 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.d.ts.map +1 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.js +68 -0
- package/dist/plugins/validation/UnconnectedRouteValidator.js.map +1 -0
- package/dist/queries/NodeContext.d.ts +81 -0
- package/dist/queries/NodeContext.d.ts.map +1 -0
- package/dist/queries/NodeContext.js +193 -0
- package/dist/queries/NodeContext.js.map +1 -0
- package/dist/queries/findCallsInFunction.d.ts.map +1 -1
- package/dist/queries/findCallsInFunction.js +10 -2
- package/dist/queries/findCallsInFunction.js.map +1 -1
- package/dist/queries/findContainingFunction.d.ts +3 -2
- package/dist/queries/findContainingFunction.d.ts.map +1 -1
- package/dist/queries/findContainingFunction.js +13 -3
- package/dist/queries/findContainingFunction.js.map +1 -1
- package/dist/queries/index.d.ts +2 -0
- package/dist/queries/index.d.ts.map +1 -1
- package/dist/queries/index.js +1 -0
- package/dist/queries/index.js.map +1 -1
- package/dist/resources/InfraResourceMapImpl.d.ts +31 -0
- package/dist/resources/InfraResourceMapImpl.d.ts.map +1 -0
- package/dist/resources/InfraResourceMapImpl.js +110 -0
- package/dist/resources/InfraResourceMapImpl.js.map +1 -0
- package/dist/resources/RoutingMapImpl.d.ts +33 -0
- package/dist/resources/RoutingMapImpl.d.ts.map +1 -0
- package/dist/resources/RoutingMapImpl.js +115 -0
- package/dist/resources/RoutingMapImpl.js.map +1 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +35 -6
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +102 -70
- package/dist/storage/backends/RFDBServerBackend.js.map +1 -1
- package/dist/utils/findRfdbBinary.d.ts +3 -2
- package/dist/utils/findRfdbBinary.d.ts.map +1 -1
- package/dist/utils/findRfdbBinary.js +22 -7
- package/dist/utils/findRfdbBinary.js.map +1 -1
- package/dist/utils/moduleResolution.d.ts.map +1 -1
- package/dist/utils/moduleResolution.js +26 -1
- package/dist/utils/moduleResolution.js.map +1 -1
- package/dist/utils/resolveNodeFile.d.ts +13 -0
- package/dist/utils/resolveNodeFile.d.ts.map +1 -0
- package/dist/utils/resolveNodeFile.js +18 -0
- package/dist/utils/resolveNodeFile.js.map +1 -0
- package/dist/version.d.ts +11 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +26 -0
- package/dist/version.js.map +1 -0
- package/package.json +3 -3
- package/src/DiscoveryManager.ts +279 -0
- package/src/GraphInitializer.ts +131 -0
- package/src/GuaranteeChecker.ts +90 -0
- package/src/Orchestrator.ts +222 -963
- package/src/OrchestratorTypes.ts +122 -0
- package/src/ParallelAnalysisRunner.ts +188 -0
- package/src/PhaseRunner.ts +450 -0
- package/src/config/ConfigLoader.ts +176 -2
- package/src/config/index.ts +2 -0
- package/src/core/ASTWorker.ts +9 -2
- package/src/core/FileOverview.ts +374 -0
- package/src/core/GraphFreshnessChecker.ts +7 -5
- package/src/core/GuaranteeManager.ts +70 -2
- package/src/core/IncrementalReanalyzer.ts +6 -3
- package/src/core/NodeFactory.ts +173 -652
- package/src/core/ResourceRegistry.ts +39 -0
- package/src/core/ScopeTracker.ts +23 -0
- package/src/core/SemanticId.ts +183 -0
- package/src/core/brandNodeInternal.ts +16 -0
- package/src/core/buildDependencyGraph.ts +98 -0
- package/src/core/factories/CoreFactory.ts +489 -0
- package/src/core/factories/DatabaseFactory.ts +63 -0
- package/src/core/factories/ExternalFactory.ts +23 -0
- package/src/core/factories/HttpFactory.ts +57 -0
- package/src/core/factories/ReactFactory.ts +15 -0
- package/src/core/factories/RustFactory.ts +128 -0
- package/src/core/factories/ServiceFactory.ts +27 -0
- package/src/core/factories/SocketFactory.ts +94 -0
- package/src/core/nodes/DatabaseNode.ts +175 -0
- package/src/core/nodes/ExpressMiddlewareNode.ts +98 -0
- package/src/core/nodes/ExpressMountNode.ts +94 -0
- package/src/core/nodes/ExternalApiNode.ts +53 -0
- package/src/core/nodes/ExternalFunctionNode.ts +77 -0
- package/src/core/nodes/FetchRequestNode.ts +105 -0
- package/src/core/nodes/HttpRouteNode.ts +113 -0
- package/src/core/nodes/NodeKind.ts +1 -0
- package/src/core/nodes/ReactNode.ts +78 -0
- package/src/core/nodes/RustCallNode.ts +96 -0
- package/src/core/nodes/RustFunctionNode.ts +112 -0
- package/src/core/nodes/RustImplNode.ts +78 -0
- package/src/core/nodes/RustMethodNode.ts +125 -0
- package/src/core/nodes/RustModuleNode.ts +84 -0
- package/src/core/nodes/RustStructNode.ts +80 -0
- package/src/core/nodes/RustTraitNode.ts +82 -0
- package/src/core/nodes/ServiceLayerNode.ts +183 -0
- package/src/core/nodes/SocketIONode.ts +177 -0
- package/src/core/nodes/SocketNode.ts +206 -0
- package/src/core/nodes/TypeNode.ts +46 -3
- package/src/core/nodes/TypeParameterNode.ts +91 -0
- package/src/core/nodes/index.ts +57 -0
- package/src/index.ts +60 -4
- package/src/plugins/InfraAnalyzer.ts +208 -0
- package/src/plugins/analysis/DatabaseAnalyzer.ts +27 -17
- package/src/plugins/analysis/ExpressAnalyzer.ts +51 -38
- package/src/plugins/analysis/ExpressResponseAnalyzer.ts +15 -12
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +56 -56
- package/src/plugins/analysis/FetchAnalyzer.ts +42 -52
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +3 -2
- package/src/plugins/analysis/JSASTAnalyzer.ts +391 -2304
- package/src/plugins/analysis/NestJSRouteAnalyzer.ts +241 -0
- package/src/plugins/analysis/ReactAnalyzer.ts +33 -1085
- package/src/plugins/analysis/RustAnalyzer.ts +112 -116
- package/src/plugins/analysis/SQLiteAnalyzer.ts +23 -9
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +32 -10
- package/src/plugins/analysis/SocketAnalyzer.ts +601 -0
- package/src/plugins/analysis/SocketIOAnalyzer.ts +25 -34
- package/src/plugins/analysis/SystemDbAnalyzer.ts +15 -12
- package/src/plugins/analysis/ast/CollisionResolver.ts +137 -0
- package/src/plugins/analysis/ast/FunctionBodyContext.ts +291 -0
- package/src/plugins/analysis/ast/GraphBuilder.ts +274 -3180
- package/src/plugins/analysis/ast/IdGenerator.ts +81 -1
- package/src/plugins/analysis/ast/builders/AssignmentBuilder.ts +407 -0
- package/src/plugins/analysis/ast/builders/CallFlowBuilder.ts +255 -0
- package/src/plugins/analysis/ast/builders/ControlFlowBuilder.ts +470 -0
- package/src/plugins/analysis/ast/builders/CoreBuilder.ts +306 -0
- package/src/plugins/analysis/ast/builders/ModuleRuntimeBuilder.ts +452 -0
- package/src/plugins/analysis/ast/builders/MutationBuilder.ts +372 -0
- package/src/plugins/analysis/ast/builders/ReturnBuilder.ts +279 -0
- package/src/plugins/analysis/ast/builders/TypeSystemBuilder.ts +475 -0
- package/src/plugins/analysis/ast/builders/UpdateExpressionBuilder.ts +262 -0
- package/src/plugins/analysis/ast/builders/YieldBuilder.ts +287 -0
- package/src/plugins/analysis/ast/builders/index.ts +11 -0
- package/src/plugins/analysis/ast/builders/types.ts +65 -0
- package/src/plugins/analysis/ast/handlers/AnalyzerDelegate.ts +183 -0
- package/src/plugins/analysis/ast/handlers/BranchHandler.ts +313 -0
- package/src/plugins/analysis/ast/handlers/CallExpressionHandler.ts +347 -0
- package/src/plugins/analysis/ast/handlers/FunctionBodyHandler.ts +24 -0
- package/src/plugins/analysis/ast/handlers/LoopHandler.ts +240 -0
- package/src/plugins/analysis/ast/handlers/NestedFunctionHandler.ts +201 -0
- package/src/plugins/analysis/ast/handlers/NewExpressionHandler.ts +159 -0
- package/src/plugins/analysis/ast/handlers/PropertyAccessHandler.ts +112 -0
- package/src/plugins/analysis/ast/handlers/ReturnYieldHandler.ts +166 -0
- package/src/plugins/analysis/ast/handlers/ThrowHandler.ts +101 -0
- package/src/plugins/analysis/ast/handlers/TryCatchHandler.ts +262 -0
- package/src/plugins/analysis/ast/handlers/VariableHandler.ts +93 -0
- package/src/plugins/analysis/ast/handlers/index.ts +12 -0
- package/src/plugins/analysis/ast/types.ts +68 -9
- package/src/plugins/analysis/ast/utils/createParameterNodes.ts +118 -13
- package/src/plugins/analysis/ast/utils/extractNamesFromPattern.ts +166 -0
- package/src/plugins/analysis/ast/utils/getExpressionValue.ts +34 -0
- package/src/plugins/analysis/ast/utils/getMemberExpressionName.ts +33 -0
- package/src/plugins/analysis/ast/utils/index.ts +2 -0
- package/src/plugins/analysis/ast/visitors/ArgumentExtractor.ts +307 -0
- package/src/plugins/analysis/ast/visitors/ArrayElementExtractor.ts +172 -0
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +425 -1374
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +43 -12
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +39 -8
- package/src/plugins/analysis/ast/visitors/MutationDetector.ts +211 -0
- package/src/plugins/analysis/ast/visitors/ObjectPropertyExtractor.ts +217 -0
- package/src/plugins/analysis/ast/visitors/PropertyAccessVisitor.ts +69 -4
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +232 -13
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +8 -11
- package/src/plugins/analysis/ast/visitors/call-expression-helpers.ts +65 -0
- package/src/plugins/analysis/ast/visitors/call-expression-types.ts +179 -0
- package/src/plugins/analysis/react-internal/browser-api.ts +168 -0
- package/src/plugins/analysis/react-internal/hooks.ts +517 -0
- package/src/plugins/analysis/react-internal/jsx.ts +279 -0
- package/src/plugins/analysis/react-internal/types.ts +183 -0
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +6 -14
- package/src/plugins/enrichment/AliasTracker.ts +3 -1
- package/src/plugins/enrichment/ArgumentParameterLinker.ts +3 -1
- package/src/plugins/enrichment/CallbackCallResolver.ts +398 -0
- package/src/plugins/enrichment/ClosureCaptureEnricher.ts +3 -1
- package/src/plugins/enrichment/ConfigRoutingMapBuilder.ts +67 -0
- package/src/plugins/enrichment/ExpressHandlerLinker.ts +3 -1
- package/src/plugins/enrichment/ExternalCallResolver.ts +5 -8
- package/src/plugins/enrichment/FunctionCallResolver.ts +6 -9
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +3 -1
- package/src/plugins/enrichment/ImportExportLinker.ts +5 -3
- package/src/plugins/enrichment/InstanceOfResolver.ts +3 -1
- package/src/plugins/enrichment/MethodCallResolver.ts +48 -659
- package/src/plugins/enrichment/MountPointResolver.ts +9 -2
- package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +13 -18
- package/src/plugins/enrichment/PrefixEvaluator.ts +6 -2
- package/src/plugins/enrichment/RejectionPropagationEnricher.ts +3 -1
- package/src/plugins/enrichment/RustFFIEnricher.ts +3 -1
- package/src/plugins/enrichment/ServiceConnectionEnricher.ts +472 -0
- package/src/plugins/enrichment/SocketConnectionEnricher.ts +228 -0
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +3 -1
- package/src/plugins/enrichment/method-call/MethodCallData.ts +299 -0
- package/src/plugins/enrichment/method-call/MethodCallDetectors.ts +70 -0
- package/src/plugins/enrichment/method-call/MethodCallErrorAnalysis.ts +131 -0
- package/src/plugins/enrichment/method-call/MethodCallIndexers.ts +83 -0
- package/src/plugins/enrichment/method-call/MethodCallResolution.ts +181 -0
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +5 -10
- package/src/plugins/indexing/JSModuleIndexer.ts +17 -21
- package/src/plugins/indexing/RustModuleIndexer.ts +14 -13
- package/src/plugins/validation/AwaitInLoopValidator.ts +91 -0
- package/src/plugins/validation/PackageCoverageValidator.ts +181 -0
- package/src/plugins/validation/UnconnectedRouteValidator.ts +93 -0
- package/src/queries/NodeContext.ts +277 -0
- package/src/queries/findCallsInFunction.ts +11 -2
- package/src/queries/findContainingFunction.ts +14 -3
- package/src/queries/index.ts +13 -0
- package/src/resources/InfraResourceMapImpl.ts +119 -0
- package/src/resources/RoutingMapImpl.ts +133 -0
- package/src/storage/backends/RFDBServerBackend.ts +106 -77
- package/src/utils/findRfdbBinary.ts +22 -7
- package/src/utils/moduleResolution.ts +28 -1
- package/src/utils/resolveNodeFile.ts +18 -0
- package/src/version.ts +28 -0
|
@@ -23,8 +23,10 @@ import type { CallExpression, Identifier, MemberExpression, Node } from '@babel/
|
|
|
23
23
|
import type { NodePath } from '@babel/traverse';
|
|
24
24
|
import { Plugin, createSuccessResult, createErrorResult } from '../Plugin.js';
|
|
25
25
|
import type { PluginContext, PluginResult, PluginMetadata } from '../Plugin.js';
|
|
26
|
-
import type { NodeRecord } from '@grafema/types';
|
|
26
|
+
import type { NodeRecord, AnyBrandedNode } from '@grafema/types';
|
|
27
|
+
import { NodeFactory } from '../../core/NodeFactory.js';
|
|
27
28
|
import { getLine, getColumn } from './ast/utils/location.js';
|
|
29
|
+
import { resolveNodeFile } from '../../utils/resolveNodeFile.js';
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
const traverse = (traverseModule as any).default || traverseModule;
|
|
@@ -73,18 +75,6 @@ interface SocketRoomNode {
|
|
|
73
75
|
column: number;
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
/**
|
|
77
|
-
* Socket event channel node - represents a single event across all emitters/listeners
|
|
78
|
-
*/
|
|
79
|
-
interface SocketEventNode {
|
|
80
|
-
id: string;
|
|
81
|
-
type: 'socketio:event';
|
|
82
|
-
name: string; // Event name (e.g., "slot:booked")
|
|
83
|
-
event: string; // Same as name, for consistency
|
|
84
|
-
file?: string; // Not applicable - event is global
|
|
85
|
-
line?: number; // Not applicable
|
|
86
|
-
}
|
|
87
|
-
|
|
88
78
|
/**
|
|
89
79
|
* Analysis result
|
|
90
80
|
*/
|
|
@@ -112,6 +102,7 @@ export class SocketIOAnalyzer extends Plugin {
|
|
|
112
102
|
|
|
113
103
|
try {
|
|
114
104
|
const { graph } = context;
|
|
105
|
+
const projectPath = (context.manifest as { projectPath?: string })?.projectPath ?? '';
|
|
115
106
|
|
|
116
107
|
// Получаем все модули
|
|
117
108
|
const modules = await this.getModules(graph);
|
|
@@ -125,7 +116,7 @@ export class SocketIOAnalyzer extends Plugin {
|
|
|
125
116
|
// PHASE 1: Analyze modules and create emit/listener/room nodes
|
|
126
117
|
for (let i = 0; i < modules.length; i++) {
|
|
127
118
|
const module = modules[i];
|
|
128
|
-
const result = await this.analyzeModule(module, graph);
|
|
119
|
+
const result = await this.analyzeModule(module, graph, projectPath);
|
|
129
120
|
emitsCount += result.emits;
|
|
130
121
|
listenersCount += result.listeners;
|
|
131
122
|
roomsCount += result.rooms;
|
|
@@ -207,22 +198,16 @@ export class SocketIOAnalyzer extends Plugin {
|
|
|
207
198
|
logger.debug('Unique events found', { count: eventNames.size });
|
|
208
199
|
|
|
209
200
|
// Step 3: Create event channel node for each unique event
|
|
210
|
-
const nodes:
|
|
201
|
+
const nodes: AnyBrandedNode[] = [];
|
|
211
202
|
const edges: Array<{ type: string; src: string; dst: string }> = [];
|
|
212
203
|
let createdCount = 0;
|
|
213
204
|
|
|
214
205
|
for (const eventName of eventNames) {
|
|
215
206
|
const eventNodeId = `socketio:event#${eventName}`;
|
|
216
207
|
|
|
217
|
-
// Create event channel node
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
type: 'socketio:event',
|
|
221
|
-
name: eventName,
|
|
222
|
-
event: eventName
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
nodes.push(eventNode as unknown as NodeRecord);
|
|
208
|
+
// Create event channel node via factory
|
|
209
|
+
const brandedNode = NodeFactory.createSocketIOEvent(eventName);
|
|
210
|
+
nodes.push(brandedNode);
|
|
226
211
|
createdCount++;
|
|
227
212
|
|
|
228
213
|
// Step 4: Connect all emits of this event to the channel
|
|
@@ -265,10 +250,11 @@ export class SocketIOAnalyzer extends Plugin {
|
|
|
265
250
|
|
|
266
251
|
private async analyzeModule(
|
|
267
252
|
module: NodeRecord,
|
|
268
|
-
graph: PluginContext['graph']
|
|
253
|
+
graph: PluginContext['graph'],
|
|
254
|
+
projectPath: string
|
|
269
255
|
): Promise<AnalysisResult> {
|
|
270
256
|
try {
|
|
271
|
-
const code = readFileSync(module.file!, 'utf-8');
|
|
257
|
+
const code = readFileSync(resolveNodeFile(module.file!, projectPath), 'utf-8');
|
|
272
258
|
|
|
273
259
|
const ast = parse(code, {
|
|
274
260
|
sourceType: 'module',
|
|
@@ -412,14 +398,16 @@ export class SocketIOAnalyzer extends Plugin {
|
|
|
412
398
|
}
|
|
413
399
|
});
|
|
414
400
|
|
|
415
|
-
//
|
|
416
|
-
const nodes:
|
|
401
|
+
// Create branded nodes via factory
|
|
402
|
+
const nodes: AnyBrandedNode[] = [];
|
|
417
403
|
const edges: Array<{ type: string; src: string; dst: string }> = [];
|
|
418
404
|
|
|
419
405
|
for (const emit of emits) {
|
|
420
|
-
nodes.push(
|
|
406
|
+
nodes.push(NodeFactory.createSocketIOEmit(
|
|
407
|
+
emit.event, emit.objectName, emit.file, emit.line, emit.column,
|
|
408
|
+
{ room: emit.room, namespace: emit.namespace, broadcast: emit.broadcast }
|
|
409
|
+
));
|
|
421
410
|
|
|
422
|
-
// Создаём ребро от модуля к event
|
|
423
411
|
edges.push({
|
|
424
412
|
type: 'CONTAINS',
|
|
425
413
|
src: module.id,
|
|
@@ -428,9 +416,11 @@ export class SocketIOAnalyzer extends Plugin {
|
|
|
428
416
|
}
|
|
429
417
|
|
|
430
418
|
for (const listener of listeners) {
|
|
431
|
-
nodes.push(
|
|
419
|
+
nodes.push(NodeFactory.createSocketIOListener(
|
|
420
|
+
listener.event, listener.objectName, listener.handlerName,
|
|
421
|
+
listener.handlerLine, listener.file, listener.line, listener.column
|
|
422
|
+
));
|
|
432
423
|
|
|
433
|
-
// Создаём ребро от модуля к listener
|
|
434
424
|
edges.push({
|
|
435
425
|
type: 'CONTAINS',
|
|
436
426
|
src: module.id,
|
|
@@ -459,9 +449,10 @@ export class SocketIOAnalyzer extends Plugin {
|
|
|
459
449
|
}
|
|
460
450
|
|
|
461
451
|
for (const room of rooms) {
|
|
462
|
-
nodes.push(
|
|
452
|
+
nodes.push(NodeFactory.createSocketIORoom(
|
|
453
|
+
room.room, room.objectName, room.file, room.line, room.column
|
|
454
|
+
));
|
|
463
455
|
|
|
464
|
-
// Создаём ребро от модуля к room
|
|
465
456
|
edges.push({
|
|
466
457
|
type: 'CONTAINS',
|
|
467
458
|
src: module.id,
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { readFileSync } from 'fs';
|
|
15
|
+
import { resolveNodeFile } from '../../utils/resolveNodeFile.js';
|
|
15
16
|
import type { ParserPlugin } from '@babel/parser';
|
|
16
17
|
import { parse } from '@babel/parser';
|
|
17
18
|
import traverseModule from '@babel/traverse';
|
|
@@ -19,9 +20,10 @@ import type { CallExpression, Identifier, Node } from '@babel/types';
|
|
|
19
20
|
import type { NodePath } from '@babel/traverse';
|
|
20
21
|
import { Plugin, createSuccessResult, createErrorResult } from '../Plugin.js';
|
|
21
22
|
import type { PluginContext, PluginResult, PluginMetadata } from '../Plugin.js';
|
|
22
|
-
import type { NodeRecord } from '@grafema/types';
|
|
23
|
+
import type { NodeRecord, AnyBrandedNode } from '@grafema/types';
|
|
24
|
+
import { brandNodeInternal } from '../../core/brandNodeInternal.js';
|
|
25
|
+
|
|
23
26
|
|
|
24
|
-
|
|
25
27
|
const traverse = (traverseModule as any).default || traverseModule;
|
|
26
28
|
|
|
27
29
|
/**
|
|
@@ -63,6 +65,7 @@ export class SystemDbAnalyzer extends Plugin {
|
|
|
63
65
|
|
|
64
66
|
try {
|
|
65
67
|
const { graph } = context;
|
|
68
|
+
const projectPath = (context.manifest as { projectPath?: string })?.projectPath ?? '';
|
|
66
69
|
|
|
67
70
|
let nodesCreated = 0;
|
|
68
71
|
let edgesCreated = 0;
|
|
@@ -73,14 +76,14 @@ export class SystemDbAnalyzer extends Plugin {
|
|
|
73
76
|
logger.info('Analyzing modules for system_db patterns', { count: modules.length });
|
|
74
77
|
|
|
75
78
|
// Collect all nodes and edges across ALL modules
|
|
76
|
-
const allNodes:
|
|
79
|
+
const allNodes: AnyBrandedNode[] = [];
|
|
77
80
|
const allEdges: Array<{ type: string; src: string; dst: string }> = [];
|
|
78
81
|
|
|
79
82
|
for (const module of modules) {
|
|
80
83
|
if (!module.file) continue;
|
|
81
84
|
|
|
82
85
|
try {
|
|
83
|
-
const code = readFileSync(module.file, 'utf-8');
|
|
86
|
+
const code = readFileSync(resolveNodeFile(module.file, projectPath), 'utf-8');
|
|
84
87
|
const ast = parse(code, {
|
|
85
88
|
sourceType: 'module',
|
|
86
89
|
plugins: ['jsx', 'typescript'] as ParserPlugin[],
|
|
@@ -182,17 +185,17 @@ export class SystemDbAnalyzer extends Plugin {
|
|
|
182
185
|
line: reg.line
|
|
183
186
|
});
|
|
184
187
|
|
|
185
|
-
allNodes.push({
|
|
188
|
+
allNodes.push(brandNodeInternal({
|
|
186
189
|
id: nodeId,
|
|
187
|
-
type: 'SYSTEM_DB_VIEW_REGISTRATION',
|
|
190
|
+
type: 'SYSTEM_DB_VIEW_REGISTRATION' as NodeRecord['type'],
|
|
188
191
|
name: `${reg.type}('${reg.viewName}', '${reg.serverName}')`,
|
|
189
|
-
file: module.file
|
|
192
|
+
file: module.file!,
|
|
190
193
|
line: reg.line,
|
|
191
194
|
column: reg.column,
|
|
192
195
|
viewName: reg.viewName,
|
|
193
196
|
serverName: reg.serverName,
|
|
194
197
|
callType: reg.type
|
|
195
|
-
}
|
|
198
|
+
}));
|
|
196
199
|
nodesCreated++;
|
|
197
200
|
|
|
198
201
|
// Link MODULE -> REGISTERS_VIEW -> REGISTRATION
|
|
@@ -208,15 +211,15 @@ export class SystemDbAnalyzer extends Plugin {
|
|
|
208
211
|
for (const sub of subscriptions) {
|
|
209
212
|
const nodeId = `${module.file}:SYSTEM_DB_SUBSCRIPTION:${sub.line}`;
|
|
210
213
|
|
|
211
|
-
allNodes.push({
|
|
214
|
+
allNodes.push(brandNodeInternal({
|
|
212
215
|
id: nodeId,
|
|
213
|
-
type: 'SYSTEM_DB_SUBSCRIPTION',
|
|
216
|
+
type: 'SYSTEM_DB_SUBSCRIPTION' as NodeRecord['type'],
|
|
214
217
|
name: `subscribe([${sub.servers.join(', ')}])`,
|
|
215
|
-
file: module.file
|
|
218
|
+
file: module.file!,
|
|
216
219
|
line: sub.line,
|
|
217
220
|
column: sub.column,
|
|
218
221
|
servers: sub.servers
|
|
219
|
-
}
|
|
222
|
+
}));
|
|
220
223
|
nodesCreated++;
|
|
221
224
|
|
|
222
225
|
// Link MODULE -> CHECKS_VIEWS -> SUBSCRIPTION
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CollisionResolver - Graduated disambiguation for v2 semantic IDs.
|
|
3
|
+
*
|
|
4
|
+
* Pipeline position: After all visitors complete for a file, before GraphBuilder.
|
|
5
|
+
*
|
|
6
|
+
* Algorithm:
|
|
7
|
+
* 1. Group PendingNodes by baseId
|
|
8
|
+
* 2. For groups with size=1: no change needed
|
|
9
|
+
* 3. For groups with size>1: compute content hashes
|
|
10
|
+
* a. If all hashes unique within group: append [h:xxxx]
|
|
11
|
+
* b. If hash collision: append [h:xxxx]#N (counter)
|
|
12
|
+
*
|
|
13
|
+
* Complexity: O(n) amortized where n = total nodes in file.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { computeContentHash } from '../../../core/SemanticId.js';
|
|
17
|
+
import type { ContentHashHints } from '../../../core/SemanticId.js';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A node awaiting final ID assignment.
|
|
21
|
+
*
|
|
22
|
+
* Created by visitors during AST traversal. Contains the
|
|
23
|
+
* base ID (without hash/counter) and content hints for
|
|
24
|
+
* hash computation if disambiguation is needed.
|
|
25
|
+
*/
|
|
26
|
+
export interface PendingNode {
|
|
27
|
+
/** Base ID: file->TYPE->name or file->TYPE->name[in:parent] */
|
|
28
|
+
baseId: string;
|
|
29
|
+
|
|
30
|
+
/** Content hints for hash computation (node-type-specific) */
|
|
31
|
+
contentHints: ContentHashHints;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Reference to the collection object whose .id will be updated.
|
|
35
|
+
* CollisionResolver mutates this in place.
|
|
36
|
+
*/
|
|
37
|
+
collectionRef: { id: string };
|
|
38
|
+
|
|
39
|
+
/** Original insertion order (for deterministic counter assignment) */
|
|
40
|
+
insertionOrder: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class CollisionResolver {
|
|
44
|
+
/**
|
|
45
|
+
* Resolve collisions and assign final IDs.
|
|
46
|
+
*
|
|
47
|
+
* Mutates each PendingNode's collectionRef.id in place.
|
|
48
|
+
* Returns a map of baseId -> finalId for nodes that were changed,
|
|
49
|
+
* used to rewrite cross-references (e.g., callArguments.parentCallId).
|
|
50
|
+
*
|
|
51
|
+
* Note: since multiple nodes can share the same baseId, the returned map
|
|
52
|
+
* only contains entries where the OLD id on the collectionRef differs
|
|
53
|
+
* from the NEW final id. Callers should use collectionRef objects for
|
|
54
|
+
* precise cross-reference resolution.
|
|
55
|
+
*/
|
|
56
|
+
resolve(nodes: PendingNode[]): void {
|
|
57
|
+
if (nodes.length === 0) return;
|
|
58
|
+
|
|
59
|
+
// Step 1: Group by baseId
|
|
60
|
+
const groups = new Map<string, PendingNode[]>();
|
|
61
|
+
for (const node of nodes) {
|
|
62
|
+
let group = groups.get(node.baseId);
|
|
63
|
+
if (!group) {
|
|
64
|
+
group = [];
|
|
65
|
+
groups.set(node.baseId, group);
|
|
66
|
+
}
|
|
67
|
+
group.push(node);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Step 2: Process each group
|
|
71
|
+
for (const [baseId, group] of groups) {
|
|
72
|
+
if (group.length === 1) {
|
|
73
|
+
// Unique -- base ID is final
|
|
74
|
+
group[0].collectionRef.id = baseId;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Sort by insertion order for deterministic counter assignment
|
|
79
|
+
group.sort((a, b) => a.insertionOrder - b.insertionOrder);
|
|
80
|
+
|
|
81
|
+
// Compute hashes for all nodes in group
|
|
82
|
+
const hashes = group.map(n => computeContentHash(n.contentHints));
|
|
83
|
+
|
|
84
|
+
// Sub-group by hash
|
|
85
|
+
const hashGroups = new Map<string, number[]>();
|
|
86
|
+
for (let i = 0; i < group.length; i++) {
|
|
87
|
+
const hash = hashes[i];
|
|
88
|
+
let hg = hashGroups.get(hash);
|
|
89
|
+
if (!hg) {
|
|
90
|
+
hg = [];
|
|
91
|
+
hashGroups.set(hash, hg);
|
|
92
|
+
}
|
|
93
|
+
hg.push(i);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Assign final IDs
|
|
97
|
+
for (const [hash, indices] of hashGroups) {
|
|
98
|
+
if (indices.length === 1) {
|
|
99
|
+
// Unique hash within collision group
|
|
100
|
+
const node = group[indices[0]];
|
|
101
|
+
node.collectionRef.id = this.appendHash(baseId, hash);
|
|
102
|
+
} else {
|
|
103
|
+
// Hash collision -- need counter
|
|
104
|
+
for (let c = 0; c < indices.length; c++) {
|
|
105
|
+
const node = group[indices[c]];
|
|
106
|
+
node.collectionRef.id = this.appendHashAndCounter(baseId, hash, c);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Append content hash to base ID.
|
|
115
|
+
*
|
|
116
|
+
* "file->TYPE->name" -> "file->TYPE->name[h:xxxx]"
|
|
117
|
+
* "file->TYPE->name[in:parent]" -> "file->TYPE->name[in:parent,h:xxxx]"
|
|
118
|
+
*/
|
|
119
|
+
private appendHash(baseId: string, hash: string): string {
|
|
120
|
+
const bracketIdx = baseId.indexOf('[');
|
|
121
|
+
if (bracketIdx === -1) {
|
|
122
|
+
return `${baseId}[h:${hash}]`;
|
|
123
|
+
}
|
|
124
|
+
// Insert hash before closing bracket
|
|
125
|
+
return `${baseId.slice(0, -1)},h:${hash}]`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Append content hash and counter to base ID.
|
|
130
|
+
* Counter 0 is omitted (first occurrence doesn't need disambiguation).
|
|
131
|
+
*/
|
|
132
|
+
private appendHashAndCounter(baseId: string, hash: string, counter: number): string {
|
|
133
|
+
const withHash = this.appendHash(baseId, hash);
|
|
134
|
+
if (counter === 0) return withHash;
|
|
135
|
+
return `${withHash}#${counter}`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/** FunctionBodyContext - all local state for analyzeFunctionBody() traversal. */
|
|
2
|
+
import type { NodePath } from '@babel/traverse';
|
|
3
|
+
import * as t from '@babel/types';
|
|
4
|
+
import { getLine, getColumn } from './utils/location.js';
|
|
5
|
+
import type { ScopeTracker } from '../../../core/ScopeTracker.js';
|
|
6
|
+
import type {
|
|
7
|
+
FunctionInfo, ScopeInfo, BranchInfo, LoopInfo,
|
|
8
|
+
TryBlockInfo, CatchBlockInfo, FinallyBlockInfo,
|
|
9
|
+
VariableDeclarationInfo, CallSiteInfo, MethodCallInfo,
|
|
10
|
+
EventListenerInfo, MethodCallbackInfo, ClassInstantiationInfo,
|
|
11
|
+
ConstructorCallInfo, HttpRequestInfo, LiteralInfo,
|
|
12
|
+
VariableAssignmentInfo, ObjectLiteralInfo, ObjectPropertyInfo,
|
|
13
|
+
ReturnStatementInfo, YieldExpressionInfo, UpdateExpressionInfo,
|
|
14
|
+
PromiseExecutorContext, PromiseResolutionInfo, RejectionPatternInfo,
|
|
15
|
+
CatchesFromInfo, ParameterInfo, CounterRef, ProcessedNodes,
|
|
16
|
+
} from './types.js';
|
|
17
|
+
import type { VisitorModule, VisitorCollections } from './visitors/index.js';
|
|
18
|
+
|
|
19
|
+
/** Tracks if/else scope transitions during traversal (Phase 3: includes branchId). */
|
|
20
|
+
export interface IfElseScopeInfo {
|
|
21
|
+
inElse: boolean;
|
|
22
|
+
hasElse: boolean;
|
|
23
|
+
ifScopeId: string;
|
|
24
|
+
elseScopeId: string | null;
|
|
25
|
+
branchId: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Tracks try/catch/finally scope transitions during traversal. */
|
|
29
|
+
export interface TryScopeInfo {
|
|
30
|
+
tryScopeId: string;
|
|
31
|
+
catchScopeId: string | null;
|
|
32
|
+
finallyScopeId: string | null;
|
|
33
|
+
currentBlock: 'try' | 'catch' | 'finally';
|
|
34
|
+
tryBlockId: string;
|
|
35
|
+
catchBlockId: string | null;
|
|
36
|
+
finallyBlockId: string | null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Phase 6 (REG-267): Control flow tracking state for cyclomatic complexity. */
|
|
40
|
+
export interface ControlFlowState {
|
|
41
|
+
branchCount: number;
|
|
42
|
+
loopCount: number;
|
|
43
|
+
caseCount: number;
|
|
44
|
+
logicalOpCount: number;
|
|
45
|
+
hasTryCatch: boolean;
|
|
46
|
+
hasEarlyReturn: boolean;
|
|
47
|
+
hasThrow: boolean;
|
|
48
|
+
returnCount: number;
|
|
49
|
+
totalStatements: number;
|
|
50
|
+
tryBlockDepth: number; // REG-311: O(1) isInsideTry
|
|
51
|
+
loopDepth: number; // REG-298: O(1) isInsideLoop
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** All local state needed by function body traversal handlers. */
|
|
55
|
+
export interface FunctionBodyContext {
|
|
56
|
+
// Function identity
|
|
57
|
+
funcPath: NodePath<t.Function | t.StaticBlock>;
|
|
58
|
+
funcNode: t.Function | t.StaticBlock;
|
|
59
|
+
functionNode: t.Function | null;
|
|
60
|
+
functionPath: NodePath<t.Function> | null;
|
|
61
|
+
funcLine: number;
|
|
62
|
+
funcColumn: number;
|
|
63
|
+
currentFunctionId: string | null;
|
|
64
|
+
matchingFunction: FunctionInfo | undefined;
|
|
65
|
+
// Module & scope
|
|
66
|
+
module: VisitorModule;
|
|
67
|
+
collections: VisitorCollections;
|
|
68
|
+
parentScopeId: string;
|
|
69
|
+
scopeIdStack: string[];
|
|
70
|
+
getCurrentScopeId: () => string;
|
|
71
|
+
scopeTracker: ScopeTracker | undefined;
|
|
72
|
+
// Collections extracted from VisitorCollections
|
|
73
|
+
functions: FunctionInfo[];
|
|
74
|
+
scopes: ScopeInfo[];
|
|
75
|
+
variableDeclarations: VariableDeclarationInfo[];
|
|
76
|
+
callSites: CallSiteInfo[];
|
|
77
|
+
methodCalls: MethodCallInfo[];
|
|
78
|
+
eventListeners: EventListenerInfo[];
|
|
79
|
+
methodCallbacks: MethodCallbackInfo[];
|
|
80
|
+
classInstantiations: ClassInstantiationInfo[];
|
|
81
|
+
constructorCalls: ConstructorCallInfo[];
|
|
82
|
+
httpRequests: HttpRequestInfo[];
|
|
83
|
+
literals: LiteralInfo[];
|
|
84
|
+
variableAssignments: VariableAssignmentInfo[];
|
|
85
|
+
parameters: ParameterInfo[];
|
|
86
|
+
returnStatements: ReturnStatementInfo[];
|
|
87
|
+
yieldExpressions: YieldExpressionInfo[];
|
|
88
|
+
updateExpressions: UpdateExpressionInfo[];
|
|
89
|
+
objectLiterals: ObjectLiteralInfo[];
|
|
90
|
+
objectProperties: ObjectPropertyInfo[];
|
|
91
|
+
// Control flow
|
|
92
|
+
loops: LoopInfo[];
|
|
93
|
+
branches: BranchInfo[];
|
|
94
|
+
tryBlocks: TryBlockInfo[];
|
|
95
|
+
catchBlocks: CatchBlockInfo[];
|
|
96
|
+
finallyBlocks: FinallyBlockInfo[];
|
|
97
|
+
// Promise & error tracking
|
|
98
|
+
promiseExecutorContexts: Map<string, PromiseExecutorContext>;
|
|
99
|
+
promiseResolutions: PromiseResolutionInfo[];
|
|
100
|
+
rejectionPatterns: RejectionPatternInfo[];
|
|
101
|
+
catchesFromInfos: CatchesFromInfo[];
|
|
102
|
+
// Counter refs
|
|
103
|
+
objectLiteralCounterRef: CounterRef;
|
|
104
|
+
loopCounterRef: CounterRef;
|
|
105
|
+
branchCounterRef: CounterRef;
|
|
106
|
+
tryBlockCounterRef: CounterRef;
|
|
107
|
+
catchBlockCounterRef: CounterRef;
|
|
108
|
+
finallyBlockCounterRef: CounterRef;
|
|
109
|
+
ifScopeCounterRef: CounterRef;
|
|
110
|
+
scopeCounterRef: CounterRef;
|
|
111
|
+
varDeclCounterRef: CounterRef;
|
|
112
|
+
callSiteCounterRef: CounterRef;
|
|
113
|
+
functionCounterRef: CounterRef;
|
|
114
|
+
httpRequestCounterRef: CounterRef;
|
|
115
|
+
literalCounterRef: CounterRef;
|
|
116
|
+
anonymousFunctionCounterRef: CounterRef;
|
|
117
|
+
// Processed nodes (deduplication)
|
|
118
|
+
processedNodes: ProcessedNodes;
|
|
119
|
+
processedCallSites: Set<string>;
|
|
120
|
+
processedMethodCalls: Set<string>;
|
|
121
|
+
processedVarDecls: Set<string>;
|
|
122
|
+
processedEventListeners: Set<string>;
|
|
123
|
+
parentScopeVariables: Set<{ name: string; id: string; scopeId: string }>;
|
|
124
|
+
// Scope tracking maps
|
|
125
|
+
ifElseScopeMap: Map<t.IfStatement, IfElseScopeInfo>;
|
|
126
|
+
tryScopeMap: Map<t.TryStatement, TryScopeInfo>;
|
|
127
|
+
// Parameter invocation tracking (REG-401, REG-416, REG-417)
|
|
128
|
+
paramNameToIndex: Map<string, number>;
|
|
129
|
+
paramNameToPropertyPath: Map<string, string[]>;
|
|
130
|
+
restParamNames: Set<string>;
|
|
131
|
+
invokedParamIndexes: Set<number>;
|
|
132
|
+
invokesParamBindings: { paramIndex: number; propertyPath: string[] }[];
|
|
133
|
+
aliasToParamIndex: Map<string, number>;
|
|
134
|
+
// Control flow state (REG-267)
|
|
135
|
+
controlFlowState: ControlFlowState;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function ensure<T>(c: VisitorCollections, k: string, fb: () => unknown): T {
|
|
139
|
+
if (!c[k]) { c[k] = fb(); }
|
|
140
|
+
return c[k] as T;
|
|
141
|
+
}
|
|
142
|
+
function extract<T>(c: VisitorCollections, k: string): T[] { return (c[k] ?? []) as T[]; }
|
|
143
|
+
function counter(c: VisitorCollections, k: string): CounterRef { return (c[k] ?? { value: 0 }) as CounterRef; }
|
|
144
|
+
|
|
145
|
+
/** Creates FunctionBodyContext matching analyzeFunctionBody() lines 3507-3763 init logic. */
|
|
146
|
+
export function createFunctionBodyContext(
|
|
147
|
+
funcPath: NodePath<t.Function | t.StaticBlock>,
|
|
148
|
+
parentScopeId: string,
|
|
149
|
+
module: VisitorModule,
|
|
150
|
+
collections: VisitorCollections,
|
|
151
|
+
functions: FunctionInfo[],
|
|
152
|
+
extractNamesFromPatternFn: (pattern: t.ObjectPattern | t.ArrayPattern) => { name: string; propertyPath?: string[] }[],
|
|
153
|
+
): FunctionBodyContext {
|
|
154
|
+
const c = collections;
|
|
155
|
+
const scopes = extract<ScopeInfo>(c, 'scopes');
|
|
156
|
+
const variableDeclarations = extract<VariableDeclarationInfo>(c, 'variableDeclarations');
|
|
157
|
+
const callSites = extract<CallSiteInfo>(c, 'callSites');
|
|
158
|
+
const methodCalls = extract<MethodCallInfo>(c, 'methodCalls');
|
|
159
|
+
const eventListeners = extract<EventListenerInfo>(c, 'eventListeners');
|
|
160
|
+
const methodCallbacks = extract<MethodCallbackInfo>(c, 'methodCallbacks');
|
|
161
|
+
const classInstantiations = extract<ClassInstantiationInfo>(c, 'classInstantiations');
|
|
162
|
+
const constructorCalls = extract<ConstructorCallInfo>(c, 'constructorCalls');
|
|
163
|
+
const httpRequests = extract<HttpRequestInfo>(c, 'httpRequests');
|
|
164
|
+
const literals = extract<LiteralInfo>(c, 'literals');
|
|
165
|
+
const variableAssignments = extract<VariableAssignmentInfo>(c, 'variableAssignments');
|
|
166
|
+
const parameters = extract<ParameterInfo>(c, 'parameters');
|
|
167
|
+
const returnStatements = extract<ReturnStatementInfo>(c, 'returnStatements');
|
|
168
|
+
const updateExpressions = extract<UpdateExpressionInfo>(c, 'updateExpressions');
|
|
169
|
+
const ifScopeCounterRef = counter(c, 'ifScopeCounterRef');
|
|
170
|
+
const scopeCounterRef = counter(c, 'scopeCounterRef');
|
|
171
|
+
const varDeclCounterRef = counter(c, 'varDeclCounterRef');
|
|
172
|
+
const callSiteCounterRef = counter(c, 'callSiteCounterRef');
|
|
173
|
+
const functionCounterRef = counter(c, 'functionCounterRef');
|
|
174
|
+
const httpRequestCounterRef = counter(c, 'httpRequestCounterRef');
|
|
175
|
+
const literalCounterRef = counter(c, 'literalCounterRef');
|
|
176
|
+
const anonymousFunctionCounterRef = counter(c, 'anonymousFunctionCounterRef');
|
|
177
|
+
const scopeTracker = c.scopeTracker as ScopeTracker | undefined;
|
|
178
|
+
const objectLiterals = ensure<ObjectLiteralInfo[]>(c, 'objectLiterals', () => []);
|
|
179
|
+
const objectProperties = ensure<ObjectPropertyInfo[]>(c, 'objectProperties', () => []);
|
|
180
|
+
const objectLiteralCounterRef = ensure<CounterRef>(c, 'objectLiteralCounterRef', () => ({ value: 0 }));
|
|
181
|
+
const yieldExpressions = ensure<YieldExpressionInfo[]>(c, 'yieldExpressions', () => []);
|
|
182
|
+
const loops = ensure<LoopInfo[]>(c, 'loops', () => []);
|
|
183
|
+
const loopCounterRef = ensure<CounterRef>(c, 'loopCounterRef', () => ({ value: 0 }));
|
|
184
|
+
const branches = ensure<BranchInfo[]>(c, 'branches', () => []);
|
|
185
|
+
const branchCounterRef = ensure<CounterRef>(c, 'branchCounterRef', () => ({ value: 0 }));
|
|
186
|
+
const tryBlocks = ensure<TryBlockInfo[]>(c, 'tryBlocks', () => []);
|
|
187
|
+
const catchBlocks = ensure<CatchBlockInfo[]>(c, 'catchBlocks', () => []);
|
|
188
|
+
const finallyBlocks = ensure<FinallyBlockInfo[]>(c, 'finallyBlocks', () => []);
|
|
189
|
+
const tryBlockCounterRef = ensure<CounterRef>(c, 'tryBlockCounterRef', () => ({ value: 0 }));
|
|
190
|
+
const catchBlockCounterRef = ensure<CounterRef>(c, 'catchBlockCounterRef', () => ({ value: 0 }));
|
|
191
|
+
const finallyBlockCounterRef = ensure<CounterRef>(c, 'finallyBlockCounterRef', () => ({ value: 0 }));
|
|
192
|
+
const promiseExecutorContexts = ensure<Map<string, PromiseExecutorContext>>(
|
|
193
|
+
c, 'promiseExecutorContexts', () => new Map<string, PromiseExecutorContext>());
|
|
194
|
+
const promiseResolutions = ensure<PromiseResolutionInfo[]>(c, 'promiseResolutions', () => []);
|
|
195
|
+
const rejectionPatterns = ensure<RejectionPatternInfo[]>(c, 'rejectionPatterns', () => []);
|
|
196
|
+
const catchesFromInfos = ensure<CatchesFromInfo[]>(c, 'catchesFromInfos', () => []);
|
|
197
|
+
|
|
198
|
+
const processedNodes: ProcessedNodes = c.processedNodes ?? {
|
|
199
|
+
functions: new Set<string>(), classes: new Set<string>(),
|
|
200
|
+
imports: new Set<string>(), exports: new Set<string>(),
|
|
201
|
+
variables: new Set<string>(), callSites: new Set<string>(),
|
|
202
|
+
methodCalls: new Set<string>(), varDecls: new Set<string>(),
|
|
203
|
+
eventListeners: new Set<string>(),
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const scopeIdStack: string[] = [parentScopeId];
|
|
207
|
+
const getCurrentScopeId = (): string => scopeIdStack[scopeIdStack.length - 1];
|
|
208
|
+
|
|
209
|
+
// Function identity
|
|
210
|
+
const funcNode = funcPath.node;
|
|
211
|
+
const functionNode = t.isFunction(funcNode) ? funcNode : null;
|
|
212
|
+
const functionPath = functionNode ? (funcPath as NodePath<t.Function>) : null;
|
|
213
|
+
const funcLine = getLine(funcNode);
|
|
214
|
+
const funcColumn = getColumn(funcNode);
|
|
215
|
+
let currentFunctionId: string | null = null;
|
|
216
|
+
|
|
217
|
+
const matchingFunction = funcNode.type !== 'StaticBlock'
|
|
218
|
+
? functions.find(f =>
|
|
219
|
+
f.file === module.file && f.line === funcLine &&
|
|
220
|
+
(f.column === undefined || f.column === funcColumn))
|
|
221
|
+
: undefined;
|
|
222
|
+
if (matchingFunction) { currentFunctionId = matchingFunction.id; }
|
|
223
|
+
|
|
224
|
+
// Parameter invocation tracking (REG-401, REG-416, REG-417)
|
|
225
|
+
const paramNameToIndex = new Map<string, number>();
|
|
226
|
+
const paramNameToPropertyPath = new Map<string, string[]>();
|
|
227
|
+
const restParamNames = new Set<string>();
|
|
228
|
+
const invokedParamIndexes = new Set<number>();
|
|
229
|
+
const invokesParamBindings: { paramIndex: number; propertyPath: string[] }[] = [];
|
|
230
|
+
const aliasToParamIndex = new Map<string, number>();
|
|
231
|
+
|
|
232
|
+
if (functionNode) {
|
|
233
|
+
for (let i = 0; i < functionNode.params.length; i++) {
|
|
234
|
+
const param = functionNode.params[i];
|
|
235
|
+
if (t.isIdentifier(param)) {
|
|
236
|
+
paramNameToIndex.set(param.name, i);
|
|
237
|
+
} else if (t.isAssignmentPattern(param)) {
|
|
238
|
+
if (t.isIdentifier(param.left)) {
|
|
239
|
+
paramNameToIndex.set(param.left.name, i);
|
|
240
|
+
} else if (t.isObjectPattern(param.left) || t.isArrayPattern(param.left)) {
|
|
241
|
+
for (const info of extractNamesFromPatternFn(param.left)) {
|
|
242
|
+
paramNameToIndex.set(info.name, i);
|
|
243
|
+
if (info.propertyPath) { paramNameToPropertyPath.set(info.name, info.propertyPath); }
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
} else if (t.isObjectPattern(param) || t.isArrayPattern(param)) {
|
|
247
|
+
for (const info of extractNamesFromPatternFn(param)) {
|
|
248
|
+
paramNameToIndex.set(info.name, i);
|
|
249
|
+
if (info.propertyPath) { paramNameToPropertyPath.set(info.name, info.propertyPath); }
|
|
250
|
+
}
|
|
251
|
+
} else if (t.isRestElement(param) && t.isIdentifier(param.argument)) {
|
|
252
|
+
paramNameToIndex.set(param.argument.name, i);
|
|
253
|
+
restParamNames.add(param.argument.name);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const controlFlowState: ControlFlowState = {
|
|
259
|
+
branchCount: 0, loopCount: 0, caseCount: 0, logicalOpCount: 0,
|
|
260
|
+
hasTryCatch: false, hasEarlyReturn: false, hasThrow: false,
|
|
261
|
+
returnCount: 0, totalStatements: 0, tryBlockDepth: 0, loopDepth: 0,
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
return {
|
|
265
|
+
funcPath, funcNode, functionNode, functionPath, funcLine, funcColumn, currentFunctionId, matchingFunction,
|
|
266
|
+
module, collections, parentScopeId, scopeIdStack, getCurrentScopeId, scopeTracker,
|
|
267
|
+
functions, scopes, variableDeclarations, callSites, methodCalls,
|
|
268
|
+
eventListeners, methodCallbacks, classInstantiations, constructorCalls,
|
|
269
|
+
httpRequests, literals, variableAssignments, parameters,
|
|
270
|
+
returnStatements, yieldExpressions, updateExpressions,
|
|
271
|
+
objectLiterals, objectProperties,
|
|
272
|
+
loops, branches, tryBlocks, catchBlocks, finallyBlocks,
|
|
273
|
+
promiseExecutorContexts, promiseResolutions, rejectionPatterns, catchesFromInfos,
|
|
274
|
+
objectLiteralCounterRef, loopCounterRef, branchCounterRef,
|
|
275
|
+
tryBlockCounterRef, catchBlockCounterRef, finallyBlockCounterRef,
|
|
276
|
+
ifScopeCounterRef, scopeCounterRef, varDeclCounterRef,
|
|
277
|
+
callSiteCounterRef, functionCounterRef, httpRequestCounterRef,
|
|
278
|
+
literalCounterRef, anonymousFunctionCounterRef,
|
|
279
|
+
processedNodes,
|
|
280
|
+
processedCallSites: processedNodes.callSites,
|
|
281
|
+
processedMethodCalls: processedNodes.methodCalls,
|
|
282
|
+
processedVarDecls: processedNodes.varDecls,
|
|
283
|
+
processedEventListeners: processedNodes.eventListeners,
|
|
284
|
+
parentScopeVariables: new Set<{ name: string; id: string; scopeId: string }>(),
|
|
285
|
+
ifElseScopeMap: new Map<t.IfStatement, IfElseScopeInfo>(),
|
|
286
|
+
tryScopeMap: new Map<t.TryStatement, TryScopeInfo>(),
|
|
287
|
+
paramNameToIndex, paramNameToPropertyPath, restParamNames,
|
|
288
|
+
invokedParamIndexes, invokesParamBindings, aliasToParamIndex,
|
|
289
|
+
controlFlowState,
|
|
290
|
+
};
|
|
291
|
+
}
|