@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
|
@@ -1,263 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MethodCallResolver -
|
|
2
|
+
* MethodCallResolver - enriches METHOD_CALL nodes with CALLS edges to method definitions.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1.
|
|
6
|
-
* 2.
|
|
7
|
-
* 3.
|
|
4
|
+
* Finds method calls (CALL nodes with "object" attribute) and links them to:
|
|
5
|
+
* 1. Class methods in the same file
|
|
6
|
+
* 2. Class methods in imported modules
|
|
7
|
+
* 3. Object variable methods
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* - METHOD_CALL -> CALLS -> METHOD (
|
|
11
|
-
* - METHOD_CALL -> CALLS -> FUNCTION (
|
|
9
|
+
* CREATES EDGES:
|
|
10
|
+
* - METHOD_CALL -> CALLS -> METHOD (for class methods)
|
|
11
|
+
* - METHOD_CALL -> CALLS -> FUNCTION (for object methods)
|
|
12
|
+
*
|
|
13
|
+
* Implementation split into focused modules under ./method-call/ (REG-463):
|
|
14
|
+
* - MethodCallData: constants, types, data sets
|
|
15
|
+
* - MethodCallDetectors: external/built-in detection
|
|
16
|
+
* - MethodCallIndexers: class-method and variable-type index building
|
|
17
|
+
* - MethodCallResolution: core resolution logic
|
|
18
|
+
* - MethodCallErrorAnalysis: strict mode error analysis and suggestions
|
|
12
19
|
*/
|
|
13
20
|
|
|
14
21
|
import { Plugin, createSuccessResult } from '../Plugin.js';
|
|
15
22
|
import type { PluginContext, PluginResult, PluginMetadata } from '../Plugin.js';
|
|
16
23
|
import type { BaseNodeRecord } from '@grafema/types';
|
|
17
|
-
import { StrictModeError
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Built-in JavaScript prototype methods that should never error in strict mode.
|
|
21
|
-
* These exist on primitive types and common objects.
|
|
22
|
-
*/
|
|
23
|
-
const BUILTIN_PROTOTYPE_METHODS = new Set([
|
|
24
|
-
// Array.prototype
|
|
25
|
-
'concat', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find',
|
|
26
|
-
'findIndex', 'findLast', 'findLastIndex', 'flat', 'flatMap', 'forEach',
|
|
27
|
-
'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'map', 'pop',
|
|
28
|
-
'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some',
|
|
29
|
-
'sort', 'splice', 'toLocaleString', 'toReversed', 'toSorted', 'toSpliced',
|
|
30
|
-
'toString', 'unshift', 'values', 'with', 'at',
|
|
31
|
-
|
|
32
|
-
// String.prototype
|
|
33
|
-
'charAt', 'charCodeAt', 'codePointAt', 'endsWith', 'localeCompare',
|
|
34
|
-
'match', 'matchAll', 'normalize', 'padEnd', 'padStart', 'repeat',
|
|
35
|
-
'replace', 'replaceAll', 'search', 'split', 'startsWith', 'substring',
|
|
36
|
-
'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase',
|
|
37
|
-
'trim', 'trimEnd', 'trimStart',
|
|
38
|
-
|
|
39
|
-
// Object.prototype (commonly called on objects)
|
|
40
|
-
'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'valueOf',
|
|
41
|
-
|
|
42
|
-
// Number.prototype
|
|
43
|
-
'toExponential', 'toFixed', 'toPrecision',
|
|
44
|
-
|
|
45
|
-
// Date.prototype
|
|
46
|
-
'getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds',
|
|
47
|
-
'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset',
|
|
48
|
-
'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours',
|
|
49
|
-
'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds',
|
|
50
|
-
'setDate', 'setFullYear', 'setHours', 'setMilliseconds', 'setMinutes',
|
|
51
|
-
'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',
|
|
52
|
-
'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth',
|
|
53
|
-
'setUTCSeconds', 'toDateString', 'toISOString', 'toJSON',
|
|
54
|
-
'toLocaleDateString', 'toLocaleTimeString', 'toTimeString', 'toUTCString',
|
|
55
|
-
|
|
56
|
-
// Map.prototype
|
|
57
|
-
'clear', 'delete', 'get', 'has', 'set', 'size',
|
|
58
|
-
|
|
59
|
-
// Set.prototype (same as Map + add)
|
|
60
|
-
'add',
|
|
61
|
-
|
|
62
|
-
// Promise.prototype
|
|
63
|
-
'then', 'catch', 'finally',
|
|
64
|
-
|
|
65
|
-
// Function.prototype
|
|
66
|
-
'apply', 'bind', 'call',
|
|
67
|
-
|
|
68
|
-
// RegExp.prototype
|
|
69
|
-
'exec', 'test',
|
|
70
|
-
]);
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Common library method patterns that should be treated as external.
|
|
74
|
-
* These are methods from well-known npm packages.
|
|
75
|
-
*/
|
|
76
|
-
const COMMON_LIBRARY_METHODS = new Set([
|
|
77
|
-
// Express/HTTP response
|
|
78
|
-
'json', 'status', 'send', 'redirect', 'render', 'sendFile', 'sendStatus',
|
|
79
|
-
'type', 'format', 'attachment', 'download', 'end', 'cookie', 'clearCookie',
|
|
80
|
-
'location', 'links', 'jsonp', 'vary', 'append', 'header', 'setHeader',
|
|
81
|
-
|
|
82
|
-
// Express router/app
|
|
83
|
-
'use', 'route', 'param', 'all', 'listen',
|
|
84
|
-
|
|
85
|
-
// HTTP methods (router.get, router.post, etc.)
|
|
86
|
-
// Note: 'get' is also in BUILTIN_PROTOTYPE_METHODS (Map.get)
|
|
87
|
-
'post', 'put', 'patch', 'options', 'head',
|
|
88
|
-
|
|
89
|
-
// Socket.io
|
|
90
|
-
'on', 'emit', 'to', 'in', 'join', 'leave', 'disconnect', 'broadcast',
|
|
91
|
-
'once', 'off', 'removeListener', 'removeAllListeners',
|
|
92
|
-
|
|
93
|
-
// EventEmitter
|
|
94
|
-
'addListener', 'prependListener', 'prependOnceListener', 'listeners',
|
|
95
|
-
'listenerCount', 'eventNames', 'rawListeners', 'setMaxListeners',
|
|
96
|
-
'getMaxListeners',
|
|
97
|
-
|
|
98
|
-
// Fetch API / Response
|
|
99
|
-
'text', 'blob', 'arrayBuffer', 'formData', 'clone', 'ok', 'redirected',
|
|
100
|
-
|
|
101
|
-
// Node.js streams
|
|
102
|
-
'pipe', 'unpipe', 'read', 'write', 'pause', 'resume', 'destroy', 'cork',
|
|
103
|
-
'uncork', 'setEncoding', 'setDefaultEncoding',
|
|
104
|
-
|
|
105
|
-
// Axios
|
|
106
|
-
'request', 'interceptors', 'create',
|
|
107
|
-
|
|
108
|
-
// JWT (jsonwebtoken)
|
|
109
|
-
'sign', 'verify', 'decode',
|
|
110
|
-
|
|
111
|
-
// Telegram bot API (node-telegram-bot-api)
|
|
112
|
-
'sendMessage', 'sendPhoto', 'sendDocument', 'sendVideo', 'sendAudio',
|
|
113
|
-
'sendSticker', 'sendVoice', 'sendLocation', 'sendVenue', 'sendContact',
|
|
114
|
-
'sendPoll', 'sendDice', 'sendChatAction', 'onText', 'onMessage',
|
|
115
|
-
'answerCallbackQuery', 'editMessageText', 'deleteMessage', 'forwardMessage',
|
|
116
|
-
'copyMessage', 'getUpdates', 'setWebHook', 'deleteWebHook', 'getWebHookInfo',
|
|
117
|
-
|
|
118
|
-
// Database (SQLite, better-sqlite3, knex, sequelize)
|
|
119
|
-
'run', 'all', 'prepare', 'exec', 'query', 'transaction', 'pragma',
|
|
120
|
-
'backup', 'serialize', 'parallelize', 'raw', 'select', 'insert', 'update',
|
|
121
|
-
'from', 'where', 'whereIn', 'whereNot', 'orWhere', 'andWhere',
|
|
122
|
-
'orderBy', 'groupBy', 'having', 'limit', 'offset', 'first',
|
|
123
|
-
|
|
124
|
-
// Express-validator
|
|
125
|
-
'custom', 'isEmail', 'isLength', 'isNumeric', 'isInt', 'isFloat',
|
|
126
|
-
'isBoolean', 'isDate', 'isURL', 'isUUID', 'isEmpty', 'isNotEmpty',
|
|
127
|
-
'exists', 'optional', 'notEmpty', 'bail', 'withMessage', 'sanitize',
|
|
128
|
-
'trim', 'escape', 'normalizeEmail', 'toInt', 'toFloat', 'toBoolean',
|
|
129
|
-
'toDate', 'check', 'body', 'param', 'validationResult',
|
|
130
|
-
|
|
131
|
-
// dotenv
|
|
132
|
-
'config', 'parse',
|
|
133
|
-
|
|
134
|
-
// SQLite (statement methods)
|
|
135
|
-
'finalize', 'step', 'bind', 'reset', 'columns', 'safeIntegers',
|
|
136
|
-
'pluck', 'expand', 'iterate', 'reader',
|
|
137
|
-
|
|
138
|
-
// Additional Telegram bot methods
|
|
139
|
-
'editMessageReplyMarkup', 'editMessageCaption', 'editMessageMedia',
|
|
140
|
-
'stopPoll', 'sendMediaGroup', 'sendAnimation', 'sendVideoNote',
|
|
141
|
-
'kickChatMember', 'banChatMember', 'unbanChatMember', 'restrictChatMember',
|
|
142
|
-
'promoteChatMember', 'setChatPermissions', 'setChatPhoto', 'deleteChatPhoto',
|
|
143
|
-
'setChatTitle', 'setChatDescription', 'pinChatMessage', 'unpinChatMessage',
|
|
144
|
-
'leaveChat', 'getChat', 'getChatMember', 'getChatMembersCount',
|
|
145
|
-
'getChatAdministrators', 'answerInlineQuery', 'sendInvoice',
|
|
146
|
-
'answerShippingQuery', 'answerPreCheckoutQuery', 'getMe',
|
|
147
|
-
|
|
148
|
-
// Crypto
|
|
149
|
-
'digest', 'update', 'hash', 'createHash', 'createHmac', 'createCipheriv',
|
|
150
|
-
'createDecipheriv', 'randomBytes', 'pbkdf2', 'scrypt', 'generateKeyPair',
|
|
151
|
-
|
|
152
|
-
// Express factory methods
|
|
153
|
-
'urlencoded', 'static', 'Router',
|
|
154
|
-
|
|
155
|
-
// DOM
|
|
156
|
-
'addEventListener', 'removeEventListener', 'dispatchEvent', 'querySelector',
|
|
157
|
-
'querySelectorAll', 'getElementById', 'getElementsByClassName',
|
|
158
|
-
'getElementsByTagName', 'createElement', 'createTextNode', 'appendChild',
|
|
159
|
-
'removeChild', 'insertBefore', 'replaceChild', 'cloneNode', 'getAttribute',
|
|
160
|
-
'setAttribute', 'removeAttribute', 'hasAttribute', 'classList', 'focus',
|
|
161
|
-
'blur', 'click', 'submit', 'reset', 'preventDefault', 'stopPropagation',
|
|
162
|
-
'stopImmediatePropagation',
|
|
163
|
-
|
|
164
|
-
// Browser storage
|
|
165
|
-
'getItem', 'setItem', 'removeItem', 'key', 'length',
|
|
166
|
-
|
|
167
|
-
// React
|
|
168
|
-
'createRoot', 'render', 'unmount', 'useState', 'useEffect', 'useCallback',
|
|
169
|
-
'useMemo', 'useRef', 'useContext', 'useReducer',
|
|
170
|
-
]);
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Semantic groups for library coverage reporting.
|
|
174
|
-
* Maps library namespaces to their semantic category and suggested plugin.
|
|
175
|
-
*/
|
|
176
|
-
export const LIBRARY_SEMANTIC_GROUPS: Record<string, { semantic: string; suggestedPlugin: string; description: string }> = {
|
|
177
|
-
// HTTP Clients
|
|
178
|
-
axios: { semantic: 'http-client', suggestedPlugin: 'FetchAnalyzer', description: 'HTTP requests not tracked' },
|
|
179
|
-
got: { semantic: 'http-client', suggestedPlugin: 'FetchAnalyzer', description: 'HTTP requests not tracked' },
|
|
180
|
-
superagent: { semantic: 'http-client', suggestedPlugin: 'FetchAnalyzer', description: 'HTTP requests not tracked' },
|
|
181
|
-
request: { semantic: 'http-client', suggestedPlugin: 'FetchAnalyzer', description: 'HTTP requests not tracked' },
|
|
182
|
-
ky: { semantic: 'http-client', suggestedPlugin: 'FetchAnalyzer', description: 'HTTP requests not tracked' },
|
|
183
|
-
|
|
184
|
-
// HTTP Response (Express-like)
|
|
185
|
-
res: { semantic: 'http-response', suggestedPlugin: 'ExpressResponseAnalyzer', description: 'Response data flow not tracked' },
|
|
186
|
-
ctx: { semantic: 'http-response', suggestedPlugin: 'KoaResponseAnalyzer', description: 'Response data flow not tracked' },
|
|
187
|
-
reply: { semantic: 'http-response', suggestedPlugin: 'FastifyResponseAnalyzer', description: 'Response data flow not tracked' },
|
|
188
|
-
|
|
189
|
-
// Routers
|
|
190
|
-
router: { semantic: 'http-router', suggestedPlugin: 'ExpressRouteAnalyzer', description: 'Routes may not be tracked' },
|
|
191
|
-
app: { semantic: 'http-router', suggestedPlugin: 'ExpressRouteAnalyzer', description: 'Routes may not be tracked' },
|
|
192
|
-
|
|
193
|
-
// WebSocket
|
|
194
|
-
socket: { semantic: 'websocket', suggestedPlugin: 'SocketIOAnalyzer', description: 'WebSocket events not tracked' },
|
|
195
|
-
io: { semantic: 'websocket', suggestedPlugin: 'SocketIOAnalyzer', description: 'WebSocket events not tracked' },
|
|
196
|
-
ws: { semantic: 'websocket', suggestedPlugin: 'WebSocketAnalyzer', description: 'WebSocket events not tracked' },
|
|
197
|
-
|
|
198
|
-
// Database
|
|
199
|
-
knex: { semantic: 'database', suggestedPlugin: 'KnexAnalyzer', description: 'Database queries not tracked' },
|
|
200
|
-
sequelize: { semantic: 'database', suggestedPlugin: 'SequelizeAnalyzer', description: 'Database queries not tracked' },
|
|
201
|
-
prisma: { semantic: 'database', suggestedPlugin: 'PrismaAnalyzer', description: 'Database queries not tracked' },
|
|
202
|
-
mongoose: { semantic: 'database', suggestedPlugin: 'MongooseAnalyzer', description: 'Database queries not tracked' },
|
|
203
|
-
db: { semantic: 'database', suggestedPlugin: 'DatabaseAnalyzer', description: 'Database queries not tracked' },
|
|
204
|
-
pool: { semantic: 'database', suggestedPlugin: 'DatabaseAnalyzer', description: 'Database queries not tracked' },
|
|
205
|
-
|
|
206
|
-
// Auth
|
|
207
|
-
jwt: { semantic: 'auth', suggestedPlugin: 'AuthAnalyzer', description: 'Auth flow not visible' },
|
|
208
|
-
jsonwebtoken: { semantic: 'auth', suggestedPlugin: 'AuthAnalyzer', description: 'Auth flow not visible' },
|
|
209
|
-
passport: { semantic: 'auth', suggestedPlugin: 'PassportAnalyzer', description: 'Auth strategies not tracked' },
|
|
210
|
-
bcrypt: { semantic: 'auth', suggestedPlugin: 'AuthAnalyzer', description: 'Password handling not tracked' },
|
|
211
|
-
|
|
212
|
-
// Validation
|
|
213
|
-
validator: { semantic: 'validation', suggestedPlugin: 'ValidationAnalyzer', description: 'Validation rules not tracked' },
|
|
214
|
-
joi: { semantic: 'validation', suggestedPlugin: 'JoiAnalyzer', description: 'Validation schemas not tracked' },
|
|
215
|
-
yup: { semantic: 'validation', suggestedPlugin: 'YupAnalyzer', description: 'Validation schemas not tracked' },
|
|
216
|
-
zod: { semantic: 'validation', suggestedPlugin: 'ZodAnalyzer', description: 'Validation schemas not tracked' },
|
|
217
|
-
|
|
218
|
-
// Logging
|
|
219
|
-
logger: { semantic: 'logging', suggestedPlugin: 'LoggingAnalyzer', description: 'Log statements not tracked' },
|
|
220
|
-
winston: { semantic: 'logging', suggestedPlugin: 'LoggingAnalyzer', description: 'Log statements not tracked' },
|
|
221
|
-
pino: { semantic: 'logging', suggestedPlugin: 'LoggingAnalyzer', description: 'Log statements not tracked' },
|
|
222
|
-
bunyan: { semantic: 'logging', suggestedPlugin: 'LoggingAnalyzer', description: 'Log statements not tracked' },
|
|
223
|
-
|
|
224
|
-
// Telegram bot
|
|
225
|
-
bot: { semantic: 'telegram-bot', suggestedPlugin: 'TelegramBotAnalyzer', description: 'Bot commands not tracked' },
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Library call statistics for coverage reporting
|
|
230
|
-
*/
|
|
231
|
-
export interface LibraryCallStats {
|
|
232
|
-
object: string;
|
|
233
|
-
methods: Map<string, number>; // method -> count
|
|
234
|
-
totalCalls: number;
|
|
235
|
-
semantic?: string;
|
|
236
|
-
suggestedPlugin?: string;
|
|
237
|
-
description?: string;
|
|
238
|
-
}
|
|
24
|
+
import { StrictModeError } from '../../errors/GrafemaError.js';
|
|
239
25
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
grafemaIgnore?: { code: string; reason?: string };
|
|
248
|
-
}
|
|
26
|
+
// Import from extracted modules
|
|
27
|
+
import { BUILTIN_PROTOTYPE_METHODS } from './method-call/MethodCallData.js';
|
|
28
|
+
import type { MethodCallNode, LibraryCallStats } from './method-call/MethodCallData.js';
|
|
29
|
+
import { isExternalMethod, isBuiltInObject, trackLibraryCall } from './method-call/MethodCallDetectors.js';
|
|
30
|
+
import { buildClassMethodIndex, buildVariableTypeIndex } from './method-call/MethodCallIndexers.js';
|
|
31
|
+
import { resolveMethodCall } from './method-call/MethodCallResolution.js';
|
|
32
|
+
import { analyzeResolutionFailure, generateContextualSuggestion } from './method-call/MethodCallErrorAnalysis.js';
|
|
249
33
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
interface ClassEntry {
|
|
254
|
-
classNode: BaseNodeRecord;
|
|
255
|
-
methods: Map<string, BaseNodeRecord>;
|
|
256
|
-
}
|
|
34
|
+
// Re-export for backward compatibility (used by packages/core/src/index.ts)
|
|
35
|
+
export { LIBRARY_SEMANTIC_GROUPS } from './method-call/MethodCallData.js';
|
|
36
|
+
export type { LibraryCallStats } from './method-call/MethodCallData.js';
|
|
257
37
|
|
|
258
38
|
export class MethodCallResolver extends Plugin {
|
|
259
|
-
private _containingClassCache?: Map<string, BaseNodeRecord | null>;
|
|
260
|
-
|
|
261
39
|
get metadata(): PluginMetadata {
|
|
262
40
|
return {
|
|
263
41
|
name: 'MethodCallResolver',
|
|
@@ -266,7 +44,9 @@ export class MethodCallResolver extends Plugin {
|
|
|
266
44
|
nodes: [],
|
|
267
45
|
edges: ['CALLS']
|
|
268
46
|
},
|
|
269
|
-
dependencies: ['ImportExportLinker']
|
|
47
|
+
dependencies: ['ImportExportLinker'],
|
|
48
|
+
consumes: ['CONTAINS', 'INSTANCE_OF', 'DERIVES_FROM'],
|
|
49
|
+
produces: ['CALLS']
|
|
270
50
|
};
|
|
271
51
|
}
|
|
272
52
|
|
|
@@ -286,7 +66,7 @@ export class MethodCallResolver extends Plugin {
|
|
|
286
66
|
// Track library calls for coverage reporting
|
|
287
67
|
const libraryCallStats = new Map<string, LibraryCallStats>();
|
|
288
68
|
|
|
289
|
-
//
|
|
69
|
+
// Collect all METHOD_CALL nodes (CALL with object attribute)
|
|
290
70
|
// REG-332: Deduplicate by (object, method, file, line), preferring nodes with grafemaIgnore
|
|
291
71
|
const methodCallMap = new Map<string, MethodCallNode>();
|
|
292
72
|
for await (const node of graph.queryNodes({ nodeType: 'CALL' })) {
|
|
@@ -318,12 +98,14 @@ export class MethodCallResolver extends Plugin {
|
|
|
318
98
|
|
|
319
99
|
logger.info('Found method calls to resolve', { count: methodCalls.length });
|
|
320
100
|
|
|
321
|
-
//
|
|
322
|
-
const classMethodIndex = await
|
|
101
|
+
// Build indexes for fast lookup
|
|
102
|
+
const classMethodIndex = await buildClassMethodIndex(graph, logger);
|
|
323
103
|
logger.info('Indexed classes', { count: classMethodIndex.size });
|
|
324
104
|
|
|
325
|
-
|
|
326
|
-
|
|
105
|
+
const variableTypes = await buildVariableTypeIndex(graph, logger);
|
|
106
|
+
|
|
107
|
+
// Cache for containing class lookups (local to this execution)
|
|
108
|
+
const containingClassCache = new Map<string, BaseNodeRecord | null>();
|
|
327
109
|
|
|
328
110
|
const startTime = Date.now();
|
|
329
111
|
|
|
@@ -354,32 +136,33 @@ export class MethodCallResolver extends Plugin {
|
|
|
354
136
|
});
|
|
355
137
|
}
|
|
356
138
|
|
|
357
|
-
//
|
|
358
|
-
if (
|
|
139
|
+
// Skip external methods (console, Array.prototype, etc.)
|
|
140
|
+
if (isExternalMethod(methodCall.object!, methodCall.method!)) {
|
|
359
141
|
externalSkipped++;
|
|
360
142
|
|
|
361
143
|
// Track library calls for coverage reporting (skip built-in objects)
|
|
362
144
|
const obj = methodCall.object!;
|
|
363
145
|
const method = methodCall.method!;
|
|
364
|
-
if (!
|
|
365
|
-
|
|
146
|
+
if (!isBuiltInObject(obj) && !BUILTIN_PROTOTYPE_METHODS.has(method)) {
|
|
147
|
+
trackLibraryCall(libraryCallStats, obj, method);
|
|
366
148
|
}
|
|
367
149
|
|
|
368
150
|
continue;
|
|
369
151
|
}
|
|
370
152
|
|
|
371
|
-
//
|
|
153
|
+
// Check if CALLS edge already exists
|
|
372
154
|
const existingEdges = await graph.getOutgoingEdges(methodCall.id, ['CALLS']);
|
|
373
155
|
if (existingEdges.length > 0) {
|
|
374
|
-
continue; //
|
|
156
|
+
continue; // Already linked
|
|
375
157
|
}
|
|
376
158
|
|
|
377
|
-
//
|
|
378
|
-
const targetMethod = await
|
|
159
|
+
// Try to find method definition
|
|
160
|
+
const targetMethod = await resolveMethodCall(
|
|
379
161
|
methodCall,
|
|
380
162
|
classMethodIndex,
|
|
381
163
|
variableTypes,
|
|
382
|
-
graph
|
|
164
|
+
graph,
|
|
165
|
+
containingClassCache
|
|
383
166
|
);
|
|
384
167
|
|
|
385
168
|
if (targetMethod) {
|
|
@@ -405,14 +188,14 @@ export class MethodCallResolver extends Plugin {
|
|
|
405
188
|
}
|
|
406
189
|
|
|
407
190
|
// Analyze WHY resolution failed
|
|
408
|
-
const { reason, chain } =
|
|
191
|
+
const { reason, chain } = analyzeResolutionFailure(
|
|
409
192
|
methodCall,
|
|
410
193
|
classMethodIndex,
|
|
411
194
|
variableTypes
|
|
412
195
|
);
|
|
413
196
|
|
|
414
197
|
// Generate context-aware suggestion based on failure reason
|
|
415
|
-
const suggestion =
|
|
198
|
+
const suggestion = generateContextualSuggestion(
|
|
416
199
|
methodCall.object!,
|
|
417
200
|
methodCall.method!,
|
|
418
201
|
reason,
|
|
@@ -476,398 +259,4 @@ export class MethodCallResolver extends Plugin {
|
|
|
476
259
|
|
|
477
260
|
return createSuccessResult({ nodes: 0, edges: edgesCreated }, summary, errors);
|
|
478
261
|
}
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* Строит индекс классов и их методов
|
|
482
|
-
*/
|
|
483
|
-
private async buildClassMethodIndex(graph: PluginContext['graph'], logger: ReturnType<typeof this.log>): Promise<Map<string, ClassEntry>> {
|
|
484
|
-
const index = new Map<string, ClassEntry>();
|
|
485
|
-
const startTime = Date.now();
|
|
486
|
-
let classCount = 0;
|
|
487
|
-
|
|
488
|
-
for await (const classNode of graph.queryNodes({ nodeType: 'CLASS' })) {
|
|
489
|
-
classCount++;
|
|
490
|
-
if (classCount % 50 === 0) {
|
|
491
|
-
logger.debug('Indexing classes', { count: classCount });
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
const className = classNode.name as string;
|
|
495
|
-
if (!className) continue;
|
|
496
|
-
|
|
497
|
-
const classEntry: ClassEntry = {
|
|
498
|
-
classNode,
|
|
499
|
-
methods: new Map()
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
const containsEdges = await graph.getOutgoingEdges(classNode.id, ['CONTAINS']);
|
|
503
|
-
for (const edge of containsEdges) {
|
|
504
|
-
const childNode = await graph.getNode(edge.dst);
|
|
505
|
-
if (childNode && (childNode.type === 'METHOD' || childNode.type === 'FUNCTION')) {
|
|
506
|
-
if (childNode.name) {
|
|
507
|
-
classEntry.methods.set(childNode.name as string, childNode);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
index.set(className, classEntry);
|
|
513
|
-
|
|
514
|
-
// Также индексируем по файлу для локального резолвинга
|
|
515
|
-
const fileKey = `${classNode.file}:${className}`;
|
|
516
|
-
index.set(fileKey, classEntry);
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
const totalTime = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
520
|
-
logger.debug('Indexed class entries', { count: index.size, time: `${totalTime}s` });
|
|
521
|
-
|
|
522
|
-
return index;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* Строит индекс переменных и их типов (из INSTANCE_OF рёбер)
|
|
527
|
-
*/
|
|
528
|
-
private async buildVariableTypeIndex(graph: PluginContext['graph'], logger: ReturnType<typeof this.log>): Promise<Map<string, string>> {
|
|
529
|
-
const startTime = Date.now();
|
|
530
|
-
const index = new Map<string, string>();
|
|
531
|
-
|
|
532
|
-
for await (const classNode of graph.queryNodes({ nodeType: 'CLASS' })) {
|
|
533
|
-
if (!classNode.name) continue;
|
|
534
|
-
|
|
535
|
-
const incomingEdges = await graph.getIncomingEdges(classNode.id, ['INSTANCE_OF']);
|
|
536
|
-
for (const edge of incomingEdges) {
|
|
537
|
-
index.set(edge.src.toString(), classNode.name as string);
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
542
|
-
logger.debug('Built variable type index', { entries: index.size, time: `${elapsed}s` });
|
|
543
|
-
return index;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
/**
|
|
547
|
-
* Пытается найти определение метода
|
|
548
|
-
*/
|
|
549
|
-
private async resolveMethodCall(
|
|
550
|
-
methodCall: MethodCallNode,
|
|
551
|
-
classMethodIndex: Map<string, ClassEntry>,
|
|
552
|
-
variableTypes: Map<string, string>,
|
|
553
|
-
graph: PluginContext['graph']
|
|
554
|
-
): Promise<BaseNodeRecord | null> {
|
|
555
|
-
const { object, method, file } = methodCall;
|
|
556
|
-
|
|
557
|
-
if (!object || !method) return null;
|
|
558
|
-
|
|
559
|
-
// 1. Проверяем если object - это имя класса напрямую (статический вызов)
|
|
560
|
-
if (classMethodIndex.has(object)) {
|
|
561
|
-
const classEntry = classMethodIndex.get(object)!;
|
|
562
|
-
if (classEntry.methods.has(method)) {
|
|
563
|
-
return classEntry.methods.get(method)!;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
// 2. Проверяем локальный класс в том же файле
|
|
568
|
-
const localKey = `${file}:${object}`;
|
|
569
|
-
if (classMethodIndex.has(localKey)) {
|
|
570
|
-
const classEntry = classMethodIndex.get(localKey)!;
|
|
571
|
-
if (classEntry.methods.has(method)) {
|
|
572
|
-
return classEntry.methods.get(method)!;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
// 3. Проверяем если object - это "this" (ссылка на текущий класс)
|
|
577
|
-
if (object === 'this') {
|
|
578
|
-
if (!this._containingClassCache) this._containingClassCache = new Map();
|
|
579
|
-
|
|
580
|
-
let containingClass = this._containingClassCache.get(methodCall.id);
|
|
581
|
-
if (containingClass === undefined) {
|
|
582
|
-
containingClass = await this.findContainingClass(methodCall, graph);
|
|
583
|
-
this._containingClassCache.set(methodCall.id, containingClass);
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
if (containingClass && classMethodIndex.has(containingClass.name as string)) {
|
|
587
|
-
const classEntry = classMethodIndex.get(containingClass.name as string)!;
|
|
588
|
-
if (classEntry.methods.has(method)) {
|
|
589
|
-
return classEntry.methods.get(method)!;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
// 4. Используем variableTypes индекс
|
|
595
|
-
for (const [, className] of variableTypes.entries()) {
|
|
596
|
-
if (className && classMethodIndex.has(className)) {
|
|
597
|
-
const classEntry = classMethodIndex.get(className)!;
|
|
598
|
-
if (classEntry.methods.has(method)) {
|
|
599
|
-
return classEntry.methods.get(method)!;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
return null;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Находит класс, содержащий данный method call
|
|
609
|
-
*/
|
|
610
|
-
private async findContainingClass(
|
|
611
|
-
methodCall: MethodCallNode,
|
|
612
|
-
graph: PluginContext['graph']
|
|
613
|
-
): Promise<BaseNodeRecord | null> {
|
|
614
|
-
const incomingEdges = await graph.getIncomingEdges(methodCall.id, ['CONTAINS']);
|
|
615
|
-
|
|
616
|
-
for (const edge of incomingEdges) {
|
|
617
|
-
const parentNode = await graph.getNode(edge.src);
|
|
618
|
-
if (!parentNode) continue;
|
|
619
|
-
|
|
620
|
-
if (parentNode.type === 'CLASS') {
|
|
621
|
-
return parentNode;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
const found = await this.findContainingClassRecursive(parentNode, graph, new Set());
|
|
625
|
-
if (found) return found;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
return null;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
private async findContainingClassRecursive(
|
|
632
|
-
node: BaseNodeRecord,
|
|
633
|
-
graph: PluginContext['graph'],
|
|
634
|
-
visited: Set<string>
|
|
635
|
-
): Promise<BaseNodeRecord | null> {
|
|
636
|
-
if (visited.has(node.id.toString())) return null;
|
|
637
|
-
visited.add(node.id.toString());
|
|
638
|
-
|
|
639
|
-
const incomingEdges = await graph.getIncomingEdges(node.id, ['CONTAINS']);
|
|
640
|
-
|
|
641
|
-
for (const edge of incomingEdges) {
|
|
642
|
-
const parentNode = await graph.getNode(edge.src);
|
|
643
|
-
if (!parentNode) continue;
|
|
644
|
-
|
|
645
|
-
if (parentNode.type === 'CLASS') {
|
|
646
|
-
return parentNode;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
const found = await this.findContainingClassRecursive(parentNode, graph, visited);
|
|
650
|
-
if (found) return found;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
return null;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* Checks if a method call is external (built-in or well-known library).
|
|
658
|
-
* In strict mode, external methods are skipped (no error if unresolved).
|
|
659
|
-
*/
|
|
660
|
-
private isExternalMethod(object: string, method: string): boolean {
|
|
661
|
-
// Known global objects (console, Math, etc.)
|
|
662
|
-
const externalObjects = new Set([
|
|
663
|
-
'console', 'Math', 'JSON', 'Object', 'Array', 'String', 'Number',
|
|
664
|
-
'Boolean', 'Date', 'RegExp', 'Error', 'Promise', 'Set', 'Map',
|
|
665
|
-
'WeakSet', 'WeakMap', 'Symbol', 'Proxy', 'Reflect', 'Intl',
|
|
666
|
-
'process', 'global', 'window', 'document', 'Buffer',
|
|
667
|
-
'fs', 'path', 'http', 'https', 'crypto', 'os', 'url', 'util',
|
|
668
|
-
'localStorage', 'sessionStorage', 'navigator', 'location', 'history',
|
|
669
|
-
'performance', 'fetch', 'XMLHttpRequest', 'WebSocket',
|
|
670
|
-
'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval',
|
|
671
|
-
'requestAnimationFrame', 'cancelAnimationFrame',
|
|
672
|
-
'Atomics', 'SharedArrayBuffer', 'DataView', 'ArrayBuffer',
|
|
673
|
-
'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array',
|
|
674
|
-
'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array',
|
|
675
|
-
'Float64Array', 'BigInt64Array', 'BigUint64Array',
|
|
676
|
-
// Common npm package namespaces
|
|
677
|
-
'dotenv', 'express', 'axios', 'lodash', '_', 'moment', 'dayjs',
|
|
678
|
-
'sqlite3', 'pg', 'mysql', 'mysql2', 'mongodb', 'mongoose', 'sequelize',
|
|
679
|
-
'knex', 'typeorm', 'prisma', 'jwt', 'jsonwebtoken', 'bcrypt', 'bcryptjs',
|
|
680
|
-
'passport', 'multer', 'nodemailer', 'winston', 'bunyan', 'pino',
|
|
681
|
-
'chalk', 'colors', 'yargs', 'commander', 'inquirer', 'ora', 'figlet',
|
|
682
|
-
'uuid', 'nanoid', 'shortid', 'validator', 'joi', 'yup', 'zod',
|
|
683
|
-
'cheerio', 'puppeteer', 'playwright', 'selenium', 'sharp', 'jimp',
|
|
684
|
-
'socket', 'io', 'ws', 'Redis', 'redis', 'ioredis', 'amqp', 'amqplib',
|
|
685
|
-
'aws', 'AWS', 's3', 'sqs', 'sns', 'lambda', 'dynamodb',
|
|
686
|
-
'React', 'ReactDOM', 'Vue', 'vue', 'angular', 'Angular',
|
|
687
|
-
]);
|
|
688
|
-
|
|
689
|
-
// Check if object is a known global
|
|
690
|
-
if (externalObjects.has(object)) {
|
|
691
|
-
return true;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
// Check if method is a built-in prototype method
|
|
695
|
-
if (BUILTIN_PROTOTYPE_METHODS.has(method)) {
|
|
696
|
-
return true;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
// Check if method is a common library method
|
|
700
|
-
if (COMMON_LIBRARY_METHODS.has(method)) {
|
|
701
|
-
return true;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
return false;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* Check if object is a built-in JavaScript global (not a library namespace)
|
|
709
|
-
*/
|
|
710
|
-
private isBuiltInObject(object: string): boolean {
|
|
711
|
-
const builtInObjects = new Set([
|
|
712
|
-
'console', 'Math', 'JSON', 'Object', 'Array', 'String', 'Number',
|
|
713
|
-
'Boolean', 'Date', 'RegExp', 'Error', 'Promise', 'Set', 'Map',
|
|
714
|
-
'WeakSet', 'WeakMap', 'Symbol', 'Proxy', 'Reflect', 'Intl',
|
|
715
|
-
'process', 'global', 'window', 'document', 'Buffer',
|
|
716
|
-
'fs', 'path', 'http', 'https', 'crypto', 'os', 'url', 'util',
|
|
717
|
-
'localStorage', 'sessionStorage', 'navigator', 'location', 'history',
|
|
718
|
-
'performance', 'fetch', 'XMLHttpRequest', 'WebSocket',
|
|
719
|
-
'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval',
|
|
720
|
-
'requestAnimationFrame', 'cancelAnimationFrame',
|
|
721
|
-
'Atomics', 'SharedArrayBuffer', 'DataView', 'ArrayBuffer',
|
|
722
|
-
'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array',
|
|
723
|
-
'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array',
|
|
724
|
-
'Float64Array', 'BigInt64Array', 'BigUint64Array',
|
|
725
|
-
]);
|
|
726
|
-
return builtInObjects.has(object);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
/**
|
|
730
|
-
* Track a library method call for coverage reporting
|
|
731
|
-
*/
|
|
732
|
-
private trackLibraryCall(
|
|
733
|
-
stats: Map<string, LibraryCallStats>,
|
|
734
|
-
object: string,
|
|
735
|
-
method: string
|
|
736
|
-
): void {
|
|
737
|
-
if (!stats.has(object)) {
|
|
738
|
-
const semanticInfo = LIBRARY_SEMANTIC_GROUPS[object];
|
|
739
|
-
stats.set(object, {
|
|
740
|
-
object,
|
|
741
|
-
methods: new Map(),
|
|
742
|
-
totalCalls: 0,
|
|
743
|
-
semantic: semanticInfo?.semantic,
|
|
744
|
-
suggestedPlugin: semanticInfo?.suggestedPlugin,
|
|
745
|
-
description: semanticInfo?.description
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
const libStats = stats.get(object)!;
|
|
750
|
-
libStats.totalCalls++;
|
|
751
|
-
libStats.methods.set(method, (libStats.methods.get(method) || 0) + 1);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* Analyze why method resolution failed (REG-332).
|
|
756
|
-
* Returns the failure reason and resolution chain for context-aware suggestions.
|
|
757
|
-
*/
|
|
758
|
-
private analyzeResolutionFailure(
|
|
759
|
-
methodCall: MethodCallNode,
|
|
760
|
-
classMethodIndex: Map<string, ClassEntry>,
|
|
761
|
-
_variableTypes: Map<string, string>
|
|
762
|
-
): { reason: ResolutionFailureReason; chain: ResolutionStep[] } {
|
|
763
|
-
const { object, method, file } = methodCall;
|
|
764
|
-
const chain: ResolutionStep[] = [];
|
|
765
|
-
|
|
766
|
-
if (!object || !method) {
|
|
767
|
-
return { reason: 'unknown', chain };
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
// Check if object is a known class name (static call)
|
|
771
|
-
if (classMethodIndex.has(object)) {
|
|
772
|
-
const classEntry = classMethodIndex.get(object)!;
|
|
773
|
-
chain.push({
|
|
774
|
-
step: `${object} class lookup`,
|
|
775
|
-
result: 'found',
|
|
776
|
-
file: classEntry.classNode.file as string | undefined,
|
|
777
|
-
line: classEntry.classNode.line as number | undefined,
|
|
778
|
-
});
|
|
779
|
-
|
|
780
|
-
if (!classEntry.methods.has(method)) {
|
|
781
|
-
chain.push({
|
|
782
|
-
step: `${object}.${method} method`,
|
|
783
|
-
result: 'NOT FOUND in class',
|
|
784
|
-
});
|
|
785
|
-
return { reason: 'method_not_found', chain };
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
// Check for local class in same file
|
|
790
|
-
const localKey = `${file}:${object}`;
|
|
791
|
-
if (classMethodIndex.has(localKey)) {
|
|
792
|
-
const classEntry = classMethodIndex.get(localKey)!;
|
|
793
|
-
chain.push({
|
|
794
|
-
step: `${object} local class`,
|
|
795
|
-
result: 'found in same file',
|
|
796
|
-
});
|
|
797
|
-
|
|
798
|
-
if (!classEntry.methods.has(method)) {
|
|
799
|
-
chain.push({
|
|
800
|
-
step: `${object}.${method} method`,
|
|
801
|
-
result: 'NOT FOUND',
|
|
802
|
-
});
|
|
803
|
-
return { reason: 'method_not_found', chain };
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
// Check if this is a library call
|
|
808
|
-
if (LIBRARY_SEMANTIC_GROUPS[object]) {
|
|
809
|
-
const libInfo = LIBRARY_SEMANTIC_GROUPS[object];
|
|
810
|
-
chain.push({
|
|
811
|
-
step: `${object} lookup`,
|
|
812
|
-
result: `external library (${libInfo.semantic})`,
|
|
813
|
-
});
|
|
814
|
-
return { reason: 'external_dependency', chain };
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
// Object type is unknown
|
|
818
|
-
chain.push({
|
|
819
|
-
step: `${object} type lookup`,
|
|
820
|
-
result: 'unknown (not in class index)',
|
|
821
|
-
});
|
|
822
|
-
chain.push({
|
|
823
|
-
step: `${object}.${method}`,
|
|
824
|
-
result: 'FAILED (no type information)',
|
|
825
|
-
});
|
|
826
|
-
|
|
827
|
-
return { reason: 'unknown_object_type', chain };
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
/**
|
|
831
|
-
* Generate context-aware suggestion based on failure reason (REG-332).
|
|
832
|
-
*/
|
|
833
|
-
private generateContextualSuggestion(
|
|
834
|
-
object: string,
|
|
835
|
-
method: string,
|
|
836
|
-
reason: ResolutionFailureReason,
|
|
837
|
-
chain: ResolutionStep[]
|
|
838
|
-
): string {
|
|
839
|
-
switch (reason) {
|
|
840
|
-
case 'unknown_object_type': {
|
|
841
|
-
// Find the source in chain that shows "unknown"
|
|
842
|
-
const sourceStep = chain.find(s => s.result.includes('unknown'));
|
|
843
|
-
const sourceDesc = sourceStep?.step || 'the source';
|
|
844
|
-
return `Variable "${object}" has unknown type from ${sourceDesc}. ` +
|
|
845
|
-
`Add JSDoc: /** @type {${object}Class} */ or check imports.`;
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
case 'class_not_imported':
|
|
849
|
-
return `Class "${object}" is not imported. Check your imports or ensure the class is defined.`;
|
|
850
|
-
|
|
851
|
-
case 'method_not_found':
|
|
852
|
-
return `Class "${object}" exists but has no method "${method}". ` +
|
|
853
|
-
`Check spelling or verify the method is defined in the class.`;
|
|
854
|
-
|
|
855
|
-
case 'external_dependency': {
|
|
856
|
-
const libInfo = LIBRARY_SEMANTIC_GROUPS[object];
|
|
857
|
-
if (libInfo?.suggestedPlugin) {
|
|
858
|
-
return `This call is to external library "${object}" (${libInfo.semantic}). ` +
|
|
859
|
-
`Consider using ${libInfo.suggestedPlugin} for semantic analysis.`;
|
|
860
|
-
}
|
|
861
|
-
return `This call is to external library "${object}". ` +
|
|
862
|
-
`Consider adding type stubs or a dedicated analyzer plugin.`;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
case 'circular_reference':
|
|
866
|
-
return `Alias chain for "${object}" is too deep (possible cycle). ` +
|
|
867
|
-
`Simplify variable assignments or check for circular references.`;
|
|
868
|
-
|
|
869
|
-
default:
|
|
870
|
-
return `Check if class "${object}" is imported and has method "${method}".`;
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
262
|
}
|