@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,13 @@
|
|
|
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 } from '@babel/traverse';
|
|
8
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
9
|
+
export declare class LoopHandler extends FunctionBodyHandler {
|
|
10
|
+
getHandlers(): Visitor;
|
|
11
|
+
private createLoopHandler;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=LoopHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoopHandler.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/LoopHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAKzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,WAAY,SAAQ,mBAAmB;IAClD,WAAW,IAAI,OAAO;IAUtB,OAAO,CAAC,iBAAiB;CAuN1B"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
3
|
+
import { computeSemanticId } from '../../../../core/SemanticId.js';
|
|
4
|
+
import { ExpressionNode } from '../../../../core/nodes/ExpressionNode.js';
|
|
5
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
6
|
+
export class LoopHandler extends FunctionBodyHandler {
|
|
7
|
+
getHandlers() {
|
|
8
|
+
return {
|
|
9
|
+
ForStatement: this.createLoopHandler('for', 'for-loop', 'for'),
|
|
10
|
+
ForInStatement: this.createLoopHandler('for-in', 'for-in-loop', 'for-in'),
|
|
11
|
+
ForOfStatement: this.createLoopHandler('for-of', 'for-of-loop', 'for-of'),
|
|
12
|
+
WhileStatement: this.createLoopHandler('while', 'while-loop', 'while'),
|
|
13
|
+
DoWhileStatement: this.createLoopHandler('do-while', 'do-while-loop', 'do-while'),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
createLoopHandler(trackerScopeType, scopeType, loopType) {
|
|
17
|
+
const ctx = this.ctx;
|
|
18
|
+
const analyzer = this.analyzer;
|
|
19
|
+
return {
|
|
20
|
+
enter: (path) => {
|
|
21
|
+
const node = path.node;
|
|
22
|
+
// Phase 6 (REG-267): Increment loop count for cyclomatic complexity
|
|
23
|
+
if (ctx.controlFlowState) {
|
|
24
|
+
ctx.controlFlowState.loopCount++;
|
|
25
|
+
// REG-298: Track loop nesting depth for isInsideLoop detection
|
|
26
|
+
ctx.controlFlowState.loopDepth++;
|
|
27
|
+
}
|
|
28
|
+
// 1. Create LOOP node
|
|
29
|
+
const loopCounter = ctx.loopCounterRef.value++;
|
|
30
|
+
const legacyLoopId = `${ctx.module.file}:LOOP:${loopType}:${getLine(node)}:${loopCounter}`;
|
|
31
|
+
const loopId = ctx.scopeTracker
|
|
32
|
+
? computeSemanticId('LOOP', loopType, ctx.scopeTracker.getContext(), { discriminator: loopCounter })
|
|
33
|
+
: legacyLoopId;
|
|
34
|
+
// 2. Extract iteration target for for-in/for-of
|
|
35
|
+
let iteratesOverName;
|
|
36
|
+
let iteratesOverLine;
|
|
37
|
+
let iteratesOverColumn;
|
|
38
|
+
if (loopType === 'for-in' || loopType === 'for-of') {
|
|
39
|
+
const loopNode = node;
|
|
40
|
+
if (t.isIdentifier(loopNode.right)) {
|
|
41
|
+
iteratesOverName = loopNode.right.name;
|
|
42
|
+
iteratesOverLine = getLine(loopNode.right);
|
|
43
|
+
iteratesOverColumn = getColumn(loopNode.right);
|
|
44
|
+
}
|
|
45
|
+
else if (t.isMemberExpression(loopNode.right)) {
|
|
46
|
+
iteratesOverName = analyzer.memberExpressionToString(loopNode.right);
|
|
47
|
+
iteratesOverLine = getLine(loopNode.right);
|
|
48
|
+
iteratesOverColumn = getColumn(loopNode.right);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// 2b. Extract init/test/update for classic for loops and test for while/do-while (REG-282)
|
|
52
|
+
let initVariableName;
|
|
53
|
+
let initLine;
|
|
54
|
+
let testExpressionId;
|
|
55
|
+
let testExpressionType;
|
|
56
|
+
let testLine;
|
|
57
|
+
let testColumn;
|
|
58
|
+
let updateExpressionId;
|
|
59
|
+
let updateExpressionType;
|
|
60
|
+
let updateLine;
|
|
61
|
+
let updateColumn;
|
|
62
|
+
if (loopType === 'for') {
|
|
63
|
+
const forNode = node;
|
|
64
|
+
// Extract init: let i = 0
|
|
65
|
+
if (forNode.init) {
|
|
66
|
+
initLine = getLine(forNode.init);
|
|
67
|
+
if (t.isVariableDeclaration(forNode.init)) {
|
|
68
|
+
// Get name of first declared variable
|
|
69
|
+
const firstDeclarator = forNode.init.declarations[0];
|
|
70
|
+
if (t.isIdentifier(firstDeclarator.id)) {
|
|
71
|
+
initVariableName = firstDeclarator.id.name;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Extract test: i < 10
|
|
76
|
+
if (forNode.test) {
|
|
77
|
+
testLine = getLine(forNode.test);
|
|
78
|
+
testColumn = getColumn(forNode.test);
|
|
79
|
+
testExpressionType = forNode.test.type;
|
|
80
|
+
testExpressionId = ExpressionNode.generateId(forNode.test.type, ctx.module.file, testLine, testColumn);
|
|
81
|
+
}
|
|
82
|
+
// Extract update: i++
|
|
83
|
+
if (forNode.update) {
|
|
84
|
+
updateLine = getLine(forNode.update);
|
|
85
|
+
updateColumn = getColumn(forNode.update);
|
|
86
|
+
updateExpressionType = forNode.update.type;
|
|
87
|
+
updateExpressionId = ExpressionNode.generateId(forNode.update.type, ctx.module.file, updateLine, updateColumn);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Extract test condition for while and do-while loops
|
|
91
|
+
if (loopType === 'while' || loopType === 'do-while') {
|
|
92
|
+
const condLoop = node;
|
|
93
|
+
if (condLoop.test) {
|
|
94
|
+
testLine = getLine(condLoop.test);
|
|
95
|
+
testColumn = getColumn(condLoop.test);
|
|
96
|
+
testExpressionType = condLoop.test.type;
|
|
97
|
+
testExpressionId = ExpressionNode.generateId(condLoop.test.type, ctx.module.file, testLine, testColumn);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Extract async flag for for-await-of (REG-284)
|
|
101
|
+
let isAsync;
|
|
102
|
+
if (loopType === 'for-of') {
|
|
103
|
+
const forOfNode = node;
|
|
104
|
+
isAsync = forOfNode.await === true ? true : undefined;
|
|
105
|
+
}
|
|
106
|
+
// 3. Determine actual parent - use stack for nested loops, otherwise original parentScopeId
|
|
107
|
+
const actualParentScopeId = (ctx.scopeIdStack && ctx.scopeIdStack.length > 0)
|
|
108
|
+
? ctx.scopeIdStack[ctx.scopeIdStack.length - 1]
|
|
109
|
+
: ctx.parentScopeId;
|
|
110
|
+
// 3.5. Extract condition expression for while/do-while/for loops (REG-280)
|
|
111
|
+
// Note: for-in and for-of don't have test expressions (they use ITERATES_OVER instead)
|
|
112
|
+
let conditionExpressionId;
|
|
113
|
+
let conditionExpressionType;
|
|
114
|
+
let conditionLine;
|
|
115
|
+
let conditionColumn;
|
|
116
|
+
if (loopType === 'while' || loopType === 'do-while') {
|
|
117
|
+
const testNode = node.test;
|
|
118
|
+
if (testNode) {
|
|
119
|
+
const condResult = analyzer.extractDiscriminantExpression(testNode, ctx.module);
|
|
120
|
+
conditionExpressionId = condResult.id;
|
|
121
|
+
conditionExpressionType = condResult.expressionType;
|
|
122
|
+
conditionLine = condResult.line;
|
|
123
|
+
conditionColumn = condResult.column;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else if (loopType === 'for') {
|
|
127
|
+
const forNode = node;
|
|
128
|
+
// for loop test may be null (infinite loop: for(;;))
|
|
129
|
+
if (forNode.test) {
|
|
130
|
+
const condResult = analyzer.extractDiscriminantExpression(forNode.test, ctx.module);
|
|
131
|
+
conditionExpressionId = condResult.id;
|
|
132
|
+
conditionExpressionType = condResult.expressionType;
|
|
133
|
+
conditionLine = condResult.line;
|
|
134
|
+
conditionColumn = condResult.column;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// 4. Push LOOP info
|
|
138
|
+
ctx.loops.push({
|
|
139
|
+
id: loopId,
|
|
140
|
+
semanticId: loopId,
|
|
141
|
+
type: 'LOOP',
|
|
142
|
+
loopType,
|
|
143
|
+
file: ctx.module.file,
|
|
144
|
+
line: getLine(node),
|
|
145
|
+
column: getColumn(node),
|
|
146
|
+
parentScopeId: actualParentScopeId,
|
|
147
|
+
iteratesOverName,
|
|
148
|
+
iteratesOverLine,
|
|
149
|
+
iteratesOverColumn,
|
|
150
|
+
conditionExpressionId,
|
|
151
|
+
conditionExpressionType,
|
|
152
|
+
conditionLine,
|
|
153
|
+
conditionColumn,
|
|
154
|
+
// REG-282: init/test/update for classic for loops
|
|
155
|
+
initVariableName,
|
|
156
|
+
initLine,
|
|
157
|
+
testExpressionId,
|
|
158
|
+
testExpressionType,
|
|
159
|
+
testLine,
|
|
160
|
+
testColumn,
|
|
161
|
+
updateExpressionId,
|
|
162
|
+
updateExpressionType,
|
|
163
|
+
updateLine,
|
|
164
|
+
updateColumn,
|
|
165
|
+
// REG-284: async flag for for-await-of
|
|
166
|
+
async: isAsync
|
|
167
|
+
});
|
|
168
|
+
// 5. Create body SCOPE (backward compatibility)
|
|
169
|
+
const scopeId = `SCOPE#${scopeType}#${ctx.module.file}#${getLine(node)}:${ctx.scopeCounterRef.value++}`;
|
|
170
|
+
const semanticId = analyzer.generateSemanticId(scopeType, ctx.scopeTracker);
|
|
171
|
+
ctx.scopes.push({
|
|
172
|
+
id: scopeId,
|
|
173
|
+
type: 'SCOPE',
|
|
174
|
+
scopeType,
|
|
175
|
+
semanticId,
|
|
176
|
+
file: ctx.module.file,
|
|
177
|
+
line: getLine(node),
|
|
178
|
+
parentScopeId: loopId // Parent is LOOP, not original parentScopeId
|
|
179
|
+
});
|
|
180
|
+
// 6. Push body SCOPE to scopeIdStack (for CONTAINS edges to nested items)
|
|
181
|
+
// The body scope is the container for nested loops, not the LOOP itself
|
|
182
|
+
if (ctx.scopeIdStack) {
|
|
183
|
+
ctx.scopeIdStack.push(scopeId);
|
|
184
|
+
}
|
|
185
|
+
// Enter scope for semantic ID generation
|
|
186
|
+
if (ctx.scopeTracker) {
|
|
187
|
+
ctx.scopeTracker.enterCountedScope(trackerScopeType);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
exit: () => {
|
|
191
|
+
// REG-298: Decrement loop depth counter
|
|
192
|
+
if (ctx.controlFlowState) {
|
|
193
|
+
ctx.controlFlowState.loopDepth--;
|
|
194
|
+
}
|
|
195
|
+
// Pop loop scope from stack
|
|
196
|
+
if (ctx.scopeIdStack) {
|
|
197
|
+
ctx.scopeIdStack.pop();
|
|
198
|
+
}
|
|
199
|
+
// Exit scope
|
|
200
|
+
if (ctx.scopeTracker) {
|
|
201
|
+
ctx.scopeTracker.exitScope();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=LoopHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoopHandler.js","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/LoopHandler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,OAAO,WAAY,SAAQ,mBAAmB;IAClD,WAAW;QACT,OAAO;YACL,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC;YAC9D,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC;YACzE,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC;YACzE,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC;YACtE,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC;SAClF,CAAC;IACJ,CAAC;IAEO,iBAAiB,CACvB,gBAAwB,EACxB,SAAiB,EACjB,QAA4D;QAE5D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE/B,OAAO;YACL,KAAK,EAAE,CAAC,IAAsB,EAAE,EAAE;gBAChC,MAAM,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,OAAO;oBACX,IAAI,EAAE,OAAO;oBACb,SAAS;oBACT,UAAU;oBACV,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI;oBACrB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC;oBACnB,aAAa,EAAE,MAAM,CAAE,6CAA6C;iBACrE,CAAC,CAAC;gBAEH,0EAA0E;gBAC1E,wEAAwE;gBACxE,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;oBACrB,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACjC,CAAC;gBAED,yCAAyC;gBACzC,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;oBACrB,GAAG,CAAC,YAAY,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC;YACD,IAAI,EAAE,GAAG,EAAE;gBACT,wCAAwC;gBACxC,IAAI,GAAG,CAAC,gBAAgB,EAAE,CAAC;oBACzB,GAAG,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;gBACnC,CAAC;gBAED,4BAA4B;gBAC5B,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;oBACrB,GAAG,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;gBACzB,CAAC;gBAED,aAAa;gBACb,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;oBACrB,GAAG,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;gBAC/B,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NestedFunctionHandler — handles FunctionDeclaration, FunctionExpression,
|
|
3
|
+
* and ArrowFunctionExpression nodes found inside a function body.
|
|
4
|
+
*
|
|
5
|
+
* Mechanical extraction from analyzeFunctionBody() (REG-422).
|
|
6
|
+
* Original source: JSASTAnalyzer.ts lines ~4108-4285.
|
|
7
|
+
*/
|
|
8
|
+
import type { Visitor } from '@babel/traverse';
|
|
9
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
10
|
+
export declare class NestedFunctionHandler extends FunctionBodyHandler {
|
|
11
|
+
getHandlers(): Visitor;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NestedFunctionHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestedFunctionHandler.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/NestedFunctionHandler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAKzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,qBAAsB,SAAQ,mBAAmB;IAC5D,WAAW,IAAI,OAAO;CAyLvB"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
3
|
+
import { computeSemanticId } from '../../../../core/SemanticId.js';
|
|
4
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
5
|
+
export class NestedFunctionHandler extends FunctionBodyHandler {
|
|
6
|
+
getHandlers() {
|
|
7
|
+
const ctx = this.ctx;
|
|
8
|
+
const analyzer = this.analyzer;
|
|
9
|
+
return {
|
|
10
|
+
FunctionDeclaration: (funcDeclPath) => {
|
|
11
|
+
const node = funcDeclPath.node;
|
|
12
|
+
const funcName = node.id ? node.id.name : analyzer.generateAnonymousName(ctx.scopeTracker);
|
|
13
|
+
// Use semantic ID as primary ID when scopeTracker available
|
|
14
|
+
const legacyId = `FUNCTION#${funcName}#${ctx.module.file}#${getLine(node)}:${getColumn(node)}:${ctx.functionCounterRef.value++}`;
|
|
15
|
+
const functionId = ctx.scopeTracker
|
|
16
|
+
? computeSemanticId('FUNCTION', funcName, ctx.scopeTracker.getContext())
|
|
17
|
+
: legacyId;
|
|
18
|
+
ctx.functions.push({
|
|
19
|
+
id: functionId,
|
|
20
|
+
type: 'FUNCTION',
|
|
21
|
+
name: funcName,
|
|
22
|
+
file: ctx.module.file,
|
|
23
|
+
line: getLine(node),
|
|
24
|
+
column: getColumn(node),
|
|
25
|
+
async: node.async || false,
|
|
26
|
+
generator: node.generator || false,
|
|
27
|
+
parentScopeId: ctx.parentScopeId
|
|
28
|
+
});
|
|
29
|
+
const nestedScopeId = `SCOPE#${funcName}:body#${ctx.module.file}#${getLine(node)}`;
|
|
30
|
+
const closureSemanticId = analyzer.generateSemanticId('closure', ctx.scopeTracker);
|
|
31
|
+
ctx.scopes.push({
|
|
32
|
+
id: nestedScopeId,
|
|
33
|
+
type: 'SCOPE',
|
|
34
|
+
scopeType: 'closure',
|
|
35
|
+
name: `${funcName}:body`,
|
|
36
|
+
semanticId: closureSemanticId,
|
|
37
|
+
conditional: false,
|
|
38
|
+
file: ctx.module.file,
|
|
39
|
+
line: getLine(node),
|
|
40
|
+
parentFunctionId: functionId,
|
|
41
|
+
capturesFrom: ctx.parentScopeId
|
|
42
|
+
});
|
|
43
|
+
// Enter nested function scope for semantic ID generation
|
|
44
|
+
if (ctx.scopeTracker) {
|
|
45
|
+
ctx.scopeTracker.enterScope(funcName, 'function');
|
|
46
|
+
}
|
|
47
|
+
analyzer.analyzeFunctionBody(funcDeclPath, nestedScopeId, ctx.module, ctx.collections);
|
|
48
|
+
if (ctx.scopeTracker) {
|
|
49
|
+
ctx.scopeTracker.exitScope();
|
|
50
|
+
}
|
|
51
|
+
funcDeclPath.skip();
|
|
52
|
+
},
|
|
53
|
+
FunctionExpression: (funcPath) => {
|
|
54
|
+
const node = funcPath.node;
|
|
55
|
+
const funcName = node.id ? node.id.name : analyzer.generateAnonymousName(ctx.scopeTracker);
|
|
56
|
+
// Use semantic ID as primary ID when scopeTracker available
|
|
57
|
+
const legacyId = `FUNCTION#${funcName}#${ctx.module.file}#${getLine(node)}:${getColumn(node)}:${ctx.functionCounterRef.value++}`;
|
|
58
|
+
const functionId = ctx.scopeTracker
|
|
59
|
+
? computeSemanticId('FUNCTION', funcName, ctx.scopeTracker.getContext())
|
|
60
|
+
: legacyId;
|
|
61
|
+
ctx.functions.push({
|
|
62
|
+
id: functionId,
|
|
63
|
+
type: 'FUNCTION',
|
|
64
|
+
name: funcName,
|
|
65
|
+
file: ctx.module.file,
|
|
66
|
+
line: getLine(node),
|
|
67
|
+
column: getColumn(node),
|
|
68
|
+
async: node.async || false,
|
|
69
|
+
generator: node.generator || false,
|
|
70
|
+
parentScopeId: ctx.parentScopeId
|
|
71
|
+
});
|
|
72
|
+
const nestedScopeId = `SCOPE#${funcName}:body#${ctx.module.file}#${getLine(node)}`;
|
|
73
|
+
const closureSemanticId = analyzer.generateSemanticId('closure', ctx.scopeTracker);
|
|
74
|
+
ctx.scopes.push({
|
|
75
|
+
id: nestedScopeId,
|
|
76
|
+
type: 'SCOPE',
|
|
77
|
+
scopeType: 'closure',
|
|
78
|
+
name: `${funcName}:body`,
|
|
79
|
+
semanticId: closureSemanticId,
|
|
80
|
+
conditional: false,
|
|
81
|
+
file: ctx.module.file,
|
|
82
|
+
line: getLine(node),
|
|
83
|
+
parentFunctionId: functionId,
|
|
84
|
+
capturesFrom: ctx.parentScopeId
|
|
85
|
+
});
|
|
86
|
+
// Enter nested function scope for semantic ID generation
|
|
87
|
+
if (ctx.scopeTracker) {
|
|
88
|
+
ctx.scopeTracker.enterScope(funcName, 'function');
|
|
89
|
+
}
|
|
90
|
+
analyzer.analyzeFunctionBody(funcPath, nestedScopeId, ctx.module, ctx.collections);
|
|
91
|
+
if (ctx.scopeTracker) {
|
|
92
|
+
ctx.scopeTracker.exitScope();
|
|
93
|
+
}
|
|
94
|
+
funcPath.skip();
|
|
95
|
+
},
|
|
96
|
+
ArrowFunctionExpression: (arrowPath) => {
|
|
97
|
+
const node = arrowPath.node;
|
|
98
|
+
const line = getLine(node);
|
|
99
|
+
const column = getColumn(node);
|
|
100
|
+
// Determine name (anonymous if not assigned to variable)
|
|
101
|
+
const parent = arrowPath.parent;
|
|
102
|
+
let funcName;
|
|
103
|
+
if (t.isVariableDeclarator(parent) && t.isIdentifier(parent.id)) {
|
|
104
|
+
funcName = parent.id.name;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// Use scope-level counter for stable semanticId
|
|
108
|
+
funcName = analyzer.generateAnonymousName(ctx.scopeTracker);
|
|
109
|
+
}
|
|
110
|
+
// Use semantic ID as primary ID when scopeTracker available
|
|
111
|
+
const legacyId = `FUNCTION#${funcName}:${line}:${column}:${ctx.functionCounterRef.value++}`;
|
|
112
|
+
const functionId = ctx.scopeTracker
|
|
113
|
+
? computeSemanticId('FUNCTION', funcName, ctx.scopeTracker.getContext())
|
|
114
|
+
: legacyId;
|
|
115
|
+
ctx.functions.push({
|
|
116
|
+
id: functionId,
|
|
117
|
+
type: 'FUNCTION',
|
|
118
|
+
name: funcName,
|
|
119
|
+
file: ctx.module.file,
|
|
120
|
+
line,
|
|
121
|
+
column,
|
|
122
|
+
async: node.async || false,
|
|
123
|
+
arrowFunction: true,
|
|
124
|
+
parentScopeId: ctx.parentScopeId
|
|
125
|
+
});
|
|
126
|
+
if (node.body.type === 'BlockStatement') {
|
|
127
|
+
const nestedScopeId = `SCOPE#${funcName}:body#${ctx.module.file}#${line}`;
|
|
128
|
+
const arrowSemanticId = analyzer.generateSemanticId('arrow_body', ctx.scopeTracker);
|
|
129
|
+
ctx.scopes.push({
|
|
130
|
+
id: nestedScopeId,
|
|
131
|
+
type: 'SCOPE',
|
|
132
|
+
scopeType: 'arrow_body',
|
|
133
|
+
name: `${funcName}:body`,
|
|
134
|
+
semanticId: arrowSemanticId,
|
|
135
|
+
conditional: false,
|
|
136
|
+
file: ctx.module.file,
|
|
137
|
+
line,
|
|
138
|
+
parentFunctionId: functionId,
|
|
139
|
+
capturesFrom: ctx.parentScopeId
|
|
140
|
+
});
|
|
141
|
+
// Enter arrow function scope for semantic ID generation
|
|
142
|
+
if (ctx.scopeTracker) {
|
|
143
|
+
ctx.scopeTracker.enterScope(funcName, 'arrow');
|
|
144
|
+
}
|
|
145
|
+
analyzer.analyzeFunctionBody(arrowPath, nestedScopeId, ctx.module, ctx.collections);
|
|
146
|
+
if (ctx.scopeTracker) {
|
|
147
|
+
ctx.scopeTracker.exitScope();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
// Arrow function with expression body (implicit return)
|
|
152
|
+
// e.g., x => x * 2, () => 42
|
|
153
|
+
const bodyExpr = node.body;
|
|
154
|
+
const bodyLine = getLine(bodyExpr);
|
|
155
|
+
const bodyColumn = getColumn(bodyExpr);
|
|
156
|
+
// Extract expression-specific info using shared method
|
|
157
|
+
const exprInfo = analyzer.extractReturnExpressionInfo(bodyExpr, ctx.module, ctx.literals, ctx.literalCounterRef, line, column, 'implicit_return');
|
|
158
|
+
const returnInfo = {
|
|
159
|
+
parentFunctionId: functionId,
|
|
160
|
+
file: ctx.module.file,
|
|
161
|
+
line: bodyLine,
|
|
162
|
+
column: bodyColumn,
|
|
163
|
+
returnValueType: 'NONE',
|
|
164
|
+
isImplicitReturn: true,
|
|
165
|
+
...exprInfo,
|
|
166
|
+
};
|
|
167
|
+
ctx.returnStatements.push(returnInfo);
|
|
168
|
+
}
|
|
169
|
+
arrowPath.skip();
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=NestedFunctionHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NestedFunctionHandler.js","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/NestedFunctionHandler.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,mBAAmB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;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NewExpressionHandler — handles NewExpression nodes (constructor calls).
|
|
3
|
+
*
|
|
4
|
+
* Mechanical extraction from analyzeFunctionBody() (REG-422).
|
|
5
|
+
* Original source: JSASTAnalyzer.ts lines ~4679-4816.
|
|
6
|
+
*/
|
|
7
|
+
import type { Visitor } from '@babel/traverse';
|
|
8
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
9
|
+
export declare class NewExpressionHandler extends FunctionBodyHandler {
|
|
10
|
+
getHandlers(): Visitor;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=NewExpressionHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewExpressionHandler.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/NewExpressionHandler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAKzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,oBAAqB,SAAQ,mBAAmB;IAC3D,WAAW,IAAI,OAAO;CAgJvB"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
3
|
+
import { computeSemanticId } from '../../../../core/SemanticId.js';
|
|
4
|
+
import { ConstructorCallNode } from '../../../../core/nodes/ConstructorCallNode.js';
|
|
5
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
6
|
+
export class NewExpressionHandler extends FunctionBodyHandler {
|
|
7
|
+
getHandlers() {
|
|
8
|
+
const ctx = this.ctx;
|
|
9
|
+
return {
|
|
10
|
+
// NewExpression (constructor calls)
|
|
11
|
+
NewExpression: (newPath) => {
|
|
12
|
+
const newNode = newPath.node;
|
|
13
|
+
const nodeKey = `new:${newNode.start}:${newNode.end}`;
|
|
14
|
+
// Determine className from callee
|
|
15
|
+
let className = null;
|
|
16
|
+
if (newNode.callee.type === 'Identifier') {
|
|
17
|
+
className = newNode.callee.name;
|
|
18
|
+
}
|
|
19
|
+
else if (newNode.callee.type === 'MemberExpression' && newNode.callee.property.type === 'Identifier') {
|
|
20
|
+
className = newNode.callee.property.name;
|
|
21
|
+
}
|
|
22
|
+
// Create CONSTRUCTOR_CALL node (always, for all NewExpressions)
|
|
23
|
+
if (className) {
|
|
24
|
+
const constructorKey = `constructor:${nodeKey}`;
|
|
25
|
+
if (!ctx.processedCallSites.has(constructorKey)) {
|
|
26
|
+
ctx.processedCallSites.add(constructorKey);
|
|
27
|
+
const line = getLine(newNode);
|
|
28
|
+
const column = getColumn(newNode);
|
|
29
|
+
const constructorCallId = ConstructorCallNode.generateId(className, ctx.module.file, line, column);
|
|
30
|
+
const isBuiltin = ConstructorCallNode.isBuiltinConstructor(className);
|
|
31
|
+
ctx.constructorCalls.push({
|
|
32
|
+
id: constructorCallId,
|
|
33
|
+
type: 'CONSTRUCTOR_CALL',
|
|
34
|
+
className,
|
|
35
|
+
isBuiltin,
|
|
36
|
+
file: ctx.module.file,
|
|
37
|
+
line,
|
|
38
|
+
column
|
|
39
|
+
});
|
|
40
|
+
// REG-334: If this is Promise constructor with executor callback,
|
|
41
|
+
// register the context for resolve/reject detection
|
|
42
|
+
if (className === 'Promise' && newNode.arguments.length > 0) {
|
|
43
|
+
const executorArg = newNode.arguments[0];
|
|
44
|
+
// Only handle inline function expressions (not variable references)
|
|
45
|
+
if (t.isArrowFunctionExpression(executorArg) || t.isFunctionExpression(executorArg)) {
|
|
46
|
+
// Extract resolve/reject parameter names
|
|
47
|
+
let resolveName;
|
|
48
|
+
let rejectName;
|
|
49
|
+
if (executorArg.params.length > 0 && t.isIdentifier(executorArg.params[0])) {
|
|
50
|
+
resolveName = executorArg.params[0].name;
|
|
51
|
+
}
|
|
52
|
+
if (executorArg.params.length > 1 && t.isIdentifier(executorArg.params[1])) {
|
|
53
|
+
rejectName = executorArg.params[1].name;
|
|
54
|
+
}
|
|
55
|
+
if (resolveName) {
|
|
56
|
+
// Key by function node position to allow nested Promise detection
|
|
57
|
+
const funcKey = `${executorArg.start}:${executorArg.end}`;
|
|
58
|
+
ctx.promiseExecutorContexts.set(funcKey, {
|
|
59
|
+
constructorCallId,
|
|
60
|
+
resolveName,
|
|
61
|
+
rejectName,
|
|
62
|
+
file: ctx.module.file,
|
|
63
|
+
line,
|
|
64
|
+
// REG-311: Store the ID of the function that creates the Promise
|
|
65
|
+
creatorFunctionId: ctx.currentFunctionId || undefined
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Handle simple constructor: new Foo()
|
|
73
|
+
if (newNode.callee.type === 'Identifier') {
|
|
74
|
+
if (ctx.processedCallSites.has(nodeKey)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
ctx.processedCallSites.add(nodeKey);
|
|
78
|
+
// Generate semantic ID (primary) or legacy ID (fallback)
|
|
79
|
+
const constructorName = newNode.callee.name;
|
|
80
|
+
const legacyId = `CALL#new:${constructorName}#${ctx.module.file}#${getLine(newNode)}:${getColumn(newNode)}:${ctx.callSiteCounterRef.value++}`;
|
|
81
|
+
let newCallId = legacyId;
|
|
82
|
+
if (ctx.scopeTracker) {
|
|
83
|
+
const discriminator = ctx.scopeTracker.getItemCounter(`CALL:new:${constructorName}`);
|
|
84
|
+
newCallId = computeSemanticId('CALL', `new:${constructorName}`, ctx.scopeTracker.getContext(), { discriminator });
|
|
85
|
+
}
|
|
86
|
+
ctx.callSites.push({
|
|
87
|
+
id: newCallId,
|
|
88
|
+
type: 'CALL',
|
|
89
|
+
name: constructorName,
|
|
90
|
+
file: ctx.module.file,
|
|
91
|
+
line: getLine(newNode),
|
|
92
|
+
parentScopeId: ctx.getCurrentScopeId(),
|
|
93
|
+
targetFunctionName: constructorName,
|
|
94
|
+
isNew: true
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// Handle namespaced constructor: new ns.Constructor()
|
|
98
|
+
else if (newNode.callee.type === 'MemberExpression') {
|
|
99
|
+
const memberCallee = newNode.callee;
|
|
100
|
+
const object = memberCallee.object;
|
|
101
|
+
const property = memberCallee.property;
|
|
102
|
+
if (object.type === 'Identifier' && property.type === 'Identifier') {
|
|
103
|
+
if (ctx.processedMethodCalls.has(nodeKey)) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
ctx.processedMethodCalls.add(nodeKey);
|
|
107
|
+
const objectName = object.name;
|
|
108
|
+
const constructorName = property.name;
|
|
109
|
+
const fullName = `${objectName}.${constructorName}`;
|
|
110
|
+
// Generate semantic ID for method-style constructor call
|
|
111
|
+
const legacyId = `CALL#new:${fullName}#${ctx.module.file}#${getLine(newNode)}:${getColumn(newNode)}:${ctx.callSiteCounterRef.value++}`;
|
|
112
|
+
let newMethodCallId = legacyId;
|
|
113
|
+
if (ctx.scopeTracker) {
|
|
114
|
+
const discriminator = ctx.scopeTracker.getItemCounter(`CALL:new:${fullName}`);
|
|
115
|
+
newMethodCallId = computeSemanticId('CALL', `new:${fullName}`, ctx.scopeTracker.getContext(), { discriminator });
|
|
116
|
+
}
|
|
117
|
+
ctx.methodCalls.push({
|
|
118
|
+
id: newMethodCallId,
|
|
119
|
+
type: 'CALL',
|
|
120
|
+
name: fullName,
|
|
121
|
+
object: objectName,
|
|
122
|
+
method: constructorName,
|
|
123
|
+
file: ctx.module.file,
|
|
124
|
+
line: getLine(newNode),
|
|
125
|
+
column: getColumn(newNode),
|
|
126
|
+
parentScopeId: ctx.getCurrentScopeId(),
|
|
127
|
+
isNew: true
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=NewExpressionHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewExpressionHandler.js","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/NewExpressionHandler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,OAAO,oBAAqB,SAAQ,mBAAmB;IAC3D,WAAW;QACT,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QAErB,OAAO;YACL,oCAAoC;YACpC,aAAa,EAAE,CAAC,OAAkC,EAAE,EAAE;gBACpD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;gBAC7B,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;gBAEtD,kCAAkC;gBAClC,IAAI,SAAS,GAAkB,IAAI,CAAC;gBACpC,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;oBACzC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;gBAClC,CAAC;qBAAM,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;oBACvG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC3C,CAAC;gBAED,gEAAgE;gBAChE,IAAI,SAAS,EAAE,CAAC;oBACd,MAAM,cAAc,GAAG,eAAe,OAAO,EAAE,CAAC;oBAChD,IAAI,CAAC,GAA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4
|
+
*
|
|
5
|
+
* Mechanical extraction from analyzeFunctionBody() (REG-422).
|
|
6
|
+
* Original source: JSASTAnalyzer.ts lines ~4287-4877.
|
|
7
|
+
*/
|
|
8
|
+
import type { Visitor } from '@babel/traverse';
|
|
9
|
+
import { FunctionBodyHandler } from './FunctionBodyHandler.js';
|
|
10
|
+
export declare class PropertyAccessHandler extends FunctionBodyHandler {
|
|
11
|
+
getHandlers(): Visitor;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=PropertyAccessHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyAccessHandler.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/analysis/ast/handlers/PropertyAccessHandler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,iBAAiB,CAAC;AAKzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,qBAAa,qBAAsB,SAAQ,mBAAmB;IAC5D,WAAW,IAAI,OAAO;CAgGvB"}
|