@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
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/** CallExpressionHandler — handles CallExpression nodes. (REG-422, lines ~4348-4677) */
|
|
2
|
+
import type { Visitor, NodePath } from '@babel/traverse';
|
|
3
|
+
import * as t from '@babel/types';
|
|
4
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
5
|
+
import { ExpressionEvaluator } from '../ExpressionEvaluator.js';
|
|
6
|
+
import type { CallArgumentInfo } from '../types.js';
|
|
7
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
8
|
+
|
|
9
|
+
export class CallExpressionHandler extends FunctionBodyHandler {
|
|
10
|
+
getHandlers(): Visitor {
|
|
11
|
+
const ctx = this.ctx;
|
|
12
|
+
const analyzer = this.analyzer;
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
// Function call expressions
|
|
16
|
+
CallExpression: (callPath: NodePath<t.CallExpression>) => {
|
|
17
|
+
// REG-311: Detect isAwaited (parent is AwaitExpression)
|
|
18
|
+
const parent = callPath.parentPath;
|
|
19
|
+
const isAwaited = parent?.isAwaitExpression() ?? false;
|
|
20
|
+
|
|
21
|
+
// REG-311: Detect isInsideTry (O(1) via depth counter)
|
|
22
|
+
const isInsideTry = ctx.controlFlowState.tryBlockDepth > 0;
|
|
23
|
+
|
|
24
|
+
// REG-298: Detect isInsideLoop (O(1) via depth counter)
|
|
25
|
+
const isInsideLoop = ctx.controlFlowState.loopDepth > 0;
|
|
26
|
+
|
|
27
|
+
analyzer.handleCallExpression(
|
|
28
|
+
callPath.node,
|
|
29
|
+
ctx.processedCallSites,
|
|
30
|
+
ctx.processedMethodCalls,
|
|
31
|
+
ctx.callSites,
|
|
32
|
+
ctx.methodCalls,
|
|
33
|
+
ctx.module,
|
|
34
|
+
ctx.callSiteCounterRef,
|
|
35
|
+
ctx.scopeTracker,
|
|
36
|
+
ctx.getCurrentScopeId(),
|
|
37
|
+
ctx.collections,
|
|
38
|
+
isAwaited,
|
|
39
|
+
isInsideTry,
|
|
40
|
+
isInsideLoop
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// REG-401: Detect parameter invocation for user-defined HOF tracking
|
|
44
|
+
// If callee is an Identifier matching a parameter name or alias (REG-416),
|
|
45
|
+
// record the param index.
|
|
46
|
+
// REG-417: Also detect rest param array access: fns[0]() via MemberExpression callee.
|
|
47
|
+
// Nested functions are already skipped by FunctionDeclaration/FunctionExpression/ArrowFunction
|
|
48
|
+
// handlers calling path.skip(), so shadowed names won't be falsely matched.
|
|
49
|
+
const callNodeForParam = callPath.node;
|
|
50
|
+
if (ctx.paramNameToIndex.size > 0 || ctx.aliasToParamIndex.size > 0) {
|
|
51
|
+
if (t.isIdentifier(callNodeForParam.callee)) {
|
|
52
|
+
const calleeName = callNodeForParam.callee.name;
|
|
53
|
+
const paramIndex = ctx.paramNameToIndex.get(calleeName) ?? ctx.aliasToParamIndex.get(calleeName);
|
|
54
|
+
if (paramIndex !== undefined) {
|
|
55
|
+
ctx.invokedParamIndexes.add(paramIndex);
|
|
56
|
+
// REG-417: Record property path for destructured param bindings
|
|
57
|
+
const propertyPath = ctx.paramNameToPropertyPath.get(calleeName);
|
|
58
|
+
if (propertyPath) {
|
|
59
|
+
ctx.invokesParamBindings.push({ paramIndex, propertyPath });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
} else if (
|
|
63
|
+
t.isMemberExpression(callNodeForParam.callee) &&
|
|
64
|
+
t.isIdentifier(callNodeForParam.callee.object) &&
|
|
65
|
+
ctx.restParamNames.has(callNodeForParam.callee.object.name)
|
|
66
|
+
) {
|
|
67
|
+
// REG-417: Rest param invoked via array access, e.g. fns[0]()
|
|
68
|
+
const paramIndex = ctx.paramNameToIndex.get(callNodeForParam.callee.object.name);
|
|
69
|
+
if (paramIndex !== undefined) {
|
|
70
|
+
ctx.invokedParamIndexes.add(paramIndex);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// REG-334: Check for resolve/reject calls inside Promise executors
|
|
76
|
+
const callNode = callPath.node;
|
|
77
|
+
if (t.isIdentifier(callNode.callee)) {
|
|
78
|
+
const calleeName = callNode.callee.name;
|
|
79
|
+
|
|
80
|
+
// Walk up function parents to find Promise executor context
|
|
81
|
+
// This handles nested callbacks like: new Promise((resolve) => { db.query((err, data) => { resolve(data); }); });
|
|
82
|
+
let funcParent = callPath.getFunctionParent();
|
|
83
|
+
while (funcParent) {
|
|
84
|
+
const funcNode = funcParent.node;
|
|
85
|
+
const funcKey = `${funcNode.start}:${funcNode.end}`;
|
|
86
|
+
const context = ctx.promiseExecutorContexts.get(funcKey);
|
|
87
|
+
|
|
88
|
+
if (context) {
|
|
89
|
+
const isResolve = calleeName === context.resolveName;
|
|
90
|
+
const isReject = calleeName === context.rejectName;
|
|
91
|
+
|
|
92
|
+
if (isResolve || isReject) {
|
|
93
|
+
// Find the CALL node ID for this resolve/reject call
|
|
94
|
+
// It was just added by handleCallExpression
|
|
95
|
+
const callLine = getLine(callNode);
|
|
96
|
+
const callColumn = getColumn(callNode);
|
|
97
|
+
|
|
98
|
+
// Find matching call site that was just added
|
|
99
|
+
const resolveCall = ctx.callSites.find(cs =>
|
|
100
|
+
cs.name === calleeName &&
|
|
101
|
+
cs.file === ctx.module.file &&
|
|
102
|
+
cs.line === callLine &&
|
|
103
|
+
cs.column === callColumn
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
if (resolveCall) {
|
|
107
|
+
ctx.promiseResolutions.push({
|
|
108
|
+
callId: resolveCall.id,
|
|
109
|
+
constructorCallId: context.constructorCallId,
|
|
110
|
+
isReject,
|
|
111
|
+
file: ctx.module.file,
|
|
112
|
+
line: callLine
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// REG-334: Collect arguments for resolve/reject calls
|
|
116
|
+
// This enables traceValues to follow PASSES_ARGUMENT edges
|
|
117
|
+
if (!ctx.collections.callArguments) {
|
|
118
|
+
ctx.collections.callArguments = [];
|
|
119
|
+
}
|
|
120
|
+
const callArgumentsArr = ctx.collections.callArguments as CallArgumentInfo[];
|
|
121
|
+
|
|
122
|
+
// Process arguments (typically just one: resolve(value))
|
|
123
|
+
callNode.arguments.forEach((arg, argIndex) => {
|
|
124
|
+
const argInfo: CallArgumentInfo = {
|
|
125
|
+
callId: resolveCall.id,
|
|
126
|
+
argIndex,
|
|
127
|
+
file: ctx.module.file,
|
|
128
|
+
line: getLine(arg),
|
|
129
|
+
column: getColumn(arg)
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// Handle different argument types
|
|
133
|
+
if (t.isIdentifier(arg)) {
|
|
134
|
+
argInfo.targetType = 'VARIABLE';
|
|
135
|
+
argInfo.targetName = arg.name;
|
|
136
|
+
} else if (t.isLiteral(arg) && !t.isTemplateLiteral(arg)) {
|
|
137
|
+
// Create LITERAL node for the argument value
|
|
138
|
+
const literalValue = ExpressionEvaluator.extractLiteralValue(arg as t.Literal);
|
|
139
|
+
if (literalValue !== null) {
|
|
140
|
+
const argLine = getLine(arg);
|
|
141
|
+
const argColumn = getColumn(arg);
|
|
142
|
+
const literalId = `LITERAL#arg${argIndex}#${ctx.module.file}#${argLine}:${argColumn}:${ctx.literalCounterRef.value++}`;
|
|
143
|
+
ctx.literals.push({
|
|
144
|
+
id: literalId,
|
|
145
|
+
type: 'LITERAL',
|
|
146
|
+
value: literalValue,
|
|
147
|
+
valueType: typeof literalValue,
|
|
148
|
+
file: ctx.module.file,
|
|
149
|
+
line: argLine,
|
|
150
|
+
column: argColumn,
|
|
151
|
+
parentCallId: resolveCall.id,
|
|
152
|
+
argIndex
|
|
153
|
+
});
|
|
154
|
+
argInfo.targetType = 'LITERAL';
|
|
155
|
+
argInfo.targetId = literalId;
|
|
156
|
+
argInfo.literalValue = literalValue;
|
|
157
|
+
}
|
|
158
|
+
} else if (t.isCallExpression(arg)) {
|
|
159
|
+
argInfo.targetType = 'CALL';
|
|
160
|
+
argInfo.nestedCallLine = getLine(arg);
|
|
161
|
+
argInfo.nestedCallColumn = getColumn(arg);
|
|
162
|
+
} else {
|
|
163
|
+
argInfo.targetType = 'EXPRESSION';
|
|
164
|
+
argInfo.expressionType = arg.type;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
callArgumentsArr.push(argInfo);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
break; // Found context, stop searching
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
funcParent = funcParent.getFunctionParent();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// REG-311: Detect executor_reject pattern - reject(new Error()) inside Promise executor
|
|
179
|
+
// Walk up to find Promise executor context and check if this is reject call with NewExpression arg
|
|
180
|
+
funcParent = callPath.getFunctionParent();
|
|
181
|
+
while (funcParent && ctx.currentFunctionId) {
|
|
182
|
+
const funcNode = funcParent.node;
|
|
183
|
+
const funcKey = `${funcNode.start}:${funcNode.end}`;
|
|
184
|
+
const context = ctx.promiseExecutorContexts.get(funcKey);
|
|
185
|
+
|
|
186
|
+
if (context && calleeName === context.rejectName && callNode.arguments.length > 0) {
|
|
187
|
+
// REG-311: Use the creator function's ID (the function that created the Promise),
|
|
188
|
+
// not the executor's ID
|
|
189
|
+
const targetFunctionId = context.creatorFunctionId || ctx.currentFunctionId;
|
|
190
|
+
const arg = callNode.arguments[0];
|
|
191
|
+
const callLine = getLine(callNode);
|
|
192
|
+
const callColumn = getColumn(callNode);
|
|
193
|
+
|
|
194
|
+
// Case 1: reject(new Error())
|
|
195
|
+
if (t.isNewExpression(arg) && t.isIdentifier(arg.callee)) {
|
|
196
|
+
ctx.rejectionPatterns.push({
|
|
197
|
+
functionId: targetFunctionId,
|
|
198
|
+
errorClassName: arg.callee.name,
|
|
199
|
+
rejectionType: 'executor_reject',
|
|
200
|
+
isAsync: true,
|
|
201
|
+
file: ctx.module.file,
|
|
202
|
+
line: callLine,
|
|
203
|
+
column: callColumn
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
// Case 2: reject(err) where err is variable
|
|
207
|
+
else if (t.isIdentifier(arg)) {
|
|
208
|
+
const varName = arg.name;
|
|
209
|
+
// Check if it's a parameter of ANY containing function (executor, outer, etc.)
|
|
210
|
+
// Walk up the function chain to find if varName is a parameter
|
|
211
|
+
let isParameter = false;
|
|
212
|
+
let checkParent: NodePath<t.Node> | null = funcParent;
|
|
213
|
+
while (checkParent) {
|
|
214
|
+
if (t.isFunction(checkParent.node)) {
|
|
215
|
+
if (checkParent.node.params.some(p =>
|
|
216
|
+
t.isIdentifier(p) && p.name === varName
|
|
217
|
+
)) {
|
|
218
|
+
isParameter = true;
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
checkParent = checkParent.getFunctionParent();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (isParameter) {
|
|
226
|
+
ctx.rejectionPatterns.push({
|
|
227
|
+
functionId: targetFunctionId,
|
|
228
|
+
errorClassName: null,
|
|
229
|
+
rejectionType: 'variable_parameter',
|
|
230
|
+
isAsync: true,
|
|
231
|
+
file: ctx.module.file,
|
|
232
|
+
line: callLine,
|
|
233
|
+
column: callColumn,
|
|
234
|
+
sourceVariableName: varName
|
|
235
|
+
});
|
|
236
|
+
} else {
|
|
237
|
+
// Try micro-trace
|
|
238
|
+
const { errorClassName, tracePath } = analyzer.microTraceToErrorClass(
|
|
239
|
+
varName,
|
|
240
|
+
funcParent as NodePath<t.Function>,
|
|
241
|
+
ctx.variableDeclarations
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
ctx.rejectionPatterns.push({
|
|
245
|
+
functionId: targetFunctionId,
|
|
246
|
+
errorClassName,
|
|
247
|
+
rejectionType: errorClassName ? 'variable_traced' : 'variable_unknown',
|
|
248
|
+
isAsync: true,
|
|
249
|
+
file: ctx.module.file,
|
|
250
|
+
line: callLine,
|
|
251
|
+
column: callColumn,
|
|
252
|
+
sourceVariableName: varName,
|
|
253
|
+
tracePath
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
funcParent = funcParent.getFunctionParent();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// REG-311: Detect Promise.reject(new Error()) pattern
|
|
264
|
+
if (t.isMemberExpression(callNode.callee) && ctx.currentFunctionId) {
|
|
265
|
+
const memberCallee = callNode.callee;
|
|
266
|
+
if (t.isIdentifier(memberCallee.object) &&
|
|
267
|
+
memberCallee.object.name === 'Promise' &&
|
|
268
|
+
t.isIdentifier(memberCallee.property) &&
|
|
269
|
+
memberCallee.property.name === 'reject' &&
|
|
270
|
+
callNode.arguments.length > 0) {
|
|
271
|
+
const arg = callNode.arguments[0];
|
|
272
|
+
const callLine = getLine(callNode);
|
|
273
|
+
const callColumn = getColumn(callNode);
|
|
274
|
+
|
|
275
|
+
// Case 1: Promise.reject(new Error())
|
|
276
|
+
if (t.isNewExpression(arg) && t.isIdentifier(arg.callee)) {
|
|
277
|
+
ctx.rejectionPatterns.push({
|
|
278
|
+
functionId: ctx.currentFunctionId,
|
|
279
|
+
errorClassName: arg.callee.name,
|
|
280
|
+
rejectionType: 'promise_reject',
|
|
281
|
+
isAsync: true,
|
|
282
|
+
file: ctx.module.file,
|
|
283
|
+
line: callLine,
|
|
284
|
+
column: callColumn
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
// Case 2: Promise.reject(err) where err is variable
|
|
288
|
+
else if (t.isIdentifier(arg)) {
|
|
289
|
+
const varName = arg.name;
|
|
290
|
+
// Check if it's a parameter of containing function
|
|
291
|
+
const isParameter = ctx.functionNode
|
|
292
|
+
? ctx.functionNode.params.some(param => t.isIdentifier(param) && param.name === varName)
|
|
293
|
+
: false;
|
|
294
|
+
|
|
295
|
+
if (isParameter) {
|
|
296
|
+
ctx.rejectionPatterns.push({
|
|
297
|
+
functionId: ctx.currentFunctionId,
|
|
298
|
+
errorClassName: null,
|
|
299
|
+
rejectionType: 'variable_parameter',
|
|
300
|
+
isAsync: true,
|
|
301
|
+
file: ctx.module.file,
|
|
302
|
+
line: callLine,
|
|
303
|
+
column: callColumn,
|
|
304
|
+
sourceVariableName: varName
|
|
305
|
+
});
|
|
306
|
+
} else {
|
|
307
|
+
// Try micro-trace
|
|
308
|
+
if (!ctx.functionPath) {
|
|
309
|
+
ctx.rejectionPatterns.push({
|
|
310
|
+
functionId: ctx.currentFunctionId,
|
|
311
|
+
errorClassName: null,
|
|
312
|
+
rejectionType: 'variable_unknown',
|
|
313
|
+
isAsync: true,
|
|
314
|
+
file: ctx.module.file,
|
|
315
|
+
line: callLine,
|
|
316
|
+
column: callColumn,
|
|
317
|
+
sourceVariableName: varName,
|
|
318
|
+
tracePath: [varName]
|
|
319
|
+
});
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const { errorClassName, tracePath } = analyzer.microTraceToErrorClass(
|
|
324
|
+
varName,
|
|
325
|
+
ctx.functionPath,
|
|
326
|
+
ctx.variableDeclarations
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
ctx.rejectionPatterns.push({
|
|
330
|
+
functionId: ctx.currentFunctionId,
|
|
331
|
+
errorClassName,
|
|
332
|
+
rejectionType: errorClassName ? 'variable_traced' : 'variable_unknown',
|
|
333
|
+
isAsync: true,
|
|
334
|
+
file: ctx.module.file,
|
|
335
|
+
line: callLine,
|
|
336
|
+
column: callColumn,
|
|
337
|
+
sourceVariableName: varName,
|
|
338
|
+
tracePath
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FunctionBodyHandler — abstract base class for all extracted
|
|
3
|
+
* analyzeFunctionBody() visitor handlers.
|
|
4
|
+
*
|
|
5
|
+
* Each subclass implements getHandlers() returning a Babel Visitor
|
|
6
|
+
* fragment that covers a specific AST node type (e.g., VariableDeclaration,
|
|
7
|
+
* ReturnStatement, CallExpression).
|
|
8
|
+
*
|
|
9
|
+
* Handlers receive:
|
|
10
|
+
* - ctx: FunctionBodyContext with all local state for the traversal
|
|
11
|
+
* - analyzer: AnalyzerDelegate to call methods still on JSASTAnalyzer
|
|
12
|
+
*/
|
|
13
|
+
import type { Visitor } from '@babel/traverse';
|
|
14
|
+
import type { FunctionBodyContext } from '../FunctionBodyContext.js';
|
|
15
|
+
import type { AnalyzerDelegate } from './AnalyzerDelegate.js';
|
|
16
|
+
|
|
17
|
+
export abstract class FunctionBodyHandler {
|
|
18
|
+
constructor(
|
|
19
|
+
protected readonly ctx: FunctionBodyContext,
|
|
20
|
+
protected readonly analyzer: AnalyzerDelegate,
|
|
21
|
+
) {}
|
|
22
|
+
|
|
23
|
+
abstract getHandlers(): Visitor;
|
|
24
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LoopHandler -- handles loop control flow nodes: for, for-in, for-of,
|
|
3
|
+
* while, and do-while statements.
|
|
4
|
+
*
|
|
5
|
+
* Inlines the createLoopScopeHandler logic from JSASTAnalyzer (REG-422).
|
|
6
|
+
*/
|
|
7
|
+
import type { Visitor, NodePath } from '@babel/traverse';
|
|
8
|
+
import * as t from '@babel/types';
|
|
9
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
10
|
+
import { computeSemanticId } from '../../../../core/SemanticId.js';
|
|
11
|
+
import { ExpressionNode } from '../../../../core/nodes/ExpressionNode.js';
|
|
12
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
13
|
+
|
|
14
|
+
export class LoopHandler extends FunctionBodyHandler {
|
|
15
|
+
getHandlers(): Visitor {
|
|
16
|
+
return {
|
|
17
|
+
ForStatement: this.createLoopHandler('for', 'for-loop', 'for'),
|
|
18
|
+
ForInStatement: this.createLoopHandler('for-in', 'for-in-loop', 'for-in'),
|
|
19
|
+
ForOfStatement: this.createLoopHandler('for-of', 'for-of-loop', 'for-of'),
|
|
20
|
+
WhileStatement: this.createLoopHandler('while', 'while-loop', 'while'),
|
|
21
|
+
DoWhileStatement: this.createLoopHandler('do-while', 'do-while-loop', 'do-while'),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private createLoopHandler(
|
|
26
|
+
trackerScopeType: string,
|
|
27
|
+
scopeType: string,
|
|
28
|
+
loopType: 'for' | 'for-in' | 'for-of' | 'while' | 'do-while',
|
|
29
|
+
): { enter: (path: NodePath<t.Loop>) => void; exit: () => void } {
|
|
30
|
+
const ctx = this.ctx;
|
|
31
|
+
const analyzer = this.analyzer;
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
enter: (path: NodePath<t.Loop>) => {
|
|
35
|
+
const node = path.node;
|
|
36
|
+
|
|
37
|
+
// Phase 6 (REG-267): Increment loop count for cyclomatic complexity
|
|
38
|
+
if (ctx.controlFlowState) {
|
|
39
|
+
ctx.controlFlowState.loopCount++;
|
|
40
|
+
// REG-298: Track loop nesting depth for isInsideLoop detection
|
|
41
|
+
ctx.controlFlowState.loopDepth++;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 1. Create LOOP node
|
|
45
|
+
const loopCounter = ctx.loopCounterRef.value++;
|
|
46
|
+
const legacyLoopId = `${ctx.module.file}:LOOP:${loopType}:${getLine(node)}:${loopCounter}`;
|
|
47
|
+
const loopId = ctx.scopeTracker
|
|
48
|
+
? computeSemanticId('LOOP', loopType, ctx.scopeTracker.getContext(), { discriminator: loopCounter })
|
|
49
|
+
: legacyLoopId;
|
|
50
|
+
|
|
51
|
+
// 2. Extract iteration target for for-in/for-of
|
|
52
|
+
let iteratesOverName: string | undefined;
|
|
53
|
+
let iteratesOverLine: number | undefined;
|
|
54
|
+
let iteratesOverColumn: number | undefined;
|
|
55
|
+
|
|
56
|
+
if (loopType === 'for-in' || loopType === 'for-of') {
|
|
57
|
+
const loopNode = node as t.ForInStatement | t.ForOfStatement;
|
|
58
|
+
if (t.isIdentifier(loopNode.right)) {
|
|
59
|
+
iteratesOverName = loopNode.right.name;
|
|
60
|
+
iteratesOverLine = getLine(loopNode.right);
|
|
61
|
+
iteratesOverColumn = getColumn(loopNode.right);
|
|
62
|
+
} else if (t.isMemberExpression(loopNode.right)) {
|
|
63
|
+
iteratesOverName = analyzer.memberExpressionToString(loopNode.right);
|
|
64
|
+
iteratesOverLine = getLine(loopNode.right);
|
|
65
|
+
iteratesOverColumn = getColumn(loopNode.right);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 2b. Extract init/test/update for classic for loops and test for while/do-while (REG-282)
|
|
70
|
+
let initVariableName: string | undefined;
|
|
71
|
+
let initLine: number | undefined;
|
|
72
|
+
|
|
73
|
+
let testExpressionId: string | undefined;
|
|
74
|
+
let testExpressionType: string | undefined;
|
|
75
|
+
let testLine: number | undefined;
|
|
76
|
+
let testColumn: number | undefined;
|
|
77
|
+
|
|
78
|
+
let updateExpressionId: string | undefined;
|
|
79
|
+
let updateExpressionType: string | undefined;
|
|
80
|
+
let updateLine: number | undefined;
|
|
81
|
+
let updateColumn: number | undefined;
|
|
82
|
+
|
|
83
|
+
if (loopType === 'for') {
|
|
84
|
+
const forNode = node as t.ForStatement;
|
|
85
|
+
|
|
86
|
+
// Extract init: let i = 0
|
|
87
|
+
if (forNode.init) {
|
|
88
|
+
initLine = getLine(forNode.init);
|
|
89
|
+
if (t.isVariableDeclaration(forNode.init)) {
|
|
90
|
+
// Get name of first declared variable
|
|
91
|
+
const firstDeclarator = forNode.init.declarations[0];
|
|
92
|
+
if (t.isIdentifier(firstDeclarator.id)) {
|
|
93
|
+
initVariableName = firstDeclarator.id.name;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Extract test: i < 10
|
|
99
|
+
if (forNode.test) {
|
|
100
|
+
testLine = getLine(forNode.test);
|
|
101
|
+
testColumn = getColumn(forNode.test);
|
|
102
|
+
testExpressionType = forNode.test.type;
|
|
103
|
+
testExpressionId = ExpressionNode.generateId(forNode.test.type, ctx.module.file, testLine, testColumn);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Extract update: i++
|
|
107
|
+
if (forNode.update) {
|
|
108
|
+
updateLine = getLine(forNode.update);
|
|
109
|
+
updateColumn = getColumn(forNode.update);
|
|
110
|
+
updateExpressionType = forNode.update.type;
|
|
111
|
+
updateExpressionId = ExpressionNode.generateId(forNode.update.type, ctx.module.file, updateLine, updateColumn);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Extract test condition for while and do-while loops
|
|
116
|
+
if (loopType === 'while' || loopType === 'do-while') {
|
|
117
|
+
const condLoop = node as t.WhileStatement | t.DoWhileStatement;
|
|
118
|
+
if (condLoop.test) {
|
|
119
|
+
testLine = getLine(condLoop.test);
|
|
120
|
+
testColumn = getColumn(condLoop.test);
|
|
121
|
+
testExpressionType = condLoop.test.type;
|
|
122
|
+
testExpressionId = ExpressionNode.generateId(condLoop.test.type, ctx.module.file, testLine, testColumn);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Extract async flag for for-await-of (REG-284)
|
|
127
|
+
let isAsync: boolean | undefined;
|
|
128
|
+
if (loopType === 'for-of') {
|
|
129
|
+
const forOfNode = node as t.ForOfStatement;
|
|
130
|
+
isAsync = forOfNode.await === true ? true : undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// 3. Determine actual parent - use stack for nested loops, otherwise original parentScopeId
|
|
134
|
+
const actualParentScopeId = (ctx.scopeIdStack && ctx.scopeIdStack.length > 0)
|
|
135
|
+
? ctx.scopeIdStack[ctx.scopeIdStack.length - 1]
|
|
136
|
+
: ctx.parentScopeId;
|
|
137
|
+
|
|
138
|
+
// 3.5. Extract condition expression for while/do-while/for loops (REG-280)
|
|
139
|
+
// Note: for-in and for-of don't have test expressions (they use ITERATES_OVER instead)
|
|
140
|
+
let conditionExpressionId: string | undefined;
|
|
141
|
+
let conditionExpressionType: string | undefined;
|
|
142
|
+
let conditionLine: number | undefined;
|
|
143
|
+
let conditionColumn: number | undefined;
|
|
144
|
+
|
|
145
|
+
if (loopType === 'while' || loopType === 'do-while') {
|
|
146
|
+
const testNode = (node as t.WhileStatement | t.DoWhileStatement).test;
|
|
147
|
+
if (testNode) {
|
|
148
|
+
const condResult = analyzer.extractDiscriminantExpression(testNode, ctx.module);
|
|
149
|
+
conditionExpressionId = condResult.id;
|
|
150
|
+
conditionExpressionType = condResult.expressionType;
|
|
151
|
+
conditionLine = condResult.line;
|
|
152
|
+
conditionColumn = condResult.column;
|
|
153
|
+
}
|
|
154
|
+
} else if (loopType === 'for') {
|
|
155
|
+
const forNode = node as t.ForStatement;
|
|
156
|
+
// for loop test may be null (infinite loop: for(;;))
|
|
157
|
+
if (forNode.test) {
|
|
158
|
+
const condResult = analyzer.extractDiscriminantExpression(forNode.test, ctx.module);
|
|
159
|
+
conditionExpressionId = condResult.id;
|
|
160
|
+
conditionExpressionType = condResult.expressionType;
|
|
161
|
+
conditionLine = condResult.line;
|
|
162
|
+
conditionColumn = condResult.column;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// 4. Push LOOP info
|
|
167
|
+
ctx.loops.push({
|
|
168
|
+
id: loopId,
|
|
169
|
+
semanticId: loopId,
|
|
170
|
+
type: 'LOOP',
|
|
171
|
+
loopType,
|
|
172
|
+
file: ctx.module.file,
|
|
173
|
+
line: getLine(node),
|
|
174
|
+
column: getColumn(node),
|
|
175
|
+
parentScopeId: actualParentScopeId,
|
|
176
|
+
iteratesOverName,
|
|
177
|
+
iteratesOverLine,
|
|
178
|
+
iteratesOverColumn,
|
|
179
|
+
conditionExpressionId,
|
|
180
|
+
conditionExpressionType,
|
|
181
|
+
conditionLine,
|
|
182
|
+
conditionColumn,
|
|
183
|
+
// REG-282: init/test/update for classic for loops
|
|
184
|
+
initVariableName,
|
|
185
|
+
initLine,
|
|
186
|
+
testExpressionId,
|
|
187
|
+
testExpressionType,
|
|
188
|
+
testLine,
|
|
189
|
+
testColumn,
|
|
190
|
+
updateExpressionId,
|
|
191
|
+
updateExpressionType,
|
|
192
|
+
updateLine,
|
|
193
|
+
updateColumn,
|
|
194
|
+
// REG-284: async flag for for-await-of
|
|
195
|
+
async: isAsync
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// 5. Create body SCOPE (backward compatibility)
|
|
199
|
+
const scopeId = `SCOPE#${scopeType}#${ctx.module.file}#${getLine(node)}:${ctx.scopeCounterRef.value++}`;
|
|
200
|
+
const semanticId = analyzer.generateSemanticId(scopeType, ctx.scopeTracker);
|
|
201
|
+
ctx.scopes.push({
|
|
202
|
+
id: scopeId,
|
|
203
|
+
type: 'SCOPE',
|
|
204
|
+
scopeType,
|
|
205
|
+
semanticId,
|
|
206
|
+
file: ctx.module.file,
|
|
207
|
+
line: getLine(node),
|
|
208
|
+
parentScopeId: loopId // Parent is LOOP, not original parentScopeId
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// 6. Push body SCOPE to scopeIdStack (for CONTAINS edges to nested items)
|
|
212
|
+
// The body scope is the container for nested loops, not the LOOP itself
|
|
213
|
+
if (ctx.scopeIdStack) {
|
|
214
|
+
ctx.scopeIdStack.push(scopeId);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Enter scope for semantic ID generation
|
|
218
|
+
if (ctx.scopeTracker) {
|
|
219
|
+
ctx.scopeTracker.enterCountedScope(trackerScopeType);
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
exit: () => {
|
|
223
|
+
// REG-298: Decrement loop depth counter
|
|
224
|
+
if (ctx.controlFlowState) {
|
|
225
|
+
ctx.controlFlowState.loopDepth--;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Pop loop scope from stack
|
|
229
|
+
if (ctx.scopeIdStack) {
|
|
230
|
+
ctx.scopeIdStack.pop();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Exit scope
|
|
234
|
+
if (ctx.scopeTracker) {
|
|
235
|
+
ctx.scopeTracker.exitScope();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
}
|