@grafema/core 0.2.4-beta → 0.2.6-beta
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 +42 -122
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +228 -513
- package/dist/Orchestrator.js.map +1 -0
- 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 +92 -0
- package/dist/PhaseRunner.d.ts.map +1 -0
- package/dist/PhaseRunner.js +332 -0
- package/dist/PhaseRunner.js.map +1 -0
- package/dist/api/GraphAPI.d.ts +1 -1
- package/dist/api/GraphAPI.d.ts.map +1 -1
- package/dist/api/GraphAPI.js +3 -1
- package/dist/api/GraphAPI.js.map +1 -0
- package/dist/api/GuaranteeAPI.d.ts.map +1 -1
- package/dist/api/GuaranteeAPI.js +4 -2
- package/dist/api/GuaranteeAPI.js.map +1 -0
- package/dist/config/ConfigLoader.d.ts +117 -1
- package/dist/config/ConfigLoader.d.ts.map +1 -1
- package/dist/config/ConfigLoader.js +198 -4
- package/dist/config/ConfigLoader.js.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/config/index.js.map +1 -0
- package/dist/core/ASTWorker.d.ts +2 -0
- package/dist/core/ASTWorker.d.ts.map +1 -1
- package/dist/core/ASTWorker.js +12 -6
- package/dist/core/ASTWorker.js.map +1 -0
- package/dist/core/ASTWorkerPool.js +2 -1
- package/dist/core/ASTWorkerPool.js.map +1 -0
- package/dist/core/AnalysisQueue.js +1 -0
- package/dist/core/AnalysisQueue.js.map +1 -0
- package/dist/core/CoverageAnalyzer.d.ts.map +1 -1
- package/dist/core/CoverageAnalyzer.js +1 -0
- package/dist/core/CoverageAnalyzer.js.map +1 -0
- package/dist/core/FileExplainer.js +1 -0
- package/dist/core/FileExplainer.js.map +1 -0
- package/dist/core/FileNodeManager.d.ts.map +1 -1
- package/dist/core/FileNodeManager.js +4 -2
- package/dist/core/FileNodeManager.js.map +1 -0
- 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/GraphBackend.js +1 -0
- package/dist/core/GraphBackend.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 +8 -5
- package/dist/core/GraphFreshnessChecker.js.map +1 -0
- package/dist/core/GuaranteeManager.d.ts +13 -0
- package/dist/core/GuaranteeManager.d.ts.map +1 -1
- package/dist/core/GuaranteeManager.js +65 -3
- package/dist/core/GuaranteeManager.js.map +1 -0
- package/dist/core/HashUtils.js +1 -0
- package/dist/core/HashUtils.js.map +1 -0
- package/dist/core/IncrementalReanalyzer.d.ts.map +1 -1
- package/dist/core/IncrementalReanalyzer.js +13 -6
- package/dist/core/IncrementalReanalyzer.js.map +1 -0
- package/dist/core/ManifestStore.js +1 -0
- package/dist/core/ManifestStore.js.map +1 -0
- package/dist/core/NodeFactory.d.ts +82 -396
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +144 -322
- package/dist/core/NodeFactory.js.map +1 -0
- package/dist/core/NodeId.js +1 -0
- package/dist/core/NodeId.js.map +1 -0
- package/dist/core/PriorityQueue.js +1 -0
- package/dist/core/PriorityQueue.js.map +1 -0
- package/dist/core/Profiler.js +1 -0
- package/dist/core/Profiler.js.map +1 -0
- 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 +25 -0
- package/dist/core/ScopeTracker.js.map +1 -0
- package/dist/core/SemanticId.d.ts +69 -0
- package/dist/core/SemanticId.d.ts.map +1 -1
- package/dist/core/SemanticId.js +135 -0
- package/dist/core/SemanticId.js.map +1 -0
- package/dist/core/Task.js +1 -0
- package/dist/core/Task.js.map +1 -0
- package/dist/core/TaskTypes.js +1 -0
- package/dist/core/TaskTypes.js.map +1 -0
- package/dist/core/VersionManager.js +1 -0
- package/dist/core/VersionManager.js.map +1 -0
- package/dist/core/WorkerPool.d.ts.map +1 -1
- package/dist/core/WorkerPool.js +3 -1
- package/dist/core/WorkerPool.js.map +1 -0
- 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/ArgumentExpressionNode.js +1 -0
- package/dist/core/nodes/ArgumentExpressionNode.js.map +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js.map +1 -0
- package/dist/core/nodes/BranchNode.js +1 -0
- package/dist/core/nodes/BranchNode.js.map +1 -0
- package/dist/core/nodes/CallSiteNode.js +1 -0
- package/dist/core/nodes/CallSiteNode.js.map +1 -0
- package/dist/core/nodes/CaseNode.js +1 -0
- package/dist/core/nodes/CaseNode.js.map +1 -0
- package/dist/core/nodes/ClassNode.js +1 -0
- package/dist/core/nodes/ClassNode.js.map +1 -0
- package/dist/core/nodes/ConstantNode.js +1 -0
- package/dist/core/nodes/ConstantNode.js.map +1 -0
- package/dist/core/nodes/ConstructorCallNode.js +1 -0
- package/dist/core/nodes/ConstructorCallNode.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/DatabaseQueryNode.js +1 -0
- package/dist/core/nodes/DatabaseQueryNode.js.map +1 -0
- package/dist/core/nodes/DecoratorNode.js +1 -0
- package/dist/core/nodes/DecoratorNode.js.map +1 -0
- package/dist/core/nodes/EntrypointNode.js +1 -0
- package/dist/core/nodes/EntrypointNode.js.map +1 -0
- package/dist/core/nodes/EnumNode.js +1 -0
- package/dist/core/nodes/EnumNode.js.map +1 -0
- package/dist/core/nodes/EventListenerNode.js +1 -0
- package/dist/core/nodes/EventListenerNode.js.map +1 -0
- package/dist/core/nodes/ExportNode.js +1 -0
- package/dist/core/nodes/ExportNode.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/ExpressionNode.js +1 -0
- package/dist/core/nodes/ExpressionNode.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/ExternalModuleNode.js +1 -0
- package/dist/core/nodes/ExternalModuleNode.js.map +1 -0
- package/dist/core/nodes/ExternalStdioNode.js +1 -0
- package/dist/core/nodes/ExternalStdioNode.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/FunctionNode.js +1 -0
- package/dist/core/nodes/FunctionNode.js.map +1 -0
- package/dist/core/nodes/GuaranteeNode.js +1 -0
- package/dist/core/nodes/GuaranteeNode.js.map +1 -0
- package/dist/core/nodes/HttpRequestNode.js +1 -0
- package/dist/core/nodes/HttpRequestNode.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/ImportNode.js +1 -0
- package/dist/core/nodes/ImportNode.js.map +1 -0
- package/dist/core/nodes/InterfaceNode.js +1 -0
- package/dist/core/nodes/InterfaceNode.js.map +1 -0
- package/dist/core/nodes/IssueNode.js +1 -0
- package/dist/core/nodes/IssueNode.js.map +1 -0
- package/dist/core/nodes/LiteralNode.js +1 -0
- package/dist/core/nodes/LiteralNode.js.map +1 -0
- package/dist/core/nodes/MethodCallNode.js +1 -0
- package/dist/core/nodes/MethodCallNode.js.map +1 -0
- package/dist/core/nodes/MethodNode.js +1 -0
- package/dist/core/nodes/MethodNode.js.map +1 -0
- package/dist/core/nodes/ModuleNode.js +1 -0
- package/dist/core/nodes/ModuleNode.js.map +1 -0
- package/dist/core/nodes/NetworkRequestNode.js +1 -0
- package/dist/core/nodes/NetworkRequestNode.js.map +1 -0
- package/dist/core/nodes/NodeKind.d.ts +6 -0
- package/dist/core/nodes/NodeKind.d.ts.map +1 -1
- package/dist/core/nodes/NodeKind.js +12 -0
- package/dist/core/nodes/NodeKind.js.map +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js.map +1 -0
- package/dist/core/nodes/ParameterNode.js +1 -0
- package/dist/core/nodes/ParameterNode.js.map +1 -0
- package/dist/core/nodes/PluginNode.d.ts +69 -0
- package/dist/core/nodes/PluginNode.d.ts.map +1 -0
- package/dist/core/nodes/PluginNode.js +106 -0
- package/dist/core/nodes/PluginNode.js.map +1 -0
- 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/ScopeNode.js +1 -0
- package/dist/core/nodes/ScopeNode.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/ServiceNode.js +1 -0
- package/dist/core/nodes/ServiceNode.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 +23 -4
- package/dist/core/nodes/TypeNode.js.map +1 -0
- 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/VariableDeclarationNode.js +1 -0
- package/dist/core/nodes/VariableDeclarationNode.js.map +1 -0
- package/dist/core/nodes/index.d.ts +21 -1
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +30 -1
- package/dist/core/nodes/index.js.map +1 -0
- package/dist/core/toposort.d.ts +38 -0
- package/dist/core/toposort.d.ts.map +1 -0
- package/dist/core/toposort.js +129 -0
- package/dist/core/toposort.js.map +1 -0
- package/dist/data/builtins/BuiltinRegistry.js +1 -0
- package/dist/data/builtins/BuiltinRegistry.js.map +1 -0
- package/dist/data/builtins/definitions.js +1 -0
- package/dist/data/builtins/definitions.js.map +1 -0
- package/dist/data/builtins/index.js +1 -0
- package/dist/data/builtins/index.js.map +1 -0
- package/dist/data/builtins/jsGlobals.js +1 -0
- package/dist/data/builtins/jsGlobals.js.map +1 -0
- package/dist/data/builtins/types.js +1 -0
- package/dist/data/builtins/types.js.map +1 -0
- package/dist/data/globals/definitions.js +1 -0
- package/dist/data/globals/definitions.js.map +1 -0
- package/dist/data/globals/index.js +1 -0
- package/dist/data/globals/index.js.map +1 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts +5 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts.map +1 -1
- package/dist/diagnostics/DiagnosticCollector.js +4 -0
- package/dist/diagnostics/DiagnosticCollector.js.map +1 -0
- package/dist/diagnostics/DiagnosticReporter.d.ts +23 -1
- package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -1
- package/dist/diagnostics/DiagnosticReporter.js +68 -15
- package/dist/diagnostics/DiagnosticReporter.js.map +1 -0
- package/dist/diagnostics/DiagnosticWriter.js +1 -0
- package/dist/diagnostics/DiagnosticWriter.js.map +1 -0
- package/dist/diagnostics/categories.d.ts +57 -0
- package/dist/diagnostics/categories.d.ts.map +1 -0
- package/dist/diagnostics/categories.js +71 -0
- package/dist/diagnostics/categories.js.map +1 -0
- package/dist/diagnostics/index.d.ts +3 -0
- package/dist/diagnostics/index.d.ts.map +1 -1
- package/dist/diagnostics/index.js +4 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/errors/GrafemaError.d.ts +39 -0
- package/dist/errors/GrafemaError.d.ts.map +1 -1
- package/dist/errors/GrafemaError.js +28 -0
- package/dist/errors/GrafemaError.js.map +1 -0
- package/dist/index.d.ts +53 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -9
- package/dist/index.js.map +1 -0
- package/dist/instructions/index.d.ts +8 -0
- package/dist/instructions/index.d.ts.map +1 -0
- package/dist/instructions/index.js +20 -0
- package/dist/instructions/index.js.map +1 -0
- package/dist/instructions/onboarding.md +121 -0
- package/dist/logging/Logger.d.ts +53 -3
- package/dist/logging/Logger.d.ts.map +1 -1
- package/dist/logging/Logger.js +144 -4
- package/dist/logging/Logger.js.map +1 -0
- 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/Plugin.js +1 -0
- package/dist/plugins/Plugin.js.map +1 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/DatabaseAnalyzer.js +35 -26
- package/dist/plugins/analysis/DatabaseAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +44 -36
- package/dist/plugins/analysis/ExpressAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts +2 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js +56 -77
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +69 -62
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/FetchAnalyzer.d.ts +8 -14
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +162 -131
- package/dist/plugins/analysis/FetchAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +6 -7
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js.map +1 -0
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +77 -82
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +811 -1843
- package/dist/plugins/analysis/JSASTAnalyzer.js.map +1 -0
- 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 +41 -927
- package/dist/plugins/analysis/ReactAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.js +62 -84
- package/dist/plugins/analysis/RustAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +26 -12
- package/dist/plugins/analysis/SQLiteAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +39 -31
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js.map +1 -0
- 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 +33 -28
- package/dist/plugins/analysis/SocketIOAnalyzer.js.map +1 -0
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.js +25 -14
- package/dist/plugins/analysis/SystemDbAnalyzer.js.map +1 -0
- 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/ConditionParser.js +1 -0
- package/dist/plugins/analysis/ast/ConditionParser.js.map +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/ExpressionEvaluator.js +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.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 -209
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +164 -2023
- package/dist/plugins/analysis/ast/GraphBuilder.js.map +1 -0
- 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 +62 -1
- package/dist/plugins/analysis/ast/IdGenerator.js.map +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js.map +1 -0
- 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 +203 -1
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/types.js +1 -0
- package/dist/plugins/analysis/ast/types.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts +27 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.js +45 -0
- package/dist/plugins/analysis/ast/utils/babelTraverse.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +6 -5
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js +95 -13
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js.map +1 -0
- 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 +3 -0
- package/dist/plugins/analysis/ast/utils/index.js.map +1 -0
- package/dist/plugins/analysis/ast/utils/location.js +1 -0
- package/dist/plugins/analysis/ast/utils/location.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +3 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js.map +1 -0
- 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 +20 -140
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +335 -837
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +218 -5
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +4 -3
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +26 -8
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js.map +1 -0
- 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 +91 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js +306 -0
- package/dist/plugins/analysis/ast/visitors/PropertyAccessVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +21 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +189 -12
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js.map +1 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +7 -4
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js.map +1 -0
- 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/ast/visitors/index.d.ts +1 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/index.js +2 -0
- package/dist/plugins/analysis/ast/visitors/index.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/DiscoveryPlugin.d.ts +42 -10
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts.map +1 -1
- package/dist/plugins/discovery/DiscoveryPlugin.js +17 -1
- package/dist/plugins/discovery/DiscoveryPlugin.js.map +1 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +9 -15
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js.map +1 -0
- package/dist/plugins/discovery/SimpleProjectDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/SimpleProjectDiscovery.js +3 -2
- package/dist/plugins/discovery/SimpleProjectDiscovery.js.map +1 -0
- package/dist/plugins/discovery/WorkspaceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/WorkspaceDiscovery.js +3 -2
- package/dist/plugins/discovery/WorkspaceDiscovery.js.map +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js.map +1 -0
- package/dist/plugins/discovery/workspaces/detector.js +1 -0
- package/dist/plugins/discovery/workspaces/detector.js.map +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js.map +1 -0
- package/dist/plugins/discovery/workspaces/index.js +1 -0
- package/dist/plugins/discovery/workspaces/index.js.map +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js.map +1 -0
- package/dist/plugins/enrichment/AliasTracker.d.ts.map +1 -1
- package/dist/plugins/enrichment/AliasTracker.js +5 -2
- package/dist/plugins/enrichment/AliasTracker.js.map +1 -0
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ArgumentParameterLinker.js +4 -2
- package/dist/plugins/enrichment/ArgumentParameterLinker.js.map +1 -0
- 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 +4 -2
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js.map +1 -0
- 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 +21 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.d.ts.map +1 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.js +139 -0
- package/dist/plugins/enrichment/ExpressHandlerLinker.js.map +1 -0
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/ExternalCallResolver.js +6 -9
- package/dist/plugins/enrichment/ExternalCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts +5 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/FunctionCallResolver.js +17 -18
- package/dist/plugins/enrichment/FunctionCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +2 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +54 -14
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js.map +1 -0
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js +6 -4
- package/dist/plugins/enrichment/ImportExportLinker.js.map +1 -0
- package/dist/plugins/enrichment/InstanceOfResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/InstanceOfResolver.js +5 -2
- package/dist/plugins/enrichment/InstanceOfResolver.js.map +1 -0
- package/dist/plugins/enrichment/MethodCallResolver.d.ts +17 -30
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.js +117 -181
- package/dist/plugins/enrichment/MethodCallResolver.js.map +1 -0
- package/dist/plugins/enrichment/MountPointResolver.d.ts +1 -1
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +16 -25
- package/dist/plugins/enrichment/MountPointResolver.js.map +1 -0
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +9 -18
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js.map +1 -0
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.js +11 -6
- package/dist/plugins/enrichment/PrefixEvaluator.js.map +1 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts +30 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js +192 -0
- package/dist/plugins/enrichment/RejectionPropagationEnricher.js.map +1 -0
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js +4 -2
- package/dist/plugins/enrichment/RustFFIEnricher.js.map +1 -0
- 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 +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +6 -3
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js.map +1 -0
- 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 +3 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +24 -37
- package/dist/plugins/indexing/IncrementalModuleIndexer.js.map +1 -0
- package/dist/plugins/indexing/JSModuleIndexer.d.ts +3 -1
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +31 -44
- package/dist/plugins/indexing/JSModuleIndexer.js.map +1 -0
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +14 -12
- package/dist/plugins/indexing/RustModuleIndexer.js.map +1 -0
- 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/BrokenImportValidator.d.ts.map +1 -1
- package/dist/plugins/validation/BrokenImportValidator.js +3 -3
- package/dist/plugins/validation/BrokenImportValidator.js.map +1 -0
- package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -1
- package/dist/plugins/validation/CallResolverValidator.js +3 -3
- package/dist/plugins/validation/CallResolverValidator.js.map +1 -0
- package/dist/plugins/validation/DataFlowValidator.js +2 -1
- package/dist/plugins/validation/DataFlowValidator.js.map +1 -0
- package/dist/plugins/validation/EvalBanValidator.js +2 -1
- package/dist/plugins/validation/EvalBanValidator.js.map +1 -0
- package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -1
- package/dist/plugins/validation/GraphConnectivityValidator.js +2 -1
- package/dist/plugins/validation/GraphConnectivityValidator.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/SQLInjectionValidator.d.ts.map +1 -1
- package/dist/plugins/validation/SQLInjectionValidator.js +4 -2
- package/dist/plugins/validation/SQLInjectionValidator.js.map +1 -0
- package/dist/plugins/validation/ShadowingDetector.js +2 -1
- package/dist/plugins/validation/ShadowingDetector.js.map +1 -0
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.d.ts.map +1 -1
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js +3 -3
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.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/plugins/vcs/GitPlugin.d.ts.map +1 -1
- package/dist/plugins/vcs/GitPlugin.js +13 -6
- package/dist/plugins/vcs/GitPlugin.js.map +1 -0
- package/dist/plugins/vcs/VCSPlugin.js +1 -0
- package/dist/plugins/vcs/VCSPlugin.js.map +1 -0
- package/dist/plugins/vcs/index.js +1 -0
- package/dist/plugins/vcs/index.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 +1 -1
- package/dist/queries/findCallsInFunction.d.ts.map +1 -1
- package/dist/queries/findCallsInFunction.js +13 -4
- package/dist/queries/findCallsInFunction.js.map +1 -0
- package/dist/queries/findContainingFunction.d.ts +4 -3
- package/dist/queries/findContainingFunction.d.ts.map +1 -1
- package/dist/queries/findContainingFunction.js +14 -3
- package/dist/queries/findContainingFunction.js.map +1 -0
- package/dist/queries/index.d.ts +2 -0
- package/dist/queries/index.d.ts.map +1 -1
- package/dist/queries/index.js +2 -0
- package/dist/queries/index.js.map +1 -0
- package/dist/queries/traceValues.d.ts.map +1 -1
- package/dist/queries/traceValues.js +1 -0
- package/dist/queries/traceValues.js.map +1 -0
- package/dist/queries/types.js +1 -0
- package/dist/queries/types.js.map +1 -0
- 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/schema/GraphSchemaExtractor.js +1 -0
- package/dist/schema/GraphSchemaExtractor.js.map +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js.map +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +54 -1
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +143 -33
- package/dist/storage/backends/RFDBServerBackend.js.map +1 -0
- package/dist/storage/backends/typeValidation.d.ts.map +1 -1
- package/dist/storage/backends/typeValidation.js +3 -0
- package/dist/storage/backends/typeValidation.js.map +1 -0
- package/dist/utils/findRfdbBinary.d.ts +3 -2
- package/dist/utils/findRfdbBinary.d.ts.map +1 -1
- package/dist/utils/findRfdbBinary.js +23 -7
- package/dist/utils/findRfdbBinary.js.map +1 -0
- package/dist/utils/moduleResolution.d.ts +134 -0
- package/dist/utils/moduleResolution.d.ts.map +1 -0
- package/dist/utils/moduleResolution.js +189 -0
- package/dist/utils/moduleResolution.js.map +1 -0
- 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/validation/PathValidator.d.ts.map +1 -1
- package/dist/validation/PathValidator.js +1 -0
- package/dist/validation/PathValidator.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 +4 -3
- package/src/DiscoveryManager.ts +279 -0
- package/src/GraphInitializer.ts +131 -0
- package/src/GuaranteeChecker.ts +90 -0
- package/src/Orchestrator.ts +299 -714
- package/src/OrchestratorTypes.ts +122 -0
- package/src/ParallelAnalysisRunner.ts +188 -0
- package/src/PhaseRunner.ts +448 -0
- package/src/api/GraphAPI.ts +4 -2
- package/src/api/GuaranteeAPI.ts +3 -2
- package/src/config/ConfigLoader.ts +297 -5
- package/src/config/index.ts +9 -1
- package/src/core/ASTWorker.ts +17 -22
- package/src/core/ASTWorkerPool.ts +1 -1
- package/src/core/CoverageAnalyzer.ts +2 -2
- package/src/core/FileNodeManager.ts +3 -2
- package/src/core/FileOverview.ts +374 -0
- package/src/core/GraphFreshnessChecker.ts +7 -5
- package/src/core/GuaranteeManager.ts +71 -3
- package/src/core/IncrementalReanalyzer.ts +12 -6
- package/src/core/NodeFactory.ts +180 -626
- package/src/core/ResourceRegistry.ts +39 -0
- package/src/core/ScopeTracker.ts +23 -0
- package/src/core/SemanticId.ts +183 -0
- package/src/core/WorkerPool.ts +2 -1
- 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 +12 -0
- package/src/core/nodes/PluginNode.ts +144 -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 +47 -4
- package/src/core/nodes/TypeParameterNode.ts +91 -0
- package/src/core/nodes/index.ts +61 -0
- package/src/core/toposort.ts +160 -0
- package/src/diagnostics/DiagnosticCollector.ts +8 -1
- package/src/diagnostics/DiagnosticReporter.ts +87 -16
- package/src/diagnostics/categories.ts +104 -0
- package/src/diagnostics/index.ts +14 -0
- package/src/errors/GrafemaError.ts +58 -0
- package/src/index.ts +113 -13
- package/src/instructions/index.ts +21 -0
- package/src/instructions/onboarding.md +121 -0
- package/src/logging/Logger.ts +155 -4
- package/src/plugins/InfraAnalyzer.ts +208 -0
- package/src/plugins/analysis/DatabaseAnalyzer.ts +45 -28
- package/src/plugins/analysis/ExpressAnalyzer.ts +74 -49
- package/src/plugins/analysis/ExpressResponseAnalyzer.ts +77 -90
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +94 -79
- package/src/plugins/analysis/FetchAnalyzer.ts +200 -158
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +9 -9
- package/src/plugins/analysis/JSASTAnalyzer.ts +969 -2247
- package/src/plugins/analysis/NestJSRouteAnalyzer.ts +241 -0
- package/src/plugins/analysis/ReactAnalyzer.ts +52 -1097
- package/src/plugins/analysis/RustAnalyzer.ts +144 -134
- package/src/plugins/analysis/SQLiteAnalyzer.ts +39 -15
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +64 -38
- package/src/plugins/analysis/SocketAnalyzer.ts +601 -0
- package/src/plugins/analysis/SocketIOAnalyzer.ts +49 -43
- package/src/plugins/analysis/SystemDbAnalyzer.ts +35 -21
- package/src/plugins/analysis/ast/CollisionResolver.ts +137 -0
- package/src/plugins/analysis/ast/ExpressionEvaluator.ts +1 -3
- package/src/plugins/analysis/ast/FunctionBodyContext.ts +291 -0
- package/src/plugins/analysis/ast/GraphBuilder.ts +275 -2715
- 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 +259 -2
- package/src/plugins/analysis/ast/utils/babelTraverse.ts +74 -0
- package/src/plugins/analysis/ast/utils/createParameterNodes.ts +119 -14
- 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/ASTVisitor.ts +7 -2
- 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 +449 -1250
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +285 -8
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +48 -12
- 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 +407 -0
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +234 -16
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +9 -38
- 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/ast/visitors/index.ts +2 -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/DiscoveryPlugin.ts +42 -11
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +8 -16
- package/src/plugins/discovery/SimpleProjectDiscovery.ts +2 -2
- package/src/plugins/discovery/WorkspaceDiscovery.ts +2 -2
- package/src/plugins/discovery/workspaces/globResolver.ts +1 -1
- package/src/plugins/enrichment/AliasTracker.ts +4 -2
- package/src/plugins/enrichment/ArgumentParameterLinker.ts +3 -2
- package/src/plugins/enrichment/CallbackCallResolver.ts +398 -0
- package/src/plugins/enrichment/ClosureCaptureEnricher.ts +3 -2
- package/src/plugins/enrichment/ConfigRoutingMapBuilder.ts +67 -0
- package/src/plugins/enrichment/ExpressHandlerLinker.ts +180 -0
- package/src/plugins/enrichment/ExternalCallResolver.ts +5 -9
- package/src/plugins/enrichment/FunctionCallResolver.ts +16 -24
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +68 -15
- package/src/plugins/enrichment/ImportExportLinker.ts +5 -4
- package/src/plugins/enrichment/InstanceOfResolver.ts +4 -2
- package/src/plugins/enrichment/MethodCallResolver.ts +138 -235
- package/src/plugins/enrichment/MountPointResolver.ts +15 -26
- package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +14 -20
- package/src/plugins/enrichment/PrefixEvaluator.ts +10 -6
- package/src/plugins/enrichment/RejectionPropagationEnricher.ts +255 -0
- package/src/plugins/enrichment/RustFFIEnricher.ts +3 -2
- package/src/plugins/enrichment/ServiceConnectionEnricher.ts +472 -0
- package/src/plugins/enrichment/SocketConnectionEnricher.ts +228 -0
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +5 -3
- 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 +29 -40
- package/src/plugins/indexing/JSModuleIndexer.ts +34 -36
- package/src/plugins/indexing/RustModuleIndexer.ts +24 -18
- package/src/plugins/validation/AwaitInLoopValidator.ts +91 -0
- package/src/plugins/validation/BrokenImportValidator.ts +2 -3
- package/src/plugins/validation/CallResolverValidator.ts +2 -3
- package/src/plugins/validation/DataFlowValidator.ts +1 -1
- package/src/plugins/validation/EvalBanValidator.ts +1 -1
- package/src/plugins/validation/GraphConnectivityValidator.ts +1 -9
- package/src/plugins/validation/PackageCoverageValidator.ts +181 -0
- package/src/plugins/validation/SQLInjectionValidator.ts +3 -2
- package/src/plugins/validation/ShadowingDetector.ts +1 -1
- package/src/plugins/validation/TypeScriptDeadCodeValidator.ts +2 -3
- package/src/plugins/validation/UnconnectedRouteValidator.ts +93 -0
- package/src/plugins/vcs/GitPlugin.ts +12 -6
- package/src/queries/NodeContext.ts +277 -0
- package/src/queries/findCallsInFunction.ts +15 -6
- package/src/queries/findContainingFunction.ts +15 -4
- package/src/queries/index.ts +13 -0
- package/src/queries/traceValues.ts +0 -1
- package/src/resources/InfraResourceMapImpl.ts +119 -0
- package/src/resources/RoutingMapImpl.ts +133 -0
- package/src/storage/backends/RFDBServerBackend.ts +157 -38
- package/src/storage/backends/typeValidation.ts +2 -0
- package/src/utils/findRfdbBinary.ts +22 -7
- package/src/utils/moduleResolution.ts +271 -0
- package/src/utils/resolveNodeFile.ts +18 -0
- package/src/validation/PathValidator.ts +0 -8
- package/src/version.ts +28 -0
- package/src/plugins/validation/NodeCreationValidator.ts +0 -554
|
@@ -8,643 +8,68 @@
|
|
|
8
8
|
* - Constructor calls: new Foo(), new Function()
|
|
9
9
|
*/
|
|
10
10
|
import { ASTVisitor } from './ASTVisitor.js';
|
|
11
|
-
import {
|
|
12
|
-
import { computeSemanticId } from '../../../../core/SemanticId.js';
|
|
11
|
+
import { MutationDetector } from './MutationDetector.js';
|
|
13
12
|
import { IdGenerator } from '../IdGenerator.js';
|
|
14
|
-
import {
|
|
15
|
-
import { ObjectLiteralNode } from '../../../../core/nodes/ObjectLiteralNode.js';
|
|
16
|
-
import { ArrayLiteralNode } from '../../../../core/nodes/ArrayLiteralNode.js';
|
|
13
|
+
import { ExpressionEvaluator } from '../ExpressionEvaluator.js';
|
|
17
14
|
import { getLine, getColumn } from '../utils/location.js';
|
|
15
|
+
import { getGrafemaIgnore } from './call-expression-helpers.js';
|
|
16
|
+
import { ArgumentExtractor } from './ArgumentExtractor.js';
|
|
17
|
+
/**
|
|
18
|
+
* Extract the first literal argument value from a CallExpression for content hash hints.
|
|
19
|
+
*/
|
|
20
|
+
function extractFirstLiteralArg(node) {
|
|
21
|
+
if (node.arguments.length === 0)
|
|
22
|
+
return undefined;
|
|
23
|
+
const firstArg = node.arguments[0];
|
|
24
|
+
if (!firstArg)
|
|
25
|
+
return undefined;
|
|
26
|
+
const actualArg = firstArg.type === 'SpreadElement' ? firstArg.argument : firstArg;
|
|
27
|
+
const literalValue = ExpressionEvaluator.extractLiteralValue(actualArg);
|
|
28
|
+
if (literalValue !== null) {
|
|
29
|
+
return String(literalValue);
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
18
33
|
export class CallExpressionVisitor extends ASTVisitor {
|
|
19
34
|
scopeTracker;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* @param collections - Must contain arrays and counter refs
|
|
23
|
-
* @param scopeTracker - Optional ScopeTracker for semantic ID generation
|
|
24
|
-
*/
|
|
25
|
-
constructor(module, collections, scopeTracker) {
|
|
35
|
+
sharedIdGenerator;
|
|
36
|
+
constructor(module, collections, scopeTracker, sharedIdGenerator) {
|
|
26
37
|
super(module, collections);
|
|
27
38
|
this.scopeTracker = scopeTracker;
|
|
39
|
+
this.sharedIdGenerator = sharedIdGenerator;
|
|
28
40
|
}
|
|
29
41
|
/**
|
|
30
|
-
* Extract
|
|
31
|
-
|
|
32
|
-
extractArguments(args, callId, module, callArguments, literals, literalCounterRef) {
|
|
33
|
-
args.forEach((arg, index) => {
|
|
34
|
-
const argInfo = {
|
|
35
|
-
callId,
|
|
36
|
-
argIndex: index,
|
|
37
|
-
file: module.file,
|
|
38
|
-
line: arg.loc?.start.line || 0,
|
|
39
|
-
column: arg.loc?.start.column || 0
|
|
40
|
-
};
|
|
41
|
-
// Check for spread: ...arg
|
|
42
|
-
let actualArg = arg;
|
|
43
|
-
if (arg.type === 'SpreadElement') {
|
|
44
|
-
argInfo.isSpread = true;
|
|
45
|
-
actualArg = arg.argument; // Get the actual argument
|
|
46
|
-
}
|
|
47
|
-
// Object literal - check BEFORE extractLiteralValue to handle object-typed args properly
|
|
48
|
-
if (actualArg.type === 'ObjectExpression') {
|
|
49
|
-
const objectExpr = actualArg;
|
|
50
|
-
// Initialize collections if not exist (must assign back to this.collections!)
|
|
51
|
-
if (!this.collections.objectLiteralCounterRef) {
|
|
52
|
-
this.collections.objectLiteralCounterRef = { value: 0 };
|
|
53
|
-
}
|
|
54
|
-
if (!this.collections.objectLiterals) {
|
|
55
|
-
this.collections.objectLiterals = [];
|
|
56
|
-
}
|
|
57
|
-
if (!this.collections.objectProperties) {
|
|
58
|
-
this.collections.objectProperties = [];
|
|
59
|
-
}
|
|
60
|
-
const objectLiteralCounterRef = this.collections.objectLiteralCounterRef;
|
|
61
|
-
// Use factory to create OBJECT_LITERAL node
|
|
62
|
-
const objectNode = ObjectLiteralNode.create(module.file, argInfo.line, argInfo.column, {
|
|
63
|
-
parentCallId: callId,
|
|
64
|
-
argIndex: index,
|
|
65
|
-
counter: objectLiteralCounterRef.value++
|
|
66
|
-
});
|
|
67
|
-
// Factory guarantees line is set, cast to ObjectLiteralInfo
|
|
68
|
-
this.collections.objectLiterals.push(objectNode);
|
|
69
|
-
const objectId = objectNode.id;
|
|
70
|
-
// Extract properties
|
|
71
|
-
this.extractObjectProperties(objectExpr, objectId, module, this.collections.objectProperties, this.collections.objectLiterals, objectLiteralCounterRef, literals, literalCounterRef);
|
|
72
|
-
argInfo.targetType = 'OBJECT_LITERAL';
|
|
73
|
-
argInfo.targetId = objectId;
|
|
74
|
-
}
|
|
75
|
-
// Array literal - check BEFORE extractLiteralValue to handle array-typed args properly
|
|
76
|
-
else if (actualArg.type === 'ArrayExpression') {
|
|
77
|
-
const arrayExpr = actualArg;
|
|
78
|
-
// Initialize collections if not exist (must assign back to this.collections!)
|
|
79
|
-
if (!this.collections.arrayLiteralCounterRef) {
|
|
80
|
-
this.collections.arrayLiteralCounterRef = { value: 0 };
|
|
81
|
-
}
|
|
82
|
-
if (!this.collections.arrayLiterals) {
|
|
83
|
-
this.collections.arrayLiterals = [];
|
|
84
|
-
}
|
|
85
|
-
if (!this.collections.arrayElements) {
|
|
86
|
-
this.collections.arrayElements = [];
|
|
87
|
-
}
|
|
88
|
-
if (!this.collections.objectLiteralCounterRef) {
|
|
89
|
-
this.collections.objectLiteralCounterRef = { value: 0 };
|
|
90
|
-
}
|
|
91
|
-
if (!this.collections.objectLiterals) {
|
|
92
|
-
this.collections.objectLiterals = [];
|
|
93
|
-
}
|
|
94
|
-
if (!this.collections.objectProperties) {
|
|
95
|
-
this.collections.objectProperties = [];
|
|
96
|
-
}
|
|
97
|
-
const arrayLiteralCounterRef = this.collections.arrayLiteralCounterRef;
|
|
98
|
-
// Use factory to create ARRAY_LITERAL node
|
|
99
|
-
const arrayNode = ArrayLiteralNode.create(module.file, argInfo.line, argInfo.column, {
|
|
100
|
-
parentCallId: callId,
|
|
101
|
-
argIndex: index,
|
|
102
|
-
counter: arrayLiteralCounterRef.value++
|
|
103
|
-
});
|
|
104
|
-
// Factory guarantees line is set, cast to ArrayLiteralInfo
|
|
105
|
-
this.collections.arrayLiterals.push(arrayNode);
|
|
106
|
-
const arrayId = arrayNode.id;
|
|
107
|
-
// Extract elements
|
|
108
|
-
this.extractArrayElements(arrayExpr, arrayId, module, this.collections.arrayElements, this.collections.arrayLiterals, arrayLiteralCounterRef, this.collections.objectLiterals, this.collections.objectLiteralCounterRef, this.collections.objectProperties, literals, literalCounterRef);
|
|
109
|
-
argInfo.targetType = 'ARRAY_LITERAL';
|
|
110
|
-
argInfo.targetId = arrayId;
|
|
111
|
-
}
|
|
112
|
-
// Literal value (primitives only - objects/arrays handled above)
|
|
113
|
-
else {
|
|
114
|
-
const literalValue = ExpressionEvaluator.extractLiteralValue(actualArg);
|
|
115
|
-
if (literalValue !== null) {
|
|
116
|
-
const literalId = `LITERAL#arg${index}#${module.file}#${argInfo.line}:${argInfo.column}:${literalCounterRef.value++}`;
|
|
117
|
-
literals.push({
|
|
118
|
-
id: literalId,
|
|
119
|
-
type: 'LITERAL',
|
|
120
|
-
value: literalValue,
|
|
121
|
-
valueType: typeof literalValue,
|
|
122
|
-
file: module.file,
|
|
123
|
-
line: argInfo.line,
|
|
124
|
-
column: argInfo.column,
|
|
125
|
-
parentCallId: callId,
|
|
126
|
-
argIndex: index
|
|
127
|
-
});
|
|
128
|
-
argInfo.targetType = 'LITERAL';
|
|
129
|
-
argInfo.targetId = literalId;
|
|
130
|
-
argInfo.literalValue = literalValue;
|
|
131
|
-
}
|
|
132
|
-
// Variable reference
|
|
133
|
-
else if (actualArg.type === 'Identifier') {
|
|
134
|
-
argInfo.targetType = 'VARIABLE';
|
|
135
|
-
argInfo.targetName = actualArg.name; // Will be resolved in GraphBuilder
|
|
136
|
-
}
|
|
137
|
-
// Function expression (callback)
|
|
138
|
-
else if (actualArg.type === 'ArrowFunctionExpression' || actualArg.type === 'FunctionExpression') {
|
|
139
|
-
argInfo.targetType = 'FUNCTION';
|
|
140
|
-
argInfo.functionLine = actualArg.loc?.start.line;
|
|
141
|
-
argInfo.functionColumn = actualArg.loc?.start.column;
|
|
142
|
-
}
|
|
143
|
-
// Call expression (nested call)
|
|
144
|
-
else if (actualArg.type === 'CallExpression') {
|
|
145
|
-
argInfo.targetType = 'CALL';
|
|
146
|
-
// Nested calls will be processed separately, link by position
|
|
147
|
-
argInfo.nestedCallLine = actualArg.loc?.start.line;
|
|
148
|
-
argInfo.nestedCallColumn = actualArg.loc?.start.column;
|
|
149
|
-
}
|
|
150
|
-
// Member expression: obj.prop or obj[x]
|
|
151
|
-
else if (actualArg.type === 'MemberExpression') {
|
|
152
|
-
const memberExpr = actualArg;
|
|
153
|
-
argInfo.targetType = 'EXPRESSION';
|
|
154
|
-
argInfo.expressionType = 'MemberExpression';
|
|
155
|
-
if (memberExpr.object.type === 'Identifier') {
|
|
156
|
-
argInfo.objectName = memberExpr.object.name;
|
|
157
|
-
}
|
|
158
|
-
if (!memberExpr.computed && memberExpr.property.type === 'Identifier') {
|
|
159
|
-
argInfo.propertyName = memberExpr.property.name;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
// Binary/Logical expression: a + b, a && b
|
|
163
|
-
else if (actualArg.type === 'BinaryExpression' || actualArg.type === 'LogicalExpression') {
|
|
164
|
-
const expr = actualArg;
|
|
165
|
-
const operator = expr.operator || '?';
|
|
166
|
-
const counter = literalCounterRef.value++;
|
|
167
|
-
// Create EXPRESSION node via NodeFactory
|
|
168
|
-
const expressionNode = NodeFactory.createArgumentExpression(actualArg.type, module.file, argInfo.line, argInfo.column, {
|
|
169
|
-
parentCallId: callId,
|
|
170
|
-
argIndex: index,
|
|
171
|
-
operator,
|
|
172
|
-
counter
|
|
173
|
-
});
|
|
174
|
-
literals.push(expressionNode);
|
|
175
|
-
argInfo.targetType = 'EXPRESSION';
|
|
176
|
-
argInfo.targetId = expressionNode.id;
|
|
177
|
-
argInfo.expressionType = actualArg.type;
|
|
178
|
-
// Track DERIVES_FROM edges for identifiers in expression
|
|
179
|
-
const identifiers = this.extractIdentifiers(actualArg);
|
|
180
|
-
const { variableAssignments } = this.collections;
|
|
181
|
-
if (variableAssignments) {
|
|
182
|
-
for (const identName of identifiers) {
|
|
183
|
-
variableAssignments.push({
|
|
184
|
-
variableId: expressionNode.id,
|
|
185
|
-
sourceId: null,
|
|
186
|
-
sourceName: identName,
|
|
187
|
-
sourceType: 'DERIVES_FROM_VARIABLE',
|
|
188
|
-
file: module.file
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
// Other expression types (fallback for unhandled expression types)
|
|
194
|
-
else {
|
|
195
|
-
argInfo.targetType = 'EXPRESSION';
|
|
196
|
-
argInfo.expressionType = actualArg.type;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
callArguments.push(argInfo);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Extract all Identifier names from an expression (recursively)
|
|
204
|
-
* Used for BinaryExpression/LogicalExpression to track DERIVES_FROM edges
|
|
205
|
-
*/
|
|
206
|
-
extractIdentifiers(node, identifiers = new Set()) {
|
|
207
|
-
if (!node)
|
|
208
|
-
return Array.from(identifiers);
|
|
209
|
-
if (node.type === 'Identifier') {
|
|
210
|
-
identifiers.add(node.name);
|
|
211
|
-
}
|
|
212
|
-
else if (node.type === 'BinaryExpression' || node.type === 'LogicalExpression') {
|
|
213
|
-
const expr = node;
|
|
214
|
-
this.extractIdentifiers(expr.left, identifiers);
|
|
215
|
-
this.extractIdentifiers(expr.right, identifiers);
|
|
216
|
-
}
|
|
217
|
-
else if (node.type === 'UnaryExpression') {
|
|
218
|
-
const expr = node;
|
|
219
|
-
this.extractIdentifiers(expr.argument, identifiers);
|
|
220
|
-
}
|
|
221
|
-
else if (node.type === 'ConditionalExpression') {
|
|
222
|
-
const expr = node;
|
|
223
|
-
this.extractIdentifiers(expr.test, identifiers);
|
|
224
|
-
this.extractIdentifiers(expr.consequent, identifiers);
|
|
225
|
-
this.extractIdentifiers(expr.alternate, identifiers);
|
|
226
|
-
}
|
|
227
|
-
else if (node.type === 'MemberExpression') {
|
|
228
|
-
const memberExpr = node;
|
|
229
|
-
// For obj.prop - track obj (but not prop as it's a property name)
|
|
230
|
-
if (memberExpr.object.type === 'Identifier') {
|
|
231
|
-
identifiers.add(memberExpr.object.name);
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
this.extractIdentifiers(memberExpr.object, identifiers);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
else if (node.type === 'CallExpression') {
|
|
238
|
-
const callExpr = node;
|
|
239
|
-
// For func() - track func if identifier, and all arguments
|
|
240
|
-
if (callExpr.callee.type === 'Identifier') {
|
|
241
|
-
identifiers.add(callExpr.callee.name);
|
|
242
|
-
}
|
|
243
|
-
for (const arg of callExpr.arguments) {
|
|
244
|
-
if (arg.type !== 'SpreadElement') {
|
|
245
|
-
this.extractIdentifiers(arg, identifiers);
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
this.extractIdentifiers(arg.argument, identifiers);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
return Array.from(identifiers);
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Extract object properties and create ObjectPropertyInfo records
|
|
256
|
-
*/
|
|
257
|
-
extractObjectProperties(objectExpr, objectId, module, objectProperties, objectLiterals, objectLiteralCounterRef, literals, literalCounterRef) {
|
|
258
|
-
for (const prop of objectExpr.properties) {
|
|
259
|
-
const propLine = prop.loc?.start.line || 0;
|
|
260
|
-
const propColumn = prop.loc?.start.column || 0;
|
|
261
|
-
// Handle spread properties: { ...other }
|
|
262
|
-
if (prop.type === 'SpreadElement') {
|
|
263
|
-
const spreadArg = prop.argument;
|
|
264
|
-
const propertyInfo = {
|
|
265
|
-
objectId,
|
|
266
|
-
propertyName: '<spread>',
|
|
267
|
-
valueType: 'SPREAD',
|
|
268
|
-
file: module.file,
|
|
269
|
-
line: propLine,
|
|
270
|
-
column: propColumn
|
|
271
|
-
};
|
|
272
|
-
if (spreadArg.type === 'Identifier') {
|
|
273
|
-
propertyInfo.valueName = spreadArg.name;
|
|
274
|
-
propertyInfo.valueType = 'VARIABLE';
|
|
275
|
-
// REG-329: Capture scope path for spread variable resolution
|
|
276
|
-
propertyInfo.valueScopePath = this.scopeTracker?.getContext().scopePath ?? [];
|
|
277
|
-
}
|
|
278
|
-
objectProperties.push(propertyInfo);
|
|
279
|
-
continue;
|
|
280
|
-
}
|
|
281
|
-
// Handle regular properties
|
|
282
|
-
if (prop.type === 'ObjectProperty') {
|
|
283
|
-
const objProp = prop;
|
|
284
|
-
let propertyName;
|
|
285
|
-
// Get property name
|
|
286
|
-
if (objProp.key.type === 'Identifier') {
|
|
287
|
-
propertyName = objProp.key.name;
|
|
288
|
-
}
|
|
289
|
-
else if (objProp.key.type === 'StringLiteral') {
|
|
290
|
-
propertyName = objProp.key.value;
|
|
291
|
-
}
|
|
292
|
-
else if (objProp.key.type === 'NumericLiteral') {
|
|
293
|
-
propertyName = String(objProp.key.value);
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
propertyName = '<computed>';
|
|
297
|
-
}
|
|
298
|
-
const propertyInfo = {
|
|
299
|
-
objectId,
|
|
300
|
-
propertyName,
|
|
301
|
-
file: module.file,
|
|
302
|
-
line: propLine,
|
|
303
|
-
column: propColumn,
|
|
304
|
-
valueType: 'EXPRESSION'
|
|
305
|
-
};
|
|
306
|
-
const value = objProp.value;
|
|
307
|
-
// Nested object literal - check BEFORE extractLiteralValue
|
|
308
|
-
if (value.type === 'ObjectExpression') {
|
|
309
|
-
// Use factory - do NOT pass argIndex for nested literals (uses 'obj' suffix)
|
|
310
|
-
const nestedObjectNode = ObjectLiteralNode.create(module.file, value.loc?.start.line || 0, value.loc?.start.column || 0, {
|
|
311
|
-
counter: objectLiteralCounterRef.value++
|
|
312
|
-
});
|
|
313
|
-
objectLiterals.push(nestedObjectNode);
|
|
314
|
-
const nestedObjectId = nestedObjectNode.id;
|
|
315
|
-
// Recursively extract nested properties
|
|
316
|
-
this.extractObjectProperties(value, nestedObjectId, module, objectProperties, objectLiterals, objectLiteralCounterRef, literals, literalCounterRef);
|
|
317
|
-
propertyInfo.valueType = 'OBJECT_LITERAL';
|
|
318
|
-
propertyInfo.nestedObjectId = nestedObjectId;
|
|
319
|
-
propertyInfo.valueNodeId = nestedObjectId;
|
|
320
|
-
}
|
|
321
|
-
// Nested array literal - check BEFORE extractLiteralValue
|
|
322
|
-
else if (value.type === 'ArrayExpression') {
|
|
323
|
-
const arrayLiteralCounterRef = (this.collections.arrayLiteralCounterRef ?? { value: 0 });
|
|
324
|
-
const arrayLiterals = this.collections.arrayLiterals ?? [];
|
|
325
|
-
const arrayElements = this.collections.arrayElements ?? [];
|
|
326
|
-
// Use factory - do NOT pass argIndex for nested literals (uses 'arr' suffix)
|
|
327
|
-
const nestedArrayNode = ArrayLiteralNode.create(module.file, value.loc?.start.line || 0, value.loc?.start.column || 0, {
|
|
328
|
-
counter: arrayLiteralCounterRef.value++
|
|
329
|
-
});
|
|
330
|
-
arrayLiterals.push(nestedArrayNode);
|
|
331
|
-
const nestedArrayId = nestedArrayNode.id;
|
|
332
|
-
// Recursively extract array elements
|
|
333
|
-
this.extractArrayElements(value, nestedArrayId, module, arrayElements, arrayLiterals, arrayLiteralCounterRef, objectLiterals, objectLiteralCounterRef, objectProperties, literals, literalCounterRef);
|
|
334
|
-
propertyInfo.valueType = 'ARRAY_LITERAL';
|
|
335
|
-
propertyInfo.nestedArrayId = nestedArrayId;
|
|
336
|
-
propertyInfo.valueNodeId = nestedArrayId;
|
|
337
|
-
}
|
|
338
|
-
// Literal value (primitives only - objects/arrays handled above)
|
|
339
|
-
else {
|
|
340
|
-
const literalValue = ExpressionEvaluator.extractLiteralValue(value);
|
|
341
|
-
// Handle both non-null literals AND explicit null literals (NullLiteral)
|
|
342
|
-
if (literalValue !== null || value.type === 'NullLiteral') {
|
|
343
|
-
const literalId = `LITERAL#${propertyName}#${module.file}#${propLine}:${propColumn}:${literalCounterRef.value++}`;
|
|
344
|
-
literals.push({
|
|
345
|
-
id: literalId,
|
|
346
|
-
type: 'LITERAL',
|
|
347
|
-
value: literalValue,
|
|
348
|
-
valueType: typeof literalValue,
|
|
349
|
-
file: module.file,
|
|
350
|
-
line: propLine,
|
|
351
|
-
column: propColumn,
|
|
352
|
-
parentCallId: objectId,
|
|
353
|
-
argIndex: 0
|
|
354
|
-
});
|
|
355
|
-
propertyInfo.valueType = 'LITERAL';
|
|
356
|
-
propertyInfo.valueNodeId = literalId;
|
|
357
|
-
propertyInfo.literalValue = literalValue;
|
|
358
|
-
}
|
|
359
|
-
// Variable reference
|
|
360
|
-
else if (value.type === 'Identifier') {
|
|
361
|
-
propertyInfo.valueType = 'VARIABLE';
|
|
362
|
-
propertyInfo.valueName = value.name;
|
|
363
|
-
// REG-329: Capture scope path for scope-aware variable resolution
|
|
364
|
-
propertyInfo.valueScopePath = this.scopeTracker?.getContext().scopePath ?? [];
|
|
365
|
-
}
|
|
366
|
-
// Call expression
|
|
367
|
-
else if (value.type === 'CallExpression') {
|
|
368
|
-
propertyInfo.valueType = 'CALL';
|
|
369
|
-
propertyInfo.callLine = value.loc?.start.line;
|
|
370
|
-
propertyInfo.callColumn = value.loc?.start.column;
|
|
371
|
-
}
|
|
372
|
-
// Other expressions
|
|
373
|
-
else {
|
|
374
|
-
propertyInfo.valueType = 'EXPRESSION';
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
objectProperties.push(propertyInfo);
|
|
378
|
-
}
|
|
379
|
-
// Handle object methods: { foo() {} }
|
|
380
|
-
else if (prop.type === 'ObjectMethod') {
|
|
381
|
-
const propertyName = prop.key.type === 'Identifier' ? prop.key.name : '<computed>';
|
|
382
|
-
objectProperties.push({
|
|
383
|
-
objectId,
|
|
384
|
-
propertyName,
|
|
385
|
-
valueType: 'EXPRESSION',
|
|
386
|
-
file: module.file,
|
|
387
|
-
line: propLine,
|
|
388
|
-
column: propColumn
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Extract array elements and create ArrayElementInfo records
|
|
395
|
-
*/
|
|
396
|
-
extractArrayElements(arrayExpr, arrayId, module, arrayElements, arrayLiterals, arrayLiteralCounterRef, objectLiterals, objectLiteralCounterRef, objectProperties, literals, literalCounterRef) {
|
|
397
|
-
arrayExpr.elements.forEach((element, index) => {
|
|
398
|
-
if (!element)
|
|
399
|
-
return; // Skip holes in arrays
|
|
400
|
-
const elemLine = element.loc?.start.line || 0;
|
|
401
|
-
const elemColumn = element.loc?.start.column || 0;
|
|
402
|
-
const elementInfo = {
|
|
403
|
-
arrayId,
|
|
404
|
-
index,
|
|
405
|
-
file: module.file,
|
|
406
|
-
line: elemLine,
|
|
407
|
-
column: elemColumn,
|
|
408
|
-
valueType: 'EXPRESSION'
|
|
409
|
-
};
|
|
410
|
-
// Handle spread elements: [...arr]
|
|
411
|
-
if (element.type === 'SpreadElement') {
|
|
412
|
-
const spreadArg = element.argument;
|
|
413
|
-
elementInfo.valueType = 'SPREAD';
|
|
414
|
-
if (spreadArg.type === 'Identifier') {
|
|
415
|
-
elementInfo.valueName = spreadArg.name;
|
|
416
|
-
}
|
|
417
|
-
arrayElements.push(elementInfo);
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
// Nested object literal - check BEFORE extractLiteralValue
|
|
421
|
-
if (element.type === 'ObjectExpression') {
|
|
422
|
-
// Use factory - do NOT pass argIndex for nested literals (uses 'obj' suffix)
|
|
423
|
-
const nestedObjectNode = ObjectLiteralNode.create(module.file, elemLine, elemColumn, {
|
|
424
|
-
counter: objectLiteralCounterRef.value++
|
|
425
|
-
});
|
|
426
|
-
objectLiterals.push(nestedObjectNode);
|
|
427
|
-
const nestedObjectId = nestedObjectNode.id;
|
|
428
|
-
// Recursively extract properties
|
|
429
|
-
this.extractObjectProperties(element, nestedObjectId, module, objectProperties, objectLiterals, objectLiteralCounterRef, literals, literalCounterRef);
|
|
430
|
-
elementInfo.valueType = 'OBJECT_LITERAL';
|
|
431
|
-
elementInfo.nestedObjectId = nestedObjectId;
|
|
432
|
-
elementInfo.valueNodeId = nestedObjectId;
|
|
433
|
-
}
|
|
434
|
-
// Nested array literal - check BEFORE extractLiteralValue
|
|
435
|
-
else if (element.type === 'ArrayExpression') {
|
|
436
|
-
// Use factory - do NOT pass argIndex for nested literals (uses 'arr' suffix)
|
|
437
|
-
const nestedArrayNode = ArrayLiteralNode.create(module.file, elemLine, elemColumn, {
|
|
438
|
-
counter: arrayLiteralCounterRef.value++
|
|
439
|
-
});
|
|
440
|
-
arrayLiterals.push(nestedArrayNode);
|
|
441
|
-
const nestedArrayId = nestedArrayNode.id;
|
|
442
|
-
// Recursively extract elements
|
|
443
|
-
this.extractArrayElements(element, nestedArrayId, module, arrayElements, arrayLiterals, arrayLiteralCounterRef, objectLiterals, objectLiteralCounterRef, objectProperties, literals, literalCounterRef);
|
|
444
|
-
elementInfo.valueType = 'ARRAY_LITERAL';
|
|
445
|
-
elementInfo.nestedArrayId = nestedArrayId;
|
|
446
|
-
elementInfo.valueNodeId = nestedArrayId;
|
|
447
|
-
}
|
|
448
|
-
// Literal value (primitives only - objects/arrays handled above)
|
|
449
|
-
else {
|
|
450
|
-
const literalValue = ExpressionEvaluator.extractLiteralValue(element);
|
|
451
|
-
if (literalValue !== null) {
|
|
452
|
-
const literalId = `LITERAL#elem${index}#${module.file}#${elemLine}:${elemColumn}:${literalCounterRef.value++}`;
|
|
453
|
-
literals.push({
|
|
454
|
-
id: literalId,
|
|
455
|
-
type: 'LITERAL',
|
|
456
|
-
value: literalValue,
|
|
457
|
-
valueType: typeof literalValue,
|
|
458
|
-
file: module.file,
|
|
459
|
-
line: elemLine,
|
|
460
|
-
column: elemColumn,
|
|
461
|
-
parentCallId: arrayId,
|
|
462
|
-
argIndex: index
|
|
463
|
-
});
|
|
464
|
-
elementInfo.valueType = 'LITERAL';
|
|
465
|
-
elementInfo.valueNodeId = literalId;
|
|
466
|
-
elementInfo.literalValue = literalValue;
|
|
467
|
-
}
|
|
468
|
-
// Variable reference
|
|
469
|
-
else if (element.type === 'Identifier') {
|
|
470
|
-
elementInfo.valueType = 'VARIABLE';
|
|
471
|
-
elementInfo.valueName = element.name;
|
|
472
|
-
}
|
|
473
|
-
// Call expression
|
|
474
|
-
else if (element.type === 'CallExpression') {
|
|
475
|
-
elementInfo.valueType = 'CALL';
|
|
476
|
-
elementInfo.callLine = element.loc?.start.line;
|
|
477
|
-
elementInfo.callColumn = element.loc?.start.column;
|
|
478
|
-
}
|
|
479
|
-
// Other expressions
|
|
480
|
-
else {
|
|
481
|
-
elementInfo.valueType = 'EXPRESSION';
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
arrayElements.push(elementInfo);
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Detect array mutation calls (push, unshift, splice) and collect mutation info
|
|
489
|
-
* for later FLOWS_INTO edge creation in GraphBuilder
|
|
42
|
+
* Extract full dotted name from a MemberExpression chain.
|
|
43
|
+
* For `a.b.c` returns "a.b.c". Returns null for complex expressions.
|
|
490
44
|
*
|
|
491
|
-
* REG-
|
|
45
|
+
* Used by REG-395 to create CALL nodes for nested method calls like a.b.c().
|
|
492
46
|
*/
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
return;
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
actualArg = arg.argument;
|
|
514
|
-
}
|
|
515
|
-
// Determine value type
|
|
516
|
-
const literalValue = ExpressionEvaluator.extractLiteralValue(actualArg);
|
|
517
|
-
if (literalValue !== null) {
|
|
518
|
-
argInfo.valueType = 'LITERAL';
|
|
519
|
-
argInfo.literalValue = literalValue;
|
|
520
|
-
}
|
|
521
|
-
else if (actualArg.type === 'Identifier') {
|
|
522
|
-
argInfo.valueType = 'VARIABLE';
|
|
523
|
-
argInfo.valueName = actualArg.name;
|
|
524
|
-
}
|
|
525
|
-
else if (actualArg.type === 'ObjectExpression') {
|
|
526
|
-
argInfo.valueType = 'OBJECT_LITERAL';
|
|
527
|
-
}
|
|
528
|
-
else if (actualArg.type === 'ArrayExpression') {
|
|
529
|
-
argInfo.valueType = 'ARRAY_LITERAL';
|
|
530
|
-
}
|
|
531
|
-
else if (actualArg.type === 'CallExpression') {
|
|
532
|
-
argInfo.valueType = 'CALL';
|
|
533
|
-
argInfo.callLine = actualArg.loc?.start.line;
|
|
534
|
-
argInfo.callColumn = actualArg.loc?.start.column;
|
|
535
|
-
}
|
|
536
|
-
mutationArgs.push(argInfo);
|
|
537
|
-
});
|
|
538
|
-
// Only record if there are actual insertions
|
|
539
|
-
if (mutationArgs.length > 0) {
|
|
540
|
-
const line = callNode.loc?.start.line ?? 0;
|
|
541
|
-
const column = callNode.loc?.start.column ?? 0;
|
|
542
|
-
// Generate semantic ID for array mutation if scopeTracker available
|
|
543
|
-
const scopeTracker = this.scopeTracker;
|
|
544
|
-
let mutationId;
|
|
545
|
-
// Capture scope path for scope-aware lookup (REG-309)
|
|
546
|
-
const scopePath = scopeTracker?.getContext().scopePath ?? [];
|
|
547
|
-
if (scopeTracker) {
|
|
548
|
-
const discriminator = scopeTracker.getItemCounter(`ARRAY_MUTATION:${arrayName}.${method}`);
|
|
549
|
-
mutationId = computeSemanticId('ARRAY_MUTATION', `${arrayName}.${method}`, scopeTracker.getContext(), { discriminator });
|
|
550
|
-
}
|
|
551
|
-
arrayMutations.push({
|
|
552
|
-
id: mutationId,
|
|
553
|
-
arrayName,
|
|
554
|
-
mutationScopePath: scopePath,
|
|
555
|
-
mutationMethod: method,
|
|
556
|
-
file: module.file,
|
|
557
|
-
line,
|
|
558
|
-
column,
|
|
559
|
-
insertedValues: mutationArgs,
|
|
560
|
-
// REG-117: Nested mutation fields
|
|
561
|
-
isNested,
|
|
562
|
-
baseObjectName,
|
|
563
|
-
propertyName
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* Detect Object.assign(target, source1, source2, ...) calls
|
|
569
|
-
* Creates ObjectMutationInfo for FLOWS_INTO edge generation in GraphBuilder
|
|
570
|
-
*
|
|
571
|
-
* @param callNode - The call expression node
|
|
572
|
-
* @param module - Current module being analyzed
|
|
573
|
-
*/
|
|
574
|
-
detectObjectAssign(callNode, module) {
|
|
575
|
-
// Need at least 2 arguments: target and at least one source
|
|
576
|
-
if (callNode.arguments.length < 2)
|
|
577
|
-
return;
|
|
578
|
-
// Initialize object mutations collection if not exists
|
|
579
|
-
if (!this.collections.objectMutations) {
|
|
580
|
-
this.collections.objectMutations = [];
|
|
581
|
-
}
|
|
582
|
-
const objectMutations = this.collections.objectMutations;
|
|
583
|
-
// First argument is target
|
|
584
|
-
const targetArg = callNode.arguments[0];
|
|
585
|
-
let targetName;
|
|
586
|
-
if (targetArg.type === 'Identifier') {
|
|
587
|
-
targetName = targetArg.name;
|
|
588
|
-
}
|
|
589
|
-
else if (targetArg.type === 'ObjectExpression') {
|
|
590
|
-
targetName = '<anonymous>';
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
const line = callNode.loc?.start.line ?? 0;
|
|
596
|
-
const column = callNode.loc?.start.column ?? 0;
|
|
597
|
-
for (let i = 1; i < callNode.arguments.length; i++) {
|
|
598
|
-
let arg = callNode.arguments[i];
|
|
599
|
-
let isSpread = false;
|
|
600
|
-
if (arg.type === 'SpreadElement') {
|
|
601
|
-
isSpread = true;
|
|
602
|
-
arg = arg.argument;
|
|
603
|
-
}
|
|
604
|
-
const valueInfo = {
|
|
605
|
-
valueType: 'EXPRESSION',
|
|
606
|
-
argIndex: i - 1,
|
|
607
|
-
isSpread
|
|
608
|
-
};
|
|
609
|
-
const literalValue = ExpressionEvaluator.extractLiteralValue(arg);
|
|
610
|
-
if (literalValue !== null) {
|
|
611
|
-
valueInfo.valueType = 'LITERAL';
|
|
612
|
-
valueInfo.literalValue = literalValue;
|
|
613
|
-
}
|
|
614
|
-
else if (arg.type === 'Identifier') {
|
|
615
|
-
valueInfo.valueType = 'VARIABLE';
|
|
616
|
-
valueInfo.valueName = arg.name;
|
|
617
|
-
}
|
|
618
|
-
else if (arg.type === 'ObjectExpression') {
|
|
619
|
-
valueInfo.valueType = 'OBJECT_LITERAL';
|
|
620
|
-
}
|
|
621
|
-
else if (arg.type === 'ArrayExpression') {
|
|
622
|
-
valueInfo.valueType = 'ARRAY_LITERAL';
|
|
623
|
-
}
|
|
624
|
-
else if (arg.type === 'CallExpression') {
|
|
625
|
-
valueInfo.valueType = 'CALL';
|
|
626
|
-
valueInfo.callLine = arg.loc?.start.line;
|
|
627
|
-
valueInfo.callColumn = arg.loc?.start.column;
|
|
47
|
+
static extractMemberExpressionName(node) {
|
|
48
|
+
const parts = [];
|
|
49
|
+
let current = node;
|
|
50
|
+
// Walk the chain collecting property names
|
|
51
|
+
while (current) {
|
|
52
|
+
if (current.computed)
|
|
53
|
+
return null; // Can't statically resolve computed access
|
|
54
|
+
if (current.property.type !== 'Identifier')
|
|
55
|
+
return null;
|
|
56
|
+
parts.unshift(current.property.name);
|
|
57
|
+
if (current.object.type === 'Identifier') {
|
|
58
|
+
parts.unshift(current.object.name);
|
|
59
|
+
return parts.join('.');
|
|
60
|
+
}
|
|
61
|
+
else if (current.object.type === 'ThisExpression') {
|
|
62
|
+
parts.unshift('this');
|
|
63
|
+
return parts.join('.');
|
|
64
|
+
}
|
|
65
|
+
else if (current.object.type === 'MemberExpression') {
|
|
66
|
+
current = current.object;
|
|
628
67
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
let mutationId;
|
|
632
|
-
if (this.scopeTracker) {
|
|
633
|
-
const discriminator = this.scopeTracker.getItemCounter(`OBJECT_MUTATION:Object.assign:${targetName}`);
|
|
634
|
-
mutationId = computeSemanticId('OBJECT_MUTATION', `Object.assign:${targetName}`, this.scopeTracker.getContext(), { discriminator });
|
|
68
|
+
else {
|
|
69
|
+
return null; // Complex expression
|
|
635
70
|
}
|
|
636
|
-
objectMutations.push({
|
|
637
|
-
id: mutationId,
|
|
638
|
-
objectName: targetName,
|
|
639
|
-
mutationScopePath: scopePath,
|
|
640
|
-
propertyName: '<assign>',
|
|
641
|
-
mutationType: 'assign',
|
|
642
|
-
file: module.file,
|
|
643
|
-
line,
|
|
644
|
-
column,
|
|
645
|
-
value: valueInfo
|
|
646
|
-
});
|
|
647
71
|
}
|
|
72
|
+
return null;
|
|
648
73
|
}
|
|
649
74
|
/**
|
|
650
75
|
* Get a stable scope ID for a function parent.
|
|
@@ -694,233 +119,306 @@ export class CallExpressionVisitor extends ASTVisitor {
|
|
|
694
119
|
return `${module.file}->${scopePath.join('->')}->FUNCTION->${funcName}`;
|
|
695
120
|
}
|
|
696
121
|
getHandlers() {
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
122
|
+
const s = {
|
|
123
|
+
module: this.module,
|
|
124
|
+
callSites: (this.collections.callSites ?? []),
|
|
125
|
+
methodCalls: (this.collections.methodCalls ?? []),
|
|
126
|
+
eventListeners: (this.collections.eventListeners ?? []),
|
|
127
|
+
methodCallbacks: (this.collections.methodCallbacks ?? []),
|
|
128
|
+
literals: (this.collections.literals ?? []),
|
|
129
|
+
callArguments: (this.collections.callArguments ?? []),
|
|
130
|
+
callSiteCounterRef: (this.collections.callSiteCounterRef ?? { value: 0 }),
|
|
131
|
+
literalCounterRef: (this.collections.literalCounterRef ?? { value: 0 }),
|
|
132
|
+
processedNodes: this.collections.processedNodes ?? { callSites: new Set(), methodCalls: new Set(), eventListeners: new Set() },
|
|
133
|
+
scopeTracker: this.scopeTracker,
|
|
134
|
+
};
|
|
708
135
|
return {
|
|
709
136
|
CallExpression: (path) => {
|
|
710
137
|
const callNode = path.node;
|
|
711
138
|
const functionParent = path.getFunctionParent();
|
|
712
|
-
//
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
139
|
+
// Skip if inside function - handled by analyzeFunctionBody
|
|
140
|
+
if (functionParent)
|
|
141
|
+
return;
|
|
142
|
+
const parentScopeId = s.module.id;
|
|
143
|
+
const isAwaited = path.parentPath?.isAwaitExpression() ?? false;
|
|
716
144
|
if (callNode.callee.type === 'Identifier') {
|
|
717
|
-
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
const callee = callNode.callee;
|
|
721
|
-
const line = getLine(callNode);
|
|
722
|
-
const column = getColumn(callNode);
|
|
723
|
-
// Generate ID using centralized IdGenerator
|
|
724
|
-
const idGenerator = new IdGenerator(scopeTracker);
|
|
725
|
-
const callId = idGenerator.generate('CALL', callee.name, module.file, line, column, callSiteCounterRef, { useDiscriminator: true, discriminatorKey: `CALL:${callee.name}` });
|
|
726
|
-
callSites.push({
|
|
727
|
-
id: callId,
|
|
728
|
-
type: 'CALL',
|
|
729
|
-
name: callee.name,
|
|
730
|
-
file: module.file,
|
|
731
|
-
line,
|
|
732
|
-
column,
|
|
733
|
-
parentScopeId,
|
|
734
|
-
targetFunctionName: callee.name
|
|
735
|
-
});
|
|
736
|
-
// Extract arguments for PASSES_ARGUMENT edges
|
|
737
|
-
if (callNode.arguments.length > 0) {
|
|
738
|
-
this.extractArguments(callNode.arguments, callId, module, callArguments, literals, literalCounterRef);
|
|
739
|
-
}
|
|
145
|
+
this.handleDirectCall(callNode, s, parentScopeId, isAwaited);
|
|
740
146
|
}
|
|
741
|
-
// MemberExpression calls (method calls)
|
|
742
|
-
// Skip if inside function - they will be processed by analyzeFunctionBody with proper scope tracking
|
|
743
147
|
else if (callNode.callee.type === 'MemberExpression') {
|
|
744
|
-
|
|
745
|
-
return;
|
|
746
|
-
}
|
|
747
|
-
const memberCallee = callNode.callee;
|
|
748
|
-
const object = memberCallee.object;
|
|
749
|
-
const property = memberCallee.property;
|
|
750
|
-
const isComputed = memberCallee.computed;
|
|
751
|
-
if ((object.type === 'Identifier' || object.type === 'ThisExpression') && property.type === 'Identifier') {
|
|
752
|
-
const objectName = object.type === 'Identifier' ? object.name : 'this';
|
|
753
|
-
// For computed access obj[x](), methodName is '<computed>' but we save the variable name
|
|
754
|
-
const methodName = isComputed ? '<computed>' : property.name;
|
|
755
|
-
const computedPropertyVar = isComputed ? property.name : null;
|
|
756
|
-
// Special handling for .on() event handlers
|
|
757
|
-
if (methodName === 'on' && callNode.arguments.length >= 2) {
|
|
758
|
-
const firstArg = callNode.arguments[0];
|
|
759
|
-
const secondArg = callNode.arguments[1];
|
|
760
|
-
if (firstArg.type === 'StringLiteral') {
|
|
761
|
-
const eventName = firstArg.value;
|
|
762
|
-
// Dedup check
|
|
763
|
-
const nodeKey = `${callNode.start}:${callNode.end}`;
|
|
764
|
-
if (processedNodes.eventListeners.has(nodeKey)) {
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
processedNodes.eventListeners.add(nodeKey);
|
|
768
|
-
const eventLine = getLine(callNode);
|
|
769
|
-
const eventColumn = getColumn(callNode);
|
|
770
|
-
eventListeners.push({
|
|
771
|
-
id: `event:listener#${eventName}#${module.file}#${eventLine}:${eventColumn}:${callSiteCounterRef.value++}`,
|
|
772
|
-
type: 'event:listener',
|
|
773
|
-
name: eventName,
|
|
774
|
-
object: objectName,
|
|
775
|
-
file: module.file,
|
|
776
|
-
line: eventLine,
|
|
777
|
-
parentScopeId,
|
|
778
|
-
callbackArg: secondArg
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
else {
|
|
783
|
-
// Regular method call
|
|
784
|
-
const nodeKey = `${callNode.start}:${callNode.end}`;
|
|
785
|
-
if (processedNodes.methodCalls.has(nodeKey)) {
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
788
|
-
processedNodes.methodCalls.add(nodeKey);
|
|
789
|
-
const fullName = `${objectName}.${methodName}`;
|
|
790
|
-
const methodLine = getLine(callNode);
|
|
791
|
-
const methodColumn = getColumn(callNode);
|
|
792
|
-
// Generate ID using centralized IdGenerator
|
|
793
|
-
const idGenerator = new IdGenerator(scopeTracker);
|
|
794
|
-
const methodCallId = idGenerator.generate('CALL', fullName, module.file, methodLine, methodColumn, callSiteCounterRef, { useDiscriminator: true, discriminatorKey: `CALL:${fullName}` });
|
|
795
|
-
methodCalls.push({
|
|
796
|
-
id: methodCallId,
|
|
797
|
-
type: 'CALL',
|
|
798
|
-
name: fullName,
|
|
799
|
-
object: objectName,
|
|
800
|
-
method: methodName,
|
|
801
|
-
computed: isComputed,
|
|
802
|
-
computedPropertyVar, // Variable name used in obj[x]() calls
|
|
803
|
-
file: module.file,
|
|
804
|
-
line: methodLine,
|
|
805
|
-
column: methodColumn,
|
|
806
|
-
parentScopeId
|
|
807
|
-
});
|
|
808
|
-
// Check for array mutation methods (push, unshift, splice)
|
|
809
|
-
const ARRAY_MUTATION_METHODS = ['push', 'unshift', 'splice'];
|
|
810
|
-
if (ARRAY_MUTATION_METHODS.includes(methodName)) {
|
|
811
|
-
this.detectArrayMutation(callNode, objectName, methodName, module);
|
|
812
|
-
}
|
|
813
|
-
// Check for Object.assign() calls
|
|
814
|
-
if (objectName === 'Object' && methodName === 'assign') {
|
|
815
|
-
this.detectObjectAssign(callNode, module);
|
|
816
|
-
}
|
|
817
|
-
// Extract arguments for PASSES_ARGUMENT edges
|
|
818
|
-
if (callNode.arguments.length > 0) {
|
|
819
|
-
this.extractArguments(callNode.arguments, methodCallId, module, callArguments, literals, literalCounterRef);
|
|
820
|
-
// Also track callbacks for HAS_CALLBACK edges
|
|
821
|
-
callNode.arguments.forEach((arg) => {
|
|
822
|
-
if (arg.type === 'ArrowFunctionExpression' || arg.type === 'FunctionExpression') {
|
|
823
|
-
methodCallbacks.push({
|
|
824
|
-
methodCallId,
|
|
825
|
-
callbackLine: getLine(arg),
|
|
826
|
-
callbackColumn: getColumn(arg),
|
|
827
|
-
callbackType: arg.type
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
});
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
// REG-117: Nested array mutations like obj.arr.push(item)
|
|
835
|
-
// object is MemberExpression, property is the method name
|
|
836
|
-
else if (object.type === 'MemberExpression' && property.type === 'Identifier') {
|
|
837
|
-
const nestedMember = object;
|
|
838
|
-
const methodName = property.name;
|
|
839
|
-
const ARRAY_MUTATION_METHODS = ['push', 'unshift', 'splice'];
|
|
840
|
-
if (ARRAY_MUTATION_METHODS.includes(methodName)) {
|
|
841
|
-
// Extract base object and property from nested MemberExpression
|
|
842
|
-
const base = nestedMember.object;
|
|
843
|
-
const prop = nestedMember.property;
|
|
844
|
-
// Only handle single-level nesting: obj.arr.push() or this.items.push()
|
|
845
|
-
if ((base.type === 'Identifier' || base.type === 'ThisExpression') &&
|
|
846
|
-
!nestedMember.computed &&
|
|
847
|
-
prop.type === 'Identifier') {
|
|
848
|
-
const baseObjectName = base.type === 'Identifier' ? base.name : 'this';
|
|
849
|
-
const propertyName = prop.name;
|
|
850
|
-
this.detectArrayMutation(callNode, `${baseObjectName}.${propertyName}`, // arrayName for ID purposes
|
|
851
|
-
methodName, module, true, // isNested
|
|
852
|
-
baseObjectName, propertyName);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
}
|
|
148
|
+
this.handleMemberCall(path, callNode, s, parentScopeId, isAwaited);
|
|
856
149
|
}
|
|
857
150
|
},
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
151
|
+
NewExpression: (path) => this.handleNewExpression(path, s),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/** Handle direct function calls: foo() */
|
|
155
|
+
handleDirectCall(callNode, s, parentScopeId, isAwaited) {
|
|
156
|
+
const callee = callNode.callee;
|
|
157
|
+
const line = getLine(callNode);
|
|
158
|
+
const column = getColumn(callNode);
|
|
159
|
+
const callInfo = {
|
|
160
|
+
id: '', // Placeholder — resolved by generateV2 or set below
|
|
161
|
+
type: 'CALL',
|
|
162
|
+
name: callee.name,
|
|
163
|
+
file: s.module.file,
|
|
164
|
+
line,
|
|
165
|
+
column,
|
|
166
|
+
parentScopeId,
|
|
167
|
+
targetFunctionName: callee.name,
|
|
168
|
+
isAwaited: isAwaited || undefined
|
|
169
|
+
};
|
|
170
|
+
if (this.sharedIdGenerator) {
|
|
171
|
+
const contentHints = {
|
|
172
|
+
arity: callNode.arguments.length,
|
|
173
|
+
firstLiteralArg: extractFirstLiteralArg(callNode)
|
|
174
|
+
};
|
|
175
|
+
this.sharedIdGenerator.generateV2('CALL', callee.name, s.module.file, contentHints, callInfo);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
const idGenerator = new IdGenerator(s.scopeTracker);
|
|
179
|
+
callInfo.id = idGenerator.generate('CALL', callee.name, s.module.file, line, column, s.callSiteCounterRef, { useDiscriminator: true, discriminatorKey: `CALL:${callee.name}` });
|
|
180
|
+
}
|
|
181
|
+
const callId = callInfo.id;
|
|
182
|
+
s.callSites.push(callInfo);
|
|
183
|
+
if (callNode.arguments.length > 0) {
|
|
184
|
+
ArgumentExtractor.extract(callNode.arguments, callId, s.module, s.callArguments, s.literals, s.literalCounterRef, this.collections, s.scopeTracker);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** Handle method calls: obj.method(), obj.on('event', handler), obj.arr.push() */
|
|
188
|
+
handleMemberCall(path, callNode, s, parentScopeId, isAwaited) {
|
|
189
|
+
const memberCallee = callNode.callee;
|
|
190
|
+
const object = memberCallee.object;
|
|
191
|
+
const property = memberCallee.property;
|
|
192
|
+
const isComputed = memberCallee.computed;
|
|
193
|
+
if ((object.type === 'Identifier' || object.type === 'ThisExpression') && property.type === 'Identifier') {
|
|
194
|
+
this.handleSimpleMethodCall(path, callNode, s, parentScopeId, isAwaited, memberCallee, object, property, isComputed);
|
|
195
|
+
}
|
|
196
|
+
// REG-117/REG-395: Nested method calls like obj.arr.push() or a.b.c()
|
|
197
|
+
else if (object.type === 'MemberExpression' && property.type === 'Identifier') {
|
|
198
|
+
this.handleNestedMethodCall(path, callNode, s, parentScopeId, object, property, isComputed);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** Handle simple method calls: obj.method() or obj.on('event', handler) */
|
|
202
|
+
handleSimpleMethodCall(path, callNode, s, parentScopeId, isAwaited, memberCallee, object, property, isComputed) {
|
|
203
|
+
const objectName = object.type === 'Identifier' ? object.name : 'this';
|
|
204
|
+
const methodName = isComputed ? '<computed>' : property.name;
|
|
205
|
+
const computedPropertyVar = isComputed ? property.name : null;
|
|
206
|
+
// Special handling for .on() event handlers
|
|
207
|
+
if (methodName === 'on' && callNode.arguments.length >= 2) {
|
|
208
|
+
const firstArg = callNode.arguments[0];
|
|
209
|
+
const secondArg = callNode.arguments[1];
|
|
210
|
+
if (firstArg.type === 'StringLiteral') {
|
|
211
|
+
const nodeKey = `${callNode.start}:${callNode.end}`;
|
|
212
|
+
if (s.processedNodes.eventListeners.has(nodeKey))
|
|
865
213
|
return;
|
|
214
|
+
s.processedNodes.eventListeners.add(nodeKey);
|
|
215
|
+
const eventLine = getLine(callNode);
|
|
216
|
+
const eventColumn = getColumn(callNode);
|
|
217
|
+
s.eventListeners.push({
|
|
218
|
+
id: `event:listener#${firstArg.value}#${s.module.file}#${eventLine}:${eventColumn}:${s.callSiteCounterRef.value++}`,
|
|
219
|
+
type: 'event:listener',
|
|
220
|
+
name: firstArg.value,
|
|
221
|
+
object: objectName,
|
|
222
|
+
file: s.module.file,
|
|
223
|
+
line: eventLine,
|
|
224
|
+
parentScopeId,
|
|
225
|
+
callbackArg: secondArg
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
// Regular method call
|
|
231
|
+
const nodeKey = `${callNode.start}:${callNode.end}`;
|
|
232
|
+
if (s.processedNodes.methodCalls.has(nodeKey))
|
|
233
|
+
return;
|
|
234
|
+
s.processedNodes.methodCalls.add(nodeKey);
|
|
235
|
+
const fullName = `${objectName}.${methodName}`;
|
|
236
|
+
const methodLine = getLine(callNode);
|
|
237
|
+
const methodColumn = getColumn(callNode);
|
|
238
|
+
const grafemaIgnore = getGrafemaIgnore(path);
|
|
239
|
+
const methodCallInfo = {
|
|
240
|
+
id: '', // Placeholder — resolved by generateV2 or set below
|
|
241
|
+
type: 'CALL',
|
|
242
|
+
name: fullName,
|
|
243
|
+
object: objectName,
|
|
244
|
+
method: methodName,
|
|
245
|
+
computed: isComputed,
|
|
246
|
+
computedPropertyVar,
|
|
247
|
+
file: s.module.file,
|
|
248
|
+
line: methodLine,
|
|
249
|
+
column: methodColumn,
|
|
250
|
+
parentScopeId,
|
|
251
|
+
grafemaIgnore: grafemaIgnore ?? undefined,
|
|
252
|
+
isAwaited: isAwaited || undefined,
|
|
253
|
+
};
|
|
254
|
+
if (this.sharedIdGenerator) {
|
|
255
|
+
const contentHints = {
|
|
256
|
+
arity: callNode.arguments.length,
|
|
257
|
+
firstLiteralArg: extractFirstLiteralArg(callNode)
|
|
258
|
+
};
|
|
259
|
+
this.sharedIdGenerator.generateV2('CALL', fullName, s.module.file, contentHints, methodCallInfo);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
const idGenerator = new IdGenerator(s.scopeTracker);
|
|
263
|
+
methodCallInfo.id = idGenerator.generate('CALL', fullName, s.module.file, methodLine, methodColumn, s.callSiteCounterRef, { useDiscriminator: true, discriminatorKey: `CALL:${fullName}` });
|
|
264
|
+
}
|
|
265
|
+
const methodCallId = methodCallInfo.id;
|
|
266
|
+
s.methodCalls.push(methodCallInfo);
|
|
267
|
+
// Check for array mutation methods (push, unshift, splice)
|
|
268
|
+
const ARRAY_MUTATION_METHODS = ['push', 'unshift', 'splice'];
|
|
269
|
+
if (ARRAY_MUTATION_METHODS.includes(methodName)) {
|
|
270
|
+
MutationDetector.detectArrayMutation(callNode, objectName, methodName, s.module, this.collections, s.scopeTracker);
|
|
271
|
+
}
|
|
272
|
+
// Check for Object.assign() calls
|
|
273
|
+
if (objectName === 'Object' && methodName === 'assign') {
|
|
274
|
+
MutationDetector.detectObjectAssign(callNode, s.module, this.collections, s.scopeTracker);
|
|
275
|
+
}
|
|
276
|
+
// Extract arguments for PASSES_ARGUMENT edges
|
|
277
|
+
if (callNode.arguments.length > 0) {
|
|
278
|
+
ArgumentExtractor.extract(callNode.arguments, methodCallId, s.module, s.callArguments, s.literals, s.literalCounterRef, this.collections, s.scopeTracker);
|
|
279
|
+
// Also track callbacks for HAS_CALLBACK edges
|
|
280
|
+
callNode.arguments.forEach((arg) => {
|
|
281
|
+
if (arg.type === 'ArrowFunctionExpression' || arg.type === 'FunctionExpression') {
|
|
282
|
+
s.methodCallbacks.push({
|
|
283
|
+
methodCallId,
|
|
284
|
+
callbackLine: getLine(arg),
|
|
285
|
+
callbackColumn: getColumn(arg),
|
|
286
|
+
callbackType: arg.type
|
|
287
|
+
});
|
|
866
288
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/** Handle nested method calls: obj.arr.push(), a.b.c() (REG-117, REG-395) */
|
|
293
|
+
handleNestedMethodCall(path, callNode, s, parentScopeId, nestedMember, property, isComputed) {
|
|
294
|
+
const methodName = isComputed ? '<computed>' : property.name;
|
|
295
|
+
const ARRAY_MUTATION_METHODS = ['push', 'unshift', 'splice'];
|
|
296
|
+
if (ARRAY_MUTATION_METHODS.includes(methodName)) {
|
|
297
|
+
const base = nestedMember.object;
|
|
298
|
+
const prop = nestedMember.property;
|
|
299
|
+
if ((base.type === 'Identifier' || base.type === 'ThisExpression') &&
|
|
300
|
+
!nestedMember.computed && prop.type === 'Identifier') {
|
|
301
|
+
const baseObjectName = base.type === 'Identifier' ? base.name : 'this';
|
|
302
|
+
const propertyName = prop.name;
|
|
303
|
+
MutationDetector.detectArrayMutation(callNode, `${baseObjectName}.${propertyName}`, methodName, s.module, this.collections, s.scopeTracker, true, baseObjectName, propertyName);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
// REG-395: Create CALL node for nested method calls like a.b.c()
|
|
307
|
+
const objectName = CallExpressionVisitor.extractMemberExpressionName(nestedMember);
|
|
308
|
+
if (objectName) {
|
|
309
|
+
const nodeKey = `${callNode.start}:${callNode.end}`;
|
|
310
|
+
if (!s.processedNodes.methodCalls.has(nodeKey)) {
|
|
311
|
+
s.processedNodes.methodCalls.add(nodeKey);
|
|
312
|
+
const fullName = `${objectName}.${methodName}`;
|
|
313
|
+
const methodLine = getLine(callNode);
|
|
314
|
+
const methodColumn = getColumn(callNode);
|
|
315
|
+
const grafemaIgnore = getGrafemaIgnore(path);
|
|
316
|
+
const methodCallInfo = {
|
|
317
|
+
id: '', // Placeholder — resolved by generateV2 or set below
|
|
318
|
+
type: 'CALL',
|
|
319
|
+
name: fullName,
|
|
320
|
+
object: objectName,
|
|
321
|
+
method: methodName,
|
|
322
|
+
file: s.module.file,
|
|
323
|
+
line: methodLine,
|
|
324
|
+
column: methodColumn,
|
|
325
|
+
parentScopeId,
|
|
326
|
+
grafemaIgnore: grafemaIgnore ?? undefined,
|
|
327
|
+
};
|
|
328
|
+
if (this.sharedIdGenerator) {
|
|
329
|
+
const contentHints = {
|
|
330
|
+
arity: callNode.arguments.length,
|
|
331
|
+
firstLiteralArg: extractFirstLiteralArg(callNode)
|
|
332
|
+
};
|
|
333
|
+
this.sharedIdGenerator.generateV2('CALL', fullName, s.module.file, contentHints, methodCallInfo);
|
|
872
334
|
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
335
|
+
else {
|
|
336
|
+
const idGenerator = new IdGenerator(s.scopeTracker);
|
|
337
|
+
methodCallInfo.id = idGenerator.generate('CALL', fullName, s.module.file, methodLine, methodColumn, s.callSiteCounterRef, { useDiscriminator: true, discriminatorKey: `CALL:${fullName}` });
|
|
338
|
+
}
|
|
339
|
+
s.methodCalls.push(methodCallInfo);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/** Handle new expressions: new Foo(), new obj.Constructor() */
|
|
344
|
+
handleNewExpression(path, s) {
|
|
345
|
+
const newNode = path.node;
|
|
346
|
+
const functionParent = path.getFunctionParent();
|
|
347
|
+
// Skip if inside function - handled by analyzeFunctionBody
|
|
348
|
+
if (functionParent)
|
|
349
|
+
return;
|
|
350
|
+
const parentScopeId = s.module.id;
|
|
351
|
+
// Dedup check
|
|
352
|
+
const nodeKey = `new:${newNode.start}:${newNode.end}`;
|
|
353
|
+
if (s.processedNodes.methodCalls.has(nodeKey))
|
|
354
|
+
return;
|
|
355
|
+
s.processedNodes.methodCalls.add(nodeKey);
|
|
356
|
+
if (newNode.callee.type === 'Identifier') {
|
|
357
|
+
const constructorName = newNode.callee.name;
|
|
358
|
+
const newLine = getLine(newNode);
|
|
359
|
+
const newColumn = getColumn(newNode);
|
|
360
|
+
const callInfo = {
|
|
361
|
+
id: '', // Placeholder — resolved by generateV2 or set below
|
|
362
|
+
type: 'CALL',
|
|
363
|
+
name: constructorName,
|
|
364
|
+
file: s.module.file,
|
|
365
|
+
line: newLine,
|
|
366
|
+
column: newColumn,
|
|
367
|
+
parentScopeId,
|
|
368
|
+
targetFunctionName: constructorName,
|
|
369
|
+
isNew: true
|
|
370
|
+
};
|
|
371
|
+
if (this.sharedIdGenerator) {
|
|
372
|
+
const contentHints = {
|
|
373
|
+
arity: newNode.arguments.length,
|
|
374
|
+
firstLiteralArg: undefined // constructor args not used for hash
|
|
375
|
+
};
|
|
376
|
+
this.sharedIdGenerator.generateV2('CALL', `new:${constructorName}`, s.module.file, contentHints, callInfo);
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
const idGenerator = new IdGenerator(s.scopeTracker);
|
|
380
|
+
callInfo.id = idGenerator.generate('CALL', `new:${constructorName}`, s.module.file, newLine, newColumn, s.callSiteCounterRef, { useDiscriminator: true, discriminatorKey: `CALL:new:${constructorName}` });
|
|
381
|
+
}
|
|
382
|
+
s.callSites.push(callInfo);
|
|
383
|
+
}
|
|
384
|
+
else if (newNode.callee.type === 'MemberExpression') {
|
|
385
|
+
const memberCallee = newNode.callee;
|
|
386
|
+
const object = memberCallee.object;
|
|
387
|
+
const property = memberCallee.property;
|
|
388
|
+
if (object.type === 'Identifier' && property.type === 'Identifier') {
|
|
389
|
+
const objectName = object.name;
|
|
390
|
+
const constructorName = property.name;
|
|
391
|
+
const fullName = `${objectName}.${constructorName}`;
|
|
392
|
+
const memberNewLine = getLine(newNode);
|
|
393
|
+
const memberNewColumn = getColumn(newNode);
|
|
394
|
+
const grafemaIgnore = getGrafemaIgnore(path);
|
|
395
|
+
const methodCallInfo = {
|
|
396
|
+
id: '', // Placeholder — resolved by generateV2 or set below
|
|
397
|
+
type: 'CALL',
|
|
398
|
+
name: fullName,
|
|
399
|
+
object: objectName,
|
|
400
|
+
method: constructorName,
|
|
401
|
+
file: s.module.file,
|
|
402
|
+
line: memberNewLine,
|
|
403
|
+
column: memberNewColumn,
|
|
404
|
+
parentScopeId,
|
|
405
|
+
isNew: true,
|
|
406
|
+
grafemaIgnore: grafemaIgnore ?? undefined,
|
|
407
|
+
};
|
|
408
|
+
if (this.sharedIdGenerator) {
|
|
409
|
+
const contentHints = {
|
|
410
|
+
arity: newNode.arguments.length,
|
|
411
|
+
firstLiteralArg: undefined // constructor args not used for hash
|
|
412
|
+
};
|
|
413
|
+
this.sharedIdGenerator.generateV2('CALL', `new:${fullName}`, s.module.file, contentHints, methodCallInfo);
|
|
894
414
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
const object = memberCallee.object;
|
|
899
|
-
const property = memberCallee.property;
|
|
900
|
-
if (object.type === 'Identifier' && property.type === 'Identifier') {
|
|
901
|
-
const objectName = object.name;
|
|
902
|
-
const constructorName = property.name;
|
|
903
|
-
const fullName = `${objectName}.${constructorName}`;
|
|
904
|
-
const memberNewLine = getLine(newNode);
|
|
905
|
-
const memberNewColumn = getColumn(newNode);
|
|
906
|
-
// Generate ID using centralized IdGenerator
|
|
907
|
-
const idGenerator = new IdGenerator(scopeTracker);
|
|
908
|
-
const newMethodCallId = idGenerator.generate('CALL', `new:${fullName}`, module.file, memberNewLine, memberNewColumn, callSiteCounterRef, { useDiscriminator: true, discriminatorKey: `CALL:new:${fullName}` });
|
|
909
|
-
methodCalls.push({
|
|
910
|
-
id: newMethodCallId,
|
|
911
|
-
type: 'CALL',
|
|
912
|
-
name: fullName,
|
|
913
|
-
object: objectName,
|
|
914
|
-
method: constructorName,
|
|
915
|
-
file: module.file,
|
|
916
|
-
line: memberNewLine,
|
|
917
|
-
column: memberNewColumn,
|
|
918
|
-
parentScopeId,
|
|
919
|
-
isNew: true // Mark as constructor call
|
|
920
|
-
});
|
|
921
|
-
}
|
|
415
|
+
else {
|
|
416
|
+
const idGenerator = new IdGenerator(s.scopeTracker);
|
|
417
|
+
methodCallInfo.id = idGenerator.generate('CALL', `new:${fullName}`, s.module.file, memberNewLine, memberNewColumn, s.callSiteCounterRef, { useDiscriminator: true, discriminatorKey: `CALL:new:${fullName}` });
|
|
922
418
|
}
|
|
419
|
+
s.methodCalls.push(methodCallInfo);
|
|
923
420
|
}
|
|
924
|
-
}
|
|
421
|
+
}
|
|
925
422
|
}
|
|
926
423
|
}
|
|
424
|
+
//# sourceMappingURL=CallExpressionVisitor.js.map
|