@grafema/core 0.1.0-alpha.5 → 0.2.0-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 +0 -1
- package/dist/Orchestrator.d.ts +31 -2
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +222 -27
- package/dist/config/ConfigLoader.d.ts +90 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -0
- package/dist/config/ConfigLoader.js +249 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +4 -0
- package/dist/core/ASTWorker.d.ts +11 -36
- package/dist/core/ASTWorker.d.ts.map +1 -1
- package/dist/core/ASTWorker.js +93 -99
- package/dist/core/CoverageAnalyzer.d.ts +65 -0
- package/dist/core/CoverageAnalyzer.d.ts.map +1 -0
- package/dist/core/CoverageAnalyzer.js +198 -0
- package/dist/core/FileExplainer.d.ts +101 -0
- package/dist/core/FileExplainer.d.ts.map +1 -0
- package/dist/core/FileExplainer.js +139 -0
- package/dist/core/FileNodeManager.d.ts +40 -0
- package/dist/core/FileNodeManager.d.ts.map +1 -0
- package/dist/core/FileNodeManager.js +84 -0
- package/dist/core/GraphFreshnessChecker.d.ts +33 -0
- package/dist/core/GraphFreshnessChecker.d.ts.map +1 -0
- package/dist/core/GraphFreshnessChecker.js +101 -0
- package/dist/core/HashUtils.d.ts +24 -0
- package/dist/core/HashUtils.d.ts.map +1 -0
- package/dist/core/HashUtils.js +45 -0
- package/dist/core/IncrementalReanalyzer.d.ts +36 -0
- package/dist/core/IncrementalReanalyzer.d.ts.map +1 -0
- package/dist/core/IncrementalReanalyzer.js +132 -0
- package/dist/core/NodeFactory.d.ts +266 -19
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +256 -21
- package/dist/core/ScopeTracker.d.ts +84 -0
- package/dist/core/ScopeTracker.d.ts.map +1 -0
- package/dist/core/ScopeTracker.js +116 -0
- package/dist/core/SemanticId.d.ts +90 -0
- package/dist/core/SemanticId.d.ts.map +1 -0
- package/dist/core/SemanticId.js +115 -0
- package/dist/core/VersionManager.d.ts.map +1 -1
- package/dist/core/VersionManager.js +3 -2
- package/dist/core/nodes/ArgumentExpressionNode.d.ts +43 -0
- package/dist/core/nodes/ArgumentExpressionNode.d.ts.map +1 -0
- package/dist/core/nodes/ArgumentExpressionNode.js +60 -0
- package/dist/core/nodes/ArrayLiteralNode.d.ts +27 -0
- package/dist/core/nodes/ArrayLiteralNode.d.ts.map +1 -0
- package/dist/core/nodes/ArrayLiteralNode.js +43 -0
- package/dist/core/nodes/BranchNode.d.ts +41 -0
- package/dist/core/nodes/BranchNode.d.ts.map +1 -0
- package/dist/core/nodes/BranchNode.js +82 -0
- package/dist/core/nodes/CallSiteNode.d.ts +30 -2
- package/dist/core/nodes/CallSiteNode.d.ts.map +1 -1
- package/dist/core/nodes/CallSiteNode.js +54 -4
- package/dist/core/nodes/CaseNode.d.ts +43 -0
- package/dist/core/nodes/CaseNode.d.ts.map +1 -0
- package/dist/core/nodes/CaseNode.js +81 -0
- package/dist/core/nodes/ClassNode.d.ts +34 -2
- package/dist/core/nodes/ClassNode.d.ts.map +1 -1
- package/dist/core/nodes/ClassNode.js +52 -4
- package/dist/core/nodes/ConstantNode.d.ts +2 -2
- package/dist/core/nodes/ConstantNode.d.ts.map +1 -1
- package/dist/core/nodes/ConstantNode.js +6 -4
- package/dist/core/nodes/ConstructorCallNode.d.ts +51 -0
- package/dist/core/nodes/ConstructorCallNode.d.ts.map +1 -0
- package/dist/core/nodes/ConstructorCallNode.js +171 -0
- package/dist/core/nodes/DatabaseQueryNode.d.ts +3 -2
- package/dist/core/nodes/DatabaseQueryNode.d.ts.map +1 -1
- package/dist/core/nodes/DatabaseQueryNode.js +5 -2
- package/dist/core/nodes/DecoratorNode.d.ts +42 -0
- package/dist/core/nodes/DecoratorNode.d.ts.map +1 -0
- package/dist/core/nodes/DecoratorNode.js +64 -0
- package/dist/core/nodes/EnumNode.d.ts +42 -0
- package/dist/core/nodes/EnumNode.d.ts.map +1 -0
- package/dist/core/nodes/EnumNode.js +56 -0
- package/dist/core/nodes/EventListenerNode.d.ts +4 -4
- package/dist/core/nodes/EventListenerNode.d.ts.map +1 -1
- package/dist/core/nodes/EventListenerNode.js +7 -4
- package/dist/core/nodes/ExportNode.d.ts +38 -2
- package/dist/core/nodes/ExportNode.d.ts.map +1 -1
- package/dist/core/nodes/ExportNode.js +54 -4
- package/dist/core/nodes/ExpressionNode.d.ts +97 -0
- package/dist/core/nodes/ExpressionNode.d.ts.map +1 -0
- package/dist/core/nodes/ExpressionNode.js +180 -0
- package/dist/core/nodes/ExternalModuleNode.d.ts +32 -0
- package/dist/core/nodes/ExternalModuleNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalModuleNode.js +49 -0
- package/dist/core/nodes/ExternalStdioNode.d.ts +13 -6
- package/dist/core/nodes/ExternalStdioNode.d.ts.map +1 -1
- package/dist/core/nodes/ExternalStdioNode.js +15 -8
- package/dist/core/nodes/FunctionNode.d.ts +36 -0
- package/dist/core/nodes/FunctionNode.d.ts.map +1 -1
- package/dist/core/nodes/FunctionNode.js +80 -1
- package/dist/core/nodes/HttpRequestNode.d.ts +4 -4
- package/dist/core/nodes/HttpRequestNode.d.ts.map +1 -1
- package/dist/core/nodes/HttpRequestNode.js +7 -4
- package/dist/core/nodes/ImportNode.d.ts +28 -6
- package/dist/core/nodes/ImportNode.d.ts.map +1 -1
- package/dist/core/nodes/ImportNode.js +43 -8
- package/dist/core/nodes/InterfaceNode.d.ts +46 -0
- package/dist/core/nodes/InterfaceNode.d.ts.map +1 -0
- package/dist/core/nodes/InterfaceNode.js +57 -0
- package/dist/core/nodes/IssueNode.d.ts +73 -0
- package/dist/core/nodes/IssueNode.d.ts.map +1 -0
- package/dist/core/nodes/IssueNode.js +129 -0
- package/dist/core/nodes/LiteralNode.d.ts +2 -2
- package/dist/core/nodes/LiteralNode.d.ts.map +1 -1
- package/dist/core/nodes/LiteralNode.js +6 -4
- package/dist/core/nodes/MethodCallNode.d.ts +32 -2
- package/dist/core/nodes/MethodCallNode.d.ts.map +1 -1
- package/dist/core/nodes/MethodCallNode.js +57 -4
- package/dist/core/nodes/MethodNode.d.ts +34 -2
- package/dist/core/nodes/MethodNode.d.ts.map +1 -1
- package/dist/core/nodes/MethodNode.js +55 -3
- package/dist/core/nodes/ModuleNode.d.ts +31 -0
- package/dist/core/nodes/ModuleNode.d.ts.map +1 -1
- package/dist/core/nodes/ModuleNode.js +37 -0
- package/dist/core/nodes/NetworkRequestNode.d.ts +54 -0
- package/dist/core/nodes/NetworkRequestNode.d.ts.map +1 -0
- package/dist/core/nodes/NetworkRequestNode.js +65 -0
- package/dist/core/nodes/ObjectLiteralNode.d.ts +27 -0
- package/dist/core/nodes/ObjectLiteralNode.d.ts.map +1 -0
- package/dist/core/nodes/ObjectLiteralNode.js +43 -0
- package/dist/core/nodes/ParameterNode.d.ts +2 -2
- package/dist/core/nodes/ParameterNode.d.ts.map +1 -1
- package/dist/core/nodes/ParameterNode.js +5 -3
- package/dist/core/nodes/ScopeNode.d.ts +31 -0
- package/dist/core/nodes/ScopeNode.d.ts.map +1 -1
- package/dist/core/nodes/ScopeNode.js +49 -0
- package/dist/core/nodes/TypeNode.d.ts +36 -0
- package/dist/core/nodes/TypeNode.d.ts.map +1 -0
- package/dist/core/nodes/TypeNode.js +55 -0
- package/dist/core/nodes/VariableDeclarationNode.d.ts +29 -2
- package/dist/core/nodes/VariableDeclarationNode.d.ts.map +1 -1
- package/dist/core/nodes/VariableDeclarationNode.js +48 -4
- package/dist/core/nodes/index.d.ts +15 -1
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +17 -0
- package/dist/data/builtins/BuiltinRegistry.d.ts +78 -0
- package/dist/data/builtins/BuiltinRegistry.d.ts.map +1 -0
- package/dist/data/builtins/BuiltinRegistry.js +110 -0
- package/dist/data/builtins/definitions.d.ts +28 -0
- package/dist/data/builtins/definitions.d.ts.map +1 -0
- package/dist/data/builtins/definitions.js +250 -0
- package/dist/data/builtins/index.d.ts +10 -0
- package/dist/data/builtins/index.d.ts.map +1 -0
- package/dist/data/builtins/index.js +8 -0
- package/dist/data/builtins/jsGlobals.d.ts +18 -0
- package/dist/data/builtins/jsGlobals.d.ts.map +1 -0
- package/dist/data/builtins/jsGlobals.js +26 -0
- package/dist/data/builtins/types.d.ts +34 -0
- package/dist/data/builtins/types.d.ts.map +1 -0
- package/dist/data/builtins/types.js +7 -0
- package/dist/data/globals/definitions.d.ts +27 -0
- package/dist/data/globals/definitions.d.ts.map +1 -0
- package/dist/data/globals/definitions.js +117 -0
- package/dist/data/globals/index.d.ts +36 -0
- package/dist/data/globals/index.d.ts.map +1 -0
- package/dist/data/globals/index.js +52 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts +98 -0
- package/dist/diagnostics/DiagnosticCollector.d.ts.map +1 -0
- package/dist/diagnostics/DiagnosticCollector.js +129 -0
- package/dist/diagnostics/DiagnosticReporter.d.ts +100 -0
- package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -0
- package/dist/diagnostics/DiagnosticReporter.js +247 -0
- package/dist/diagnostics/DiagnosticWriter.d.ts +31 -0
- package/dist/diagnostics/DiagnosticWriter.d.ts.map +1 -0
- package/dist/diagnostics/DiagnosticWriter.js +43 -0
- package/dist/diagnostics/index.d.ts +14 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +11 -0
- package/dist/errors/GrafemaError.d.ts +161 -0
- package/dist/errors/GrafemaError.d.ts.map +1 -0
- package/dist/errors/GrafemaError.js +181 -0
- package/dist/index.d.ts +73 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -1
- package/dist/logging/Logger.d.ts +48 -0
- package/dist/logging/Logger.d.ts.map +1 -0
- package/dist/logging/Logger.js +134 -0
- package/dist/plugins/Plugin.d.ts +5 -1
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/Plugin.js +33 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/DatabaseAnalyzer.js +14 -6
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +29 -19
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts +148 -0
- package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/ExpressResponseAnalyzer.js +495 -0
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +71 -29
- package/dist/plugins/analysis/FetchAnalyzer.d.ts +41 -0
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +187 -19
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts +6 -3
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -1
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +76 -80
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +313 -19
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +3430 -503
- package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ReactAnalyzer.js +56 -57
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/RustAnalyzer.js +16 -11
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +11 -7
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +21 -9
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts +9 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SocketIOAnalyzer.js +117 -21
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SystemDbAnalyzer.js +15 -5
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts +207 -4
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +1527 -316
- package/dist/plugins/analysis/ast/IdGenerator.d.ts +105 -0
- package/dist/plugins/analysis/ast/IdGenerator.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/IdGenerator.js +116 -0
- package/dist/plugins/analysis/ast/types.d.ts +470 -5
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts +33 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/createParameterNodes.js +89 -0
- package/dist/plugins/analysis/ast/utils/index.d.ts +6 -0
- package/dist/plugins/analysis/ast/utils/index.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/index.js +5 -0
- package/dist/plugins/analysis/ast/utils/location.d.ts +87 -0
- package/dist/plugins/analysis/ast/utils/location.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/utils/location.js +78 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +14 -5
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js +6 -5
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +100 -9
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +674 -125
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts +4 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +72 -32
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +14 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +190 -63
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts +4 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +112 -8
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +12 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +36 -14
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +20 -2
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +243 -45
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +3 -2
- package/dist/plugins/discovery/SimpleProjectDiscovery.d.ts.map +1 -1
- package/dist/plugins/discovery/SimpleProjectDiscovery.js +5 -1
- package/dist/plugins/discovery/WorkspaceDiscovery.d.ts +22 -0
- package/dist/plugins/discovery/WorkspaceDiscovery.d.ts.map +1 -0
- package/dist/plugins/discovery/WorkspaceDiscovery.js +141 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.d.ts +46 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.d.ts.map +1 -0
- package/dist/plugins/discovery/resolveSourceEntrypoint.js +86 -0
- package/dist/plugins/discovery/workspaces/detector.d.ts +21 -0
- package/dist/plugins/discovery/workspaces/detector.d.ts.map +1 -0
- package/dist/plugins/discovery/workspaces/detector.js +49 -0
- package/dist/plugins/discovery/workspaces/globResolver.d.ts +35 -0
- package/dist/plugins/discovery/workspaces/globResolver.d.ts.map +1 -0
- package/dist/plugins/discovery/workspaces/globResolver.js +184 -0
- package/dist/plugins/discovery/workspaces/index.d.ts +9 -0
- package/dist/plugins/discovery/workspaces/index.d.ts.map +1 -0
- package/dist/plugins/discovery/workspaces/index.js +8 -0
- package/dist/plugins/discovery/workspaces/parsers.d.ts +38 -0
- package/dist/plugins/discovery/workspaces/parsers.d.ts.map +1 -0
- package/dist/plugins/discovery/workspaces/parsers.js +80 -0
- package/dist/plugins/enrichment/AliasTracker.d.ts.map +1 -1
- package/dist/plugins/enrichment/AliasTracker.js +29 -8
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts +32 -0
- package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -0
- package/dist/plugins/enrichment/ArgumentParameterLinker.js +175 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts +51 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/ClosureCaptureEnricher.js +205 -0
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts +42 -0
- package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/ExternalCallResolver.js +213 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts +58 -0
- package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/FunctionCallResolver.js +340 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +16 -3
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +78 -27
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -1
- package/dist/plugins/enrichment/ImportExportLinker.js +23 -6
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MethodCallResolver.js +33 -13
- package/dist/plugins/enrichment/MountPointResolver.d.ts +14 -12
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +173 -147
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts +44 -0
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +271 -0
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -1
- package/dist/plugins/enrichment/PrefixEvaluator.js +16 -7
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/RustFFIEnricher.js +6 -5
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts +22 -27
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +185 -143
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +23 -14
- package/dist/plugins/indexing/JSModuleIndexer.d.ts +15 -0
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +121 -31
- package/dist/plugins/indexing/RustModuleIndexer.d.ts +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +8 -7
- package/dist/plugins/indexing/ServiceDetector.d.ts +10 -0
- package/dist/plugins/indexing/ServiceDetector.d.ts.map +1 -1
- package/dist/plugins/indexing/ServiceDetector.js +28 -15
- package/dist/plugins/validation/BrokenImportValidator.d.ts +31 -0
- package/dist/plugins/validation/BrokenImportValidator.d.ts.map +1 -0
- package/dist/plugins/validation/BrokenImportValidator.js +249 -0
- package/dist/plugins/validation/CallResolverValidator.d.ts +21 -10
- package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -1
- package/dist/plugins/validation/CallResolverValidator.js +103 -77
- package/dist/plugins/validation/DataFlowValidator.d.ts.map +1 -1
- package/dist/plugins/validation/DataFlowValidator.js +62 -49
- package/dist/plugins/validation/EvalBanValidator.d.ts.map +1 -1
- package/dist/plugins/validation/EvalBanValidator.js +17 -16
- package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -1
- package/dist/plugins/validation/GraphConnectivityValidator.js +44 -24
- package/dist/plugins/validation/NodeCreationValidator.d.ts +85 -0
- package/dist/plugins/validation/NodeCreationValidator.d.ts.map +1 -0
- package/dist/plugins/validation/NodeCreationValidator.js +415 -0
- package/dist/plugins/validation/SQLInjectionValidator.d.ts.map +1 -1
- package/dist/plugins/validation/SQLInjectionValidator.js +61 -19
- package/dist/plugins/validation/ShadowingDetector.d.ts.map +1 -1
- package/dist/plugins/validation/ShadowingDetector.js +6 -5
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.d.ts.map +1 -1
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js +12 -11
- package/dist/plugins/vcs/GitPlugin.d.ts.map +1 -1
- package/dist/plugins/vcs/GitPlugin.js +10 -12
- package/dist/plugins/vcs/VCSPlugin.d.ts +3 -2
- package/dist/plugins/vcs/VCSPlugin.d.ts.map +1 -1
- package/dist/plugins/vcs/VCSPlugin.js +5 -5
- package/dist/queries/findCallsInFunction.d.ts +52 -0
- package/dist/queries/findCallsInFunction.d.ts.map +1 -0
- package/dist/queries/findCallsInFunction.js +135 -0
- package/dist/queries/findContainingFunction.d.ts +45 -0
- package/dist/queries/findContainingFunction.d.ts.map +1 -0
- package/dist/queries/findContainingFunction.js +54 -0
- package/dist/queries/index.d.ts +14 -0
- package/dist/queries/index.d.ts.map +1 -0
- package/dist/queries/index.js +11 -0
- package/dist/queries/traceValues.d.ts +70 -0
- package/dist/queries/traceValues.d.ts.map +1 -0
- package/dist/queries/traceValues.js +299 -0
- package/dist/queries/types.d.ts +163 -0
- package/dist/queries/types.d.ts.map +1 -0
- package/dist/queries/types.js +9 -0
- package/dist/schema/GraphSchemaExtractor.d.ts +53 -0
- package/dist/schema/GraphSchemaExtractor.d.ts.map +1 -0
- package/dist/schema/GraphSchemaExtractor.js +124 -0
- package/dist/schema/InterfaceSchemaExtractor.d.ts +73 -0
- package/dist/schema/InterfaceSchemaExtractor.d.ts.map +1 -0
- package/dist/schema/InterfaceSchemaExtractor.js +112 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +2 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +21 -34
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +72 -62
- package/dist/storage/backends/typeValidation.d.ts.map +1 -1
- package/dist/storage/backends/typeValidation.js +1 -0
- package/dist/validation/PathValidator.d.ts +1 -2
- package/dist/validation/PathValidator.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/Orchestrator.ts +272 -27
- package/src/config/ConfigLoader.ts +354 -0
- package/src/config/index.ts +5 -0
- package/src/core/ASTWorker.ts +143 -139
- package/src/core/CoverageAnalyzer.ts +243 -0
- package/src/core/FileExplainer.ts +179 -0
- package/src/core/FileNodeManager.ts +100 -0
- package/src/core/GraphFreshnessChecker.ts +143 -0
- package/src/core/HashUtils.ts +48 -0
- package/src/core/IncrementalReanalyzer.ts +192 -0
- package/src/core/NodeFactory.ts +470 -23
- package/src/core/ScopeTracker.ts +154 -0
- package/src/core/SemanticId.ts +192 -0
- package/src/core/VersionManager.ts +3 -2
- package/src/core/nodes/ArgumentExpressionNode.ts +89 -0
- package/src/core/nodes/ArrayLiteralNode.ts +66 -0
- package/src/core/nodes/BranchNode.ts +113 -0
- package/src/core/nodes/CallSiteNode.ts +64 -4
- package/src/core/nodes/CaseNode.ts +123 -0
- package/src/core/nodes/ClassNode.ts +67 -4
- package/src/core/nodes/ConstantNode.ts +5 -4
- package/src/core/nodes/ConstructorCallNode.ts +217 -0
- package/src/core/nodes/DatabaseQueryNode.ts +5 -1
- package/src/core/nodes/DecoratorNode.ts +92 -0
- package/src/core/nodes/EnumNode.ts +87 -0
- package/src/core/nodes/EventListenerNode.ts +7 -4
- package/src/core/nodes/ExportNode.ts +74 -4
- package/src/core/nodes/ExpressionNode.ts +232 -0
- package/src/core/nodes/ExternalModuleNode.ts +65 -0
- package/src/core/nodes/ExternalStdioNode.ts +17 -9
- package/src/core/nodes/FunctionNode.ts +101 -1
- package/src/core/nodes/HttpRequestNode.ts +7 -4
- package/src/core/nodes/ImportNode.ts +62 -13
- package/src/core/nodes/InterfaceNode.ts +92 -0
- package/src/core/nodes/IssueNode.ts +177 -0
- package/src/core/nodes/LiteralNode.ts +5 -4
- package/src/core/nodes/MethodCallNode.ts +70 -4
- package/src/core/nodes/MethodNode.ts +68 -3
- package/src/core/nodes/ModuleNode.ts +50 -0
- package/src/core/nodes/NetworkRequestNode.ts +77 -0
- package/src/core/nodes/ObjectLiteralNode.ts +66 -0
- package/src/core/nodes/ParameterNode.ts +4 -3
- package/src/core/nodes/ScopeNode.ts +65 -0
- package/src/core/nodes/TypeNode.ts +79 -0
- package/src/core/nodes/VariableDeclarationNode.ts +58 -4
- package/src/core/nodes/index.ts +21 -1
- package/src/data/builtins/BuiltinRegistry.ts +124 -0
- package/src/data/builtins/definitions.ts +267 -0
- package/src/data/builtins/index.ts +10 -0
- package/src/data/builtins/jsGlobals.ts +28 -0
- package/src/data/builtins/types.ts +36 -0
- package/src/data/globals/definitions.ts +156 -0
- package/src/data/globals/index.ts +66 -0
- package/src/diagnostics/DiagnosticCollector.ts +163 -0
- package/src/diagnostics/DiagnosticReporter.ts +324 -0
- package/src/diagnostics/DiagnosticWriter.ts +50 -0
- package/src/diagnostics/index.ts +16 -0
- package/src/errors/GrafemaError.ts +239 -0
- package/src/index.ts +193 -1
- package/src/logging/Logger.ts +152 -0
- package/src/plugins/Plugin.ts +42 -0
- package/src/plugins/analysis/DatabaseAnalyzer.ts +16 -8
- package/src/plugins/analysis/ExpressAnalyzer.ts +33 -19
- package/src/plugins/analysis/ExpressResponseAnalyzer.ts +636 -0
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +76 -36
- package/src/plugins/analysis/FetchAnalyzer.ts +232 -21
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +84 -101
- package/src/plugins/analysis/JSASTAnalyzer.ts +4265 -587
- package/src/plugins/analysis/ReactAnalyzer.ts +57 -57
- package/src/plugins/analysis/RustAnalyzer.ts +16 -11
- package/src/plugins/analysis/SQLiteAnalyzer.ts +13 -7
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +22 -16
- package/src/plugins/analysis/SocketIOAnalyzer.ts +151 -28
- package/src/plugins/analysis/SystemDbAnalyzer.ts +16 -11
- package/src/plugins/analysis/ast/GraphBuilder.ts +1947 -327
- package/src/plugins/analysis/ast/IdGenerator.ts +177 -0
- package/src/plugins/analysis/ast/types.ts +596 -6
- package/src/plugins/analysis/ast/utils/createParameterNodes.ts +104 -0
- package/src/plugins/analysis/ast/utils/index.ts +12 -0
- package/src/plugins/analysis/ast/utils/location.ts +103 -0
- package/src/plugins/analysis/ast/visitors/ASTVisitor.ts +19 -8
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +924 -83
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +97 -44
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +234 -93
- package/src/plugins/analysis/ast/visitors/ImportExportVisitor.ts +124 -9
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +41 -14
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +294 -49
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +3 -2
- package/src/plugins/discovery/SimpleProjectDiscovery.ts +6 -1
- package/src/plugins/discovery/WorkspaceDiscovery.ts +184 -0
- package/src/plugins/discovery/resolveSourceEntrypoint.ts +103 -0
- package/src/plugins/discovery/workspaces/detector.ts +63 -0
- package/src/plugins/discovery/workspaces/globResolver.ts +229 -0
- package/src/plugins/discovery/workspaces/index.ts +23 -0
- package/src/plugins/discovery/workspaces/parsers.ts +99 -0
- package/src/plugins/enrichment/AliasTracker.ts +35 -8
- package/src/plugins/enrichment/ArgumentParameterLinker.ts +240 -0
- package/src/plugins/enrichment/ClosureCaptureEnricher.ts +267 -0
- package/src/plugins/enrichment/ExternalCallResolver.ts +262 -0
- package/src/plugins/enrichment/FunctionCallResolver.ts +456 -0
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +84 -27
- package/src/plugins/enrichment/ImportExportLinker.ts +24 -6
- package/src/plugins/enrichment/MethodCallResolver.ts +39 -13
- package/src/plugins/enrichment/MountPointResolver.ts +208 -195
- package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +365 -0
- package/src/plugins/enrichment/PrefixEvaluator.ts +16 -7
- package/src/plugins/enrichment/RustFFIEnricher.ts +6 -5
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +209 -189
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +23 -14
- package/src/plugins/indexing/JSModuleIndexer.ts +140 -34
- package/src/plugins/indexing/RustModuleIndexer.ts +8 -7
- package/src/plugins/validation/BrokenImportValidator.ts +325 -0
- package/src/plugins/validation/CallResolverValidator.ts +131 -110
- package/src/plugins/validation/DataFlowValidator.ts +88 -67
- package/src/plugins/validation/EvalBanValidator.ts +17 -16
- package/src/plugins/validation/GraphConnectivityValidator.ts +58 -24
- package/src/plugins/validation/NodeCreationValidator.ts +554 -0
- package/src/plugins/validation/SQLInjectionValidator.ts +63 -20
- package/src/plugins/validation/ShadowingDetector.ts +6 -5
- package/src/plugins/validation/TypeScriptDeadCodeValidator.ts +12 -11
- package/src/plugins/vcs/GitPlugin.ts +40 -12
- package/src/plugins/vcs/VCSPlugin.ts +7 -5
- package/src/queries/README.md +46 -0
- package/src/queries/findCallsInFunction.ts +206 -0
- package/src/queries/findContainingFunction.ts +83 -0
- package/src/queries/index.ts +23 -0
- package/src/queries/traceValues.ts +398 -0
- package/src/queries/types.ts +187 -0
- package/src/schema/GraphSchemaExtractor.ts +177 -0
- package/src/schema/InterfaceSchemaExtractor.ts +173 -0
- package/src/schema/index.ts +5 -0
- package/src/storage/backends/RFDBServerBackend.ts +100 -98
- package/src/storage/backends/typeValidation.ts +1 -0
- package/src/validation/PathValidator.ts +1 -1
- package/dist/core/AnalysisWorker.d.ts +0 -14
- package/dist/core/AnalysisWorker.d.ts.map +0 -1
- package/dist/core/AnalysisWorker.js +0 -307
- package/dist/core/ParallelAnalyzer.d.ts +0 -120
- package/dist/core/ParallelAnalyzer.d.ts.map +0 -1
- package/dist/core/ParallelAnalyzer.js +0 -331
- package/dist/core/QueueWorker.d.ts +0 -12
- package/dist/core/QueueWorker.d.ts.map +0 -1
- package/dist/core/QueueWorker.js +0 -567
- package/dist/core/RFDBClient.d.ts +0 -179
- package/dist/core/RFDBClient.d.ts.map +0 -1
- package/dist/core/RFDBClient.js +0 -429
- package/dist/plugins/discovery/ZonServiceDiscovery.d.ts +0 -19
- package/dist/plugins/discovery/ZonServiceDiscovery.d.ts.map +0 -1
- package/dist/plugins/discovery/ZonServiceDiscovery.js +0 -204
- package/src/core/AnalysisWorker.ts +0 -410
- package/src/core/ParallelAnalyzer.ts +0 -476
- package/src/core/QueueWorker.ts +0 -780
- package/src/plugins/indexing/ServiceDetector.ts +0 -230
|
@@ -19,7 +19,6 @@ export interface ModuleNode {
|
|
|
19
19
|
// === FUNCTION INFO ===
|
|
20
20
|
export interface FunctionInfo {
|
|
21
21
|
id: string;
|
|
22
|
-
stableId: string;
|
|
23
22
|
type: 'FUNCTION';
|
|
24
23
|
name: string;
|
|
25
24
|
file: string;
|
|
@@ -31,17 +30,21 @@ export interface FunctionInfo {
|
|
|
31
30
|
isAssignment?: boolean;
|
|
32
31
|
isCallback?: boolean;
|
|
33
32
|
parentScopeId?: string;
|
|
33
|
+
controlFlow?: ControlFlowMetadata;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// === PARAMETER INFO ===
|
|
37
37
|
export interface ParameterInfo {
|
|
38
38
|
id: string;
|
|
39
|
+
semanticId?: string; // Stable ID: file->scope->PARAMETER->name
|
|
39
40
|
type: 'PARAMETER';
|
|
40
41
|
name: string;
|
|
41
42
|
file: string;
|
|
42
43
|
line: number;
|
|
43
44
|
index?: number;
|
|
44
|
-
|
|
45
|
+
hasDefault?: boolean; // Has default value (e.g., function(a = 1))
|
|
46
|
+
isRest?: boolean; // Rest parameter (e.g., function(...args))
|
|
47
|
+
functionId?: string; // Legacy field - prefer parentFunctionId
|
|
45
48
|
parentFunctionId?: string;
|
|
46
49
|
}
|
|
47
50
|
|
|
@@ -51,7 +54,7 @@ export interface ScopeInfo {
|
|
|
51
54
|
type: 'SCOPE';
|
|
52
55
|
scopeType: string;
|
|
53
56
|
name?: string;
|
|
54
|
-
semanticId?: string; // Stable ID for diff comparison (e.g., "MyClass
|
|
57
|
+
semanticId?: string; // Stable ID for diff comparison (e.g., "MyClass->myMethod:if_statement[0]")
|
|
55
58
|
conditional?: boolean;
|
|
56
59
|
condition?: string;
|
|
57
60
|
constraints?: unknown[];
|
|
@@ -63,9 +66,135 @@ export interface ScopeInfo {
|
|
|
63
66
|
modifies?: Array<{ variableId: string; variableName: string; line: number }>;
|
|
64
67
|
}
|
|
65
68
|
|
|
69
|
+
// === BRANCH INFO ===
|
|
70
|
+
export interface BranchInfo {
|
|
71
|
+
id: string;
|
|
72
|
+
semanticId?: string;
|
|
73
|
+
type: 'BRANCH';
|
|
74
|
+
branchType: 'switch' | 'if' | 'ternary';
|
|
75
|
+
file: string;
|
|
76
|
+
line: number;
|
|
77
|
+
parentScopeId?: string;
|
|
78
|
+
discriminantExpressionId?: string; // ID of EXPRESSION node for discriminant
|
|
79
|
+
// Linus improvement: store discriminant metadata directly instead of parsing from ID
|
|
80
|
+
discriminantExpressionType?: string;
|
|
81
|
+
discriminantLine?: number;
|
|
82
|
+
discriminantColumn?: number;
|
|
83
|
+
// For else-if chains: the parent BRANCH id whose alternate this branch is
|
|
84
|
+
isAlternateOfBranchId?: string;
|
|
85
|
+
// For ternary: IDs of consequent and alternate expressions
|
|
86
|
+
consequentExpressionId?: string;
|
|
87
|
+
alternateExpressionId?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// === CASE INFO ===
|
|
91
|
+
export interface CaseInfo {
|
|
92
|
+
id: string;
|
|
93
|
+
semanticId?: string;
|
|
94
|
+
type: 'CASE';
|
|
95
|
+
value: unknown;
|
|
96
|
+
isDefault: boolean;
|
|
97
|
+
fallsThrough: boolean;
|
|
98
|
+
isEmpty: boolean;
|
|
99
|
+
file: string;
|
|
100
|
+
line: number;
|
|
101
|
+
parentBranchId: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// === LOOP INFO ===
|
|
105
|
+
export interface LoopInfo {
|
|
106
|
+
id: string;
|
|
107
|
+
semanticId?: string;
|
|
108
|
+
type: 'LOOP';
|
|
109
|
+
loopType: 'for' | 'for-in' | 'for-of' | 'while' | 'do-while';
|
|
110
|
+
file: string;
|
|
111
|
+
line: number;
|
|
112
|
+
column?: number;
|
|
113
|
+
parentScopeId?: string;
|
|
114
|
+
// For for-in/for-of: the collection being iterated
|
|
115
|
+
iteratesOverName?: string; // Variable name (e.g., 'items')
|
|
116
|
+
iteratesOverLine?: number; // Line of collection reference
|
|
117
|
+
iteratesOverColumn?: number; // Column of collection reference
|
|
118
|
+
// For while/do-while: condition expression (REG-280)
|
|
119
|
+
conditionExpressionId?: string; // ID of EXPRESSION/CALL node for condition
|
|
120
|
+
conditionExpressionType?: string; // 'Identifier', 'BinaryExpression', 'CallExpression', etc.
|
|
121
|
+
conditionLine?: number; // Line of condition expression
|
|
122
|
+
conditionColumn?: number; // Column of condition expression
|
|
123
|
+
|
|
124
|
+
// For classic for loop (REG-282): init, test, update expressions
|
|
125
|
+
// All three can be null (e.g., for (;;) {})
|
|
126
|
+
|
|
127
|
+
// Init: let i = 0 - points to VARIABLE node
|
|
128
|
+
initVariableName?: string; // Variable name declared in init (e.g., 'i')
|
|
129
|
+
initLine?: number; // Line of init declaration
|
|
130
|
+
|
|
131
|
+
// Test (condition): i < 10 - points to EXPRESSION node
|
|
132
|
+
testExpressionId?: string; // ID of EXPRESSION node
|
|
133
|
+
testExpressionType?: string; // 'BinaryExpression', 'Identifier', etc.
|
|
134
|
+
testLine?: number;
|
|
135
|
+
testColumn?: number;
|
|
136
|
+
|
|
137
|
+
// Update: i++ - points to EXPRESSION node
|
|
138
|
+
updateExpressionId?: string; // ID of EXPRESSION node
|
|
139
|
+
updateExpressionType?: string; // 'UpdateExpression', 'AssignmentExpression', etc.
|
|
140
|
+
updateLine?: number;
|
|
141
|
+
updateColumn?: number;
|
|
142
|
+
|
|
143
|
+
// For for-await-of (REG-284)
|
|
144
|
+
async?: boolean; // true for for-await-of loops
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// === TRY BLOCK INFO ===
|
|
148
|
+
export interface TryBlockInfo {
|
|
149
|
+
id: string;
|
|
150
|
+
semanticId?: string;
|
|
151
|
+
type: 'TRY_BLOCK';
|
|
152
|
+
file: string;
|
|
153
|
+
line: number;
|
|
154
|
+
column?: number;
|
|
155
|
+
parentScopeId?: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// === CATCH BLOCK INFO ===
|
|
159
|
+
export interface CatchBlockInfo {
|
|
160
|
+
id: string;
|
|
161
|
+
semanticId?: string;
|
|
162
|
+
type: 'CATCH_BLOCK';
|
|
163
|
+
file: string;
|
|
164
|
+
line: number;
|
|
165
|
+
column?: number;
|
|
166
|
+
parentScopeId?: string;
|
|
167
|
+
parentTryBlockId: string; // ID of parent TRY_BLOCK
|
|
168
|
+
parameterName?: string; // Error parameter name
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// === FINALLY BLOCK INFO ===
|
|
172
|
+
export interface FinallyBlockInfo {
|
|
173
|
+
id: string;
|
|
174
|
+
semanticId?: string;
|
|
175
|
+
type: 'FINALLY_BLOCK';
|
|
176
|
+
file: string;
|
|
177
|
+
line: number;
|
|
178
|
+
column?: number;
|
|
179
|
+
parentScopeId?: string;
|
|
180
|
+
parentTryBlockId: string; // ID of parent TRY_BLOCK
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// === CONTROL FLOW METADATA ===
|
|
184
|
+
// Attached to FUNCTION nodes
|
|
185
|
+
export interface ControlFlowMetadata {
|
|
186
|
+
hasBranches: boolean; // Has if/switch statements
|
|
187
|
+
hasLoops: boolean; // Has any loop type
|
|
188
|
+
hasTryCatch: boolean; // Has try/catch blocks
|
|
189
|
+
hasEarlyReturn: boolean; // Has return before function end
|
|
190
|
+
hasThrow: boolean; // Has throw statements
|
|
191
|
+
cyclomaticComplexity: number; // McCabe cyclomatic complexity
|
|
192
|
+
}
|
|
193
|
+
|
|
66
194
|
// === VARIABLE DECLARATION INFO ===
|
|
67
195
|
export interface VariableDeclarationInfo {
|
|
68
196
|
id: string;
|
|
197
|
+
semanticId?: string; // Stable ID: file->scope->VARIABLE->name
|
|
69
198
|
type: 'VARIABLE' | 'CONSTANT';
|
|
70
199
|
name: string;
|
|
71
200
|
file: string;
|
|
@@ -78,6 +207,7 @@ export interface VariableDeclarationInfo {
|
|
|
78
207
|
// === CALL SITE INFO ===
|
|
79
208
|
export interface CallSiteInfo {
|
|
80
209
|
id: string;
|
|
210
|
+
semanticId?: string; // Stable ID: file->scope->CALL->name#N
|
|
81
211
|
type: 'CALL';
|
|
82
212
|
name: string;
|
|
83
213
|
file: string;
|
|
@@ -91,10 +221,13 @@ export interface CallSiteInfo {
|
|
|
91
221
|
// === METHOD CALL INFO ===
|
|
92
222
|
export interface MethodCallInfo {
|
|
93
223
|
id: string;
|
|
224
|
+
semanticId?: string; // Stable ID: file->scope->CALL->object.method#N
|
|
94
225
|
type: 'CALL';
|
|
95
226
|
name: string;
|
|
96
227
|
object: string;
|
|
97
228
|
method: string;
|
|
229
|
+
computed?: boolean; // Whether method was accessed via computed property [x]
|
|
230
|
+
computedPropertyVar?: string | null; // Variable name used in obj[x]() calls
|
|
98
231
|
file: string;
|
|
99
232
|
line: number;
|
|
100
233
|
column?: number;
|
|
@@ -106,6 +239,7 @@ export interface MethodCallInfo {
|
|
|
106
239
|
// === EVENT LISTENER INFO ===
|
|
107
240
|
export interface EventListenerInfo {
|
|
108
241
|
id: string;
|
|
242
|
+
semanticId?: string; // Stable ID: file->scope->EVENT_LISTENER->name#N
|
|
109
243
|
type: 'event:listener';
|
|
110
244
|
name: string;
|
|
111
245
|
object: string;
|
|
@@ -124,9 +258,21 @@ export interface ClassInstantiationInfo {
|
|
|
124
258
|
parentScopeId?: string;
|
|
125
259
|
}
|
|
126
260
|
|
|
261
|
+
// === CONSTRUCTOR CALL INFO ===
|
|
262
|
+
export interface ConstructorCallInfo {
|
|
263
|
+
id: string;
|
|
264
|
+
type: 'CONSTRUCTOR_CALL';
|
|
265
|
+
className: string;
|
|
266
|
+
isBuiltin: boolean;
|
|
267
|
+
file: string;
|
|
268
|
+
line: number;
|
|
269
|
+
column: number;
|
|
270
|
+
}
|
|
271
|
+
|
|
127
272
|
// === CLASS DECLARATION INFO ===
|
|
128
273
|
export interface ClassDeclarationInfo {
|
|
129
274
|
id: string;
|
|
275
|
+
semanticId?: string; // Stable ID: file->scope->CLASS->name
|
|
130
276
|
type: 'CLASS';
|
|
131
277
|
name: string;
|
|
132
278
|
file: string;
|
|
@@ -139,7 +285,12 @@ export interface ClassDeclarationInfo {
|
|
|
139
285
|
|
|
140
286
|
// === INTERFACE DECLARATION INFO ===
|
|
141
287
|
export interface InterfaceDeclarationInfo {
|
|
142
|
-
|
|
288
|
+
/**
|
|
289
|
+
* @deprecated ID is now generated by InterfaceNode.create() in GraphBuilder.
|
|
290
|
+
* This field will be removed in a future version.
|
|
291
|
+
*/
|
|
292
|
+
id?: string;
|
|
293
|
+
semanticId?: string; // Stable ID: file->scope->INTERFACE->name
|
|
143
294
|
type: 'INTERFACE';
|
|
144
295
|
name: string;
|
|
145
296
|
file: string;
|
|
@@ -158,7 +309,12 @@ export interface InterfacePropertyInfo {
|
|
|
158
309
|
|
|
159
310
|
// === TYPE ALIAS INFO ===
|
|
160
311
|
export interface TypeAliasInfo {
|
|
161
|
-
|
|
312
|
+
/**
|
|
313
|
+
* @deprecated ID is now generated by NodeFactory.createType() in GraphBuilder.
|
|
314
|
+
* This field will be removed in a future version.
|
|
315
|
+
*/
|
|
316
|
+
id?: string;
|
|
317
|
+
semanticId?: string; // Stable ID: file->scope->TYPE->name
|
|
162
318
|
type: 'TYPE';
|
|
163
319
|
name: string;
|
|
164
320
|
file: string;
|
|
@@ -169,7 +325,12 @@ export interface TypeAliasInfo {
|
|
|
169
325
|
|
|
170
326
|
// === ENUM DECLARATION INFO ===
|
|
171
327
|
export interface EnumDeclarationInfo {
|
|
172
|
-
|
|
328
|
+
/**
|
|
329
|
+
* @deprecated ID is now generated by EnumNode.create() in GraphBuilder.
|
|
330
|
+
* This field will be removed in a future version.
|
|
331
|
+
*/
|
|
332
|
+
id?: string;
|
|
333
|
+
semanticId?: string; // Stable ID: file->scope->ENUM->name
|
|
173
334
|
type: 'ENUM';
|
|
174
335
|
name: string;
|
|
175
336
|
file: string;
|
|
@@ -187,6 +348,7 @@ export interface EnumMemberInfo {
|
|
|
187
348
|
// === DECORATOR INFO ===
|
|
188
349
|
export interface DecoratorInfo {
|
|
189
350
|
id: string;
|
|
351
|
+
semanticId?: string; // Stable ID: file->target->DECORATOR->name#N
|
|
190
352
|
type: 'DECORATOR';
|
|
191
353
|
name: string;
|
|
192
354
|
file: string;
|
|
@@ -214,6 +376,11 @@ export interface CallArgumentInfo {
|
|
|
214
376
|
targetId?: string;
|
|
215
377
|
targetName?: string;
|
|
216
378
|
file?: string;
|
|
379
|
+
// REG-334: Additional fields for resolve/reject argument tracking
|
|
380
|
+
line?: number;
|
|
381
|
+
column?: number;
|
|
382
|
+
literalValue?: unknown;
|
|
383
|
+
expressionType?: string;
|
|
217
384
|
isSpread?: boolean;
|
|
218
385
|
functionLine?: number;
|
|
219
386
|
functionColumn?: number;
|
|
@@ -229,7 +396,11 @@ export interface ImportInfo {
|
|
|
229
396
|
source: string;
|
|
230
397
|
file: string;
|
|
231
398
|
line: number;
|
|
399
|
+
column?: number; // Column position for ImportNode
|
|
232
400
|
specifiers: ImportSpecifier[];
|
|
401
|
+
isDynamic?: boolean; // true for dynamic import() expressions
|
|
402
|
+
isResolvable?: boolean; // true if path is a string literal (statically analyzable)
|
|
403
|
+
dynamicPath?: string; // original expression for template/variable paths
|
|
233
404
|
}
|
|
234
405
|
|
|
235
406
|
export interface ImportSpecifier {
|
|
@@ -267,6 +438,7 @@ export interface HttpRequestInfo {
|
|
|
267
438
|
// === LITERAL INFO ===
|
|
268
439
|
export interface LiteralInfo {
|
|
269
440
|
id: string;
|
|
441
|
+
semanticId?: string; // Stable ID: file->scope->LITERAL->type#N
|
|
270
442
|
type: 'LITERAL' | 'CALL';
|
|
271
443
|
value?: unknown;
|
|
272
444
|
valueType?: string;
|
|
@@ -281,6 +453,207 @@ export interface LiteralInfo {
|
|
|
281
453
|
argIndex?: number;
|
|
282
454
|
}
|
|
283
455
|
|
|
456
|
+
// === OBJECT LITERAL INFO ===
|
|
457
|
+
export interface ObjectLiteralInfo {
|
|
458
|
+
id: string;
|
|
459
|
+
semanticId?: string; // Stable ID: file->scope->OBJECT_LITERAL->literal#N
|
|
460
|
+
type: 'OBJECT_LITERAL';
|
|
461
|
+
file: string;
|
|
462
|
+
line: number;
|
|
463
|
+
column: number;
|
|
464
|
+
parentCallId?: string;
|
|
465
|
+
argIndex?: number;
|
|
466
|
+
isSpread?: boolean;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// === OBJECT PROPERTY INFO ===
|
|
470
|
+
export interface ObjectPropertyInfo {
|
|
471
|
+
objectId: string;
|
|
472
|
+
propertyName: string;
|
|
473
|
+
valueNodeId?: string;
|
|
474
|
+
valueType: 'LITERAL' | 'VARIABLE' | 'CALL' | 'EXPRESSION' | 'OBJECT_LITERAL' | 'ARRAY_LITERAL' | 'SPREAD';
|
|
475
|
+
valueName?: string; // For VARIABLE
|
|
476
|
+
literalValue?: unknown; // For LITERAL
|
|
477
|
+
file: string;
|
|
478
|
+
line: number;
|
|
479
|
+
column: number;
|
|
480
|
+
// For CALL values
|
|
481
|
+
callLine?: number;
|
|
482
|
+
callColumn?: number;
|
|
483
|
+
// For nested object/array
|
|
484
|
+
nestedObjectId?: string;
|
|
485
|
+
nestedArrayId?: string;
|
|
486
|
+
// For VARIABLE values - scope path for scope-aware lookup (REG-329)
|
|
487
|
+
valueScopePath?: string[];
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// === ARRAY LITERAL INFO ===
|
|
491
|
+
export interface ArrayLiteralInfo {
|
|
492
|
+
id: string;
|
|
493
|
+
semanticId?: string; // Stable ID: file->scope->ARRAY_LITERAL->literal#N
|
|
494
|
+
type: 'ARRAY_LITERAL';
|
|
495
|
+
file: string;
|
|
496
|
+
line: number;
|
|
497
|
+
column: number;
|
|
498
|
+
parentCallId?: string;
|
|
499
|
+
argIndex?: number;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// === ARRAY ELEMENT INFO ===
|
|
503
|
+
export interface ArrayElementInfo {
|
|
504
|
+
arrayId: string;
|
|
505
|
+
index: number;
|
|
506
|
+
valueNodeId?: string;
|
|
507
|
+
valueType: 'LITERAL' | 'VARIABLE' | 'CALL' | 'EXPRESSION' | 'OBJECT_LITERAL' | 'ARRAY_LITERAL' | 'SPREAD';
|
|
508
|
+
valueName?: string; // For VARIABLE
|
|
509
|
+
literalValue?: unknown; // For LITERAL
|
|
510
|
+
file: string;
|
|
511
|
+
line: number;
|
|
512
|
+
column: number;
|
|
513
|
+
// For CALL values
|
|
514
|
+
callLine?: number;
|
|
515
|
+
callColumn?: number;
|
|
516
|
+
// For nested object/array
|
|
517
|
+
nestedObjectId?: string;
|
|
518
|
+
nestedArrayId?: string;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// === ARRAY MUTATION INFO ===
|
|
522
|
+
/**
|
|
523
|
+
* Tracks array mutation calls (push, unshift, splice) and indexed assignments
|
|
524
|
+
* Used to create FLOWS_INTO edges in GraphBuilder
|
|
525
|
+
*
|
|
526
|
+
* IMPORTANT: This type is defined ONLY here. Import from this file everywhere.
|
|
527
|
+
*/
|
|
528
|
+
export interface ArrayMutationInfo {
|
|
529
|
+
id?: string; // Semantic ID for the mutation (optional for backward compatibility)
|
|
530
|
+
arrayName: string; // Name of the array variable being mutated
|
|
531
|
+
arrayLine?: number; // Line where array is referenced (for scope resolution)
|
|
532
|
+
mutationScopePath?: string[]; // Scope path where mutation happens (from ScopeTracker)
|
|
533
|
+
mutationMethod: 'push' | 'unshift' | 'splice' | 'indexed';
|
|
534
|
+
file: string;
|
|
535
|
+
line: number;
|
|
536
|
+
column: number;
|
|
537
|
+
insertedValues: ArrayMutationArgument[]; // What's being added to the array
|
|
538
|
+
isNested?: boolean; // REG-117: true if receiver is MemberExpression
|
|
539
|
+
baseObjectName?: string; // REG-117: "obj" from obj.arr.push()
|
|
540
|
+
propertyName?: string; // REG-117: "arr" - the array property name
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export interface ArrayMutationArgument {
|
|
544
|
+
argIndex: number;
|
|
545
|
+
isSpread?: boolean;
|
|
546
|
+
valueType: 'LITERAL' | 'VARIABLE' | 'CALL' | 'EXPRESSION' | 'OBJECT_LITERAL' | 'ARRAY_LITERAL';
|
|
547
|
+
valueName?: string; // For VARIABLE type - name of the variable
|
|
548
|
+
valueNodeId?: string; // For LITERAL, OBJECT_LITERAL, ARRAY_LITERAL - node ID
|
|
549
|
+
literalValue?: unknown; // For LITERAL type
|
|
550
|
+
callLine?: number; // For CALL type
|
|
551
|
+
callColumn?: number;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
// === OBJECT MUTATION INFO ===
|
|
555
|
+
/**
|
|
556
|
+
* Tracks object property mutations for FLOWS_INTO edge creation in GraphBuilder.
|
|
557
|
+
* Handles: obj.prop = value, obj['prop'] = value, Object.assign(), spread in object literals.
|
|
558
|
+
*
|
|
559
|
+
* IMPORTANT: This type is defined ONLY here. Import from this file everywhere.
|
|
560
|
+
*/
|
|
561
|
+
export interface ObjectMutationInfo {
|
|
562
|
+
id?: string; // Semantic ID for the mutation (optional for backward compatibility)
|
|
563
|
+
objectName: string; // Name of the object being mutated ('config', 'this', etc.)
|
|
564
|
+
objectLine?: number; // Line where object is referenced (for scope resolution)
|
|
565
|
+
mutationScopePath?: string[]; // Scope path where mutation happens (from ScopeTracker)
|
|
566
|
+
enclosingClassName?: string; // Class name when objectName === 'this' (REG-152)
|
|
567
|
+
propertyName: string; // Property name or '<computed>' for obj[x] or '<assign>' for Object.assign
|
|
568
|
+
mutationType: 'property' | 'computed' | 'assign' | 'spread';
|
|
569
|
+
computedPropertyVar?: string; // Variable name in obj[key] = value (for computed mutation type)
|
|
570
|
+
file: string;
|
|
571
|
+
line: number;
|
|
572
|
+
column: number;
|
|
573
|
+
value: ObjectMutationValue;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export interface ObjectMutationValue {
|
|
577
|
+
valueType: 'LITERAL' | 'VARIABLE' | 'CALL' | 'EXPRESSION' | 'OBJECT_LITERAL' | 'ARRAY_LITERAL';
|
|
578
|
+
valueName?: string; // For VARIABLE type - name of the variable
|
|
579
|
+
valueNodeId?: string; // For LITERAL, OBJECT_LITERAL, ARRAY_LITERAL - node ID
|
|
580
|
+
literalValue?: unknown; // For LITERAL type
|
|
581
|
+
callLine?: number; // For CALL type
|
|
582
|
+
callColumn?: number;
|
|
583
|
+
isSpread?: boolean; // For Object.assign with spread: Object.assign(target, ...sources)
|
|
584
|
+
argIndex?: number; // For Object.assign - which source argument (0, 1, 2, ...)
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// === RETURN STATEMENT INFO ===
|
|
588
|
+
/**
|
|
589
|
+
* Tracks return statements for RETURNS edge creation in GraphBuilder.
|
|
590
|
+
* Used to connect returned expressions to their containing functions.
|
|
591
|
+
*
|
|
592
|
+
* Edge direction: returnExpression --RETURNS--> function
|
|
593
|
+
*/
|
|
594
|
+
export interface ReturnStatementInfo {
|
|
595
|
+
parentFunctionId: string; // ID of the containing function
|
|
596
|
+
file: string;
|
|
597
|
+
line: number;
|
|
598
|
+
column: number;
|
|
599
|
+
// Return value type determines how to resolve the source node
|
|
600
|
+
returnValueType: 'VARIABLE' | 'CALL_SITE' | 'METHOD_CALL' | 'LITERAL' | 'EXPRESSION' | 'NONE';
|
|
601
|
+
// For VARIABLE type
|
|
602
|
+
returnValueName?: string;
|
|
603
|
+
// For LITERAL type - the literal node ID
|
|
604
|
+
returnValueId?: string;
|
|
605
|
+
// For CALL_SITE/METHOD_CALL type - coordinates for lookup
|
|
606
|
+
returnValueLine?: number;
|
|
607
|
+
returnValueColumn?: number;
|
|
608
|
+
returnValueCallName?: string;
|
|
609
|
+
// For EXPRESSION type (BinaryExpression, ConditionalExpression, etc.)
|
|
610
|
+
expressionType?: string;
|
|
611
|
+
|
|
612
|
+
// For EXPRESSION type - source variable extraction (REG-276)
|
|
613
|
+
// Mirrors VariableAssignmentInfo pattern for code reuse
|
|
614
|
+
|
|
615
|
+
// For BinaryExpression/LogicalExpression
|
|
616
|
+
operator?: string;
|
|
617
|
+
leftSourceName?: string;
|
|
618
|
+
rightSourceName?: string;
|
|
619
|
+
|
|
620
|
+
// For ConditionalExpression
|
|
621
|
+
consequentSourceName?: string;
|
|
622
|
+
alternateSourceName?: string;
|
|
623
|
+
|
|
624
|
+
// For MemberExpression
|
|
625
|
+
object?: string;
|
|
626
|
+
property?: string;
|
|
627
|
+
computed?: boolean;
|
|
628
|
+
objectSourceName?: string;
|
|
629
|
+
|
|
630
|
+
// For TemplateLiteral
|
|
631
|
+
expressionSourceNames?: string[];
|
|
632
|
+
|
|
633
|
+
// For UnaryExpression
|
|
634
|
+
unaryArgSourceName?: string;
|
|
635
|
+
|
|
636
|
+
// For arrow function implicit returns
|
|
637
|
+
isImplicitReturn?: boolean;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Resolution status for computed property names.
|
|
642
|
+
* Used in FLOWS_INTO edge metadata to indicate how property name was determined.
|
|
643
|
+
*
|
|
644
|
+
* - RESOLVED: Single deterministic value traced from literals
|
|
645
|
+
* - RESOLVED_CONDITIONAL: Multiple possible values (ternary, logical OR, etc.)
|
|
646
|
+
* - UNKNOWN_PARAMETER: Variable traces to function parameter
|
|
647
|
+
* - UNKNOWN_RUNTIME: Variable traces to function call result
|
|
648
|
+
* - DEFERRED_CROSS_FILE: Variable traces to import (requires cross-file analysis)
|
|
649
|
+
*/
|
|
650
|
+
export type ResolutionStatus =
|
|
651
|
+
| 'RESOLVED'
|
|
652
|
+
| 'RESOLVED_CONDITIONAL'
|
|
653
|
+
| 'UNKNOWN_PARAMETER'
|
|
654
|
+
| 'UNKNOWN_RUNTIME'
|
|
655
|
+
| 'DEFERRED_CROSS_FILE';
|
|
656
|
+
|
|
284
657
|
// === VARIABLE ASSIGNMENT INFO ===
|
|
285
658
|
export interface VariableAssignmentInfo {
|
|
286
659
|
variableId: string;
|
|
@@ -296,6 +669,7 @@ export interface VariableAssignmentInfo {
|
|
|
296
669
|
className?: string;
|
|
297
670
|
functionName?: string;
|
|
298
671
|
line?: number;
|
|
672
|
+
column?: number; // Column position for EXPRESSION nodes
|
|
299
673
|
expressionType?: string;
|
|
300
674
|
object?: string;
|
|
301
675
|
property?: string;
|
|
@@ -309,6 +683,165 @@ export interface VariableAssignmentInfo {
|
|
|
309
683
|
alternateSourceName?: string | null;
|
|
310
684
|
expressionSourceNames?: string[];
|
|
311
685
|
file?: string;
|
|
686
|
+
// Destructuring support (REG-201)
|
|
687
|
+
path?: string; // Full property path string, e.g., "req.headers.contentType"
|
|
688
|
+
baseName?: string; // Base object name, e.g., "req"
|
|
689
|
+
propertyPath?: string[]; // Property path array, e.g., ["headers", "contentType"]
|
|
690
|
+
arrayIndex?: number; // Array index for array destructuring, e.g., 0 for first element
|
|
691
|
+
|
|
692
|
+
// Call-based destructuring support (REG-223)
|
|
693
|
+
callSourceLine?: number; // Line of the CallExpression
|
|
694
|
+
callSourceColumn?: number; // Column of the CallExpression
|
|
695
|
+
callSourceFile?: string; // File containing the call
|
|
696
|
+
callSourceName?: string; // Function name (for lookup disambiguation)
|
|
697
|
+
sourceMetadata?: {
|
|
698
|
+
sourceType: 'call' | 'variable' | 'method-call';
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
// === VARIABLE REASSIGNMENT INFO ===
|
|
703
|
+
/**
|
|
704
|
+
* Tracks variable reassignments for FLOWS_INTO edge creation.
|
|
705
|
+
* Used when a variable is assigned AFTER its declaration: x = y (not const x = y).
|
|
706
|
+
*
|
|
707
|
+
* Edge direction: value --FLOWS_INTO--> variable
|
|
708
|
+
*
|
|
709
|
+
* Supports:
|
|
710
|
+
* - Simple assignment: x = y
|
|
711
|
+
* - Compound operators: x += y, x -= y, x *= y, x /= y, x %= y, x **= y
|
|
712
|
+
* - Bitwise operators: x &= y, x |= y, x ^= y, x <<= y, x >>= y, x >>>= y
|
|
713
|
+
* - Logical operators: x &&= y, x ||= y, x ??= y
|
|
714
|
+
*
|
|
715
|
+
* For compound operators (operator !== '='), creates TWO edges:
|
|
716
|
+
* - READS_FROM: variable --READS_FROM--> variable (self-loop, reads current value)
|
|
717
|
+
* - FLOWS_INTO: source --FLOWS_INTO--> variable (writes new value)
|
|
718
|
+
*
|
|
719
|
+
* Distinction from VariableAssignmentInfo:
|
|
720
|
+
* - VariableAssignmentInfo: initialization (const x = y) -> ASSIGNED_FROM edge
|
|
721
|
+
* - VariableReassignmentInfo: mutation (x = y, x += y) -> FLOWS_INTO edge
|
|
722
|
+
*/
|
|
723
|
+
export interface VariableReassignmentInfo {
|
|
724
|
+
variableName: string; // Name of variable being reassigned
|
|
725
|
+
variableLine: number; // Line where variable is referenced on LHS
|
|
726
|
+
mutationScopePath?: string[]; // Scope path where mutation happens (from ScopeTracker)
|
|
727
|
+
valueType: 'VARIABLE' | 'CALL_SITE' | 'METHOD_CALL' | 'LITERAL' | 'EXPRESSION';
|
|
728
|
+
valueName?: string; // For VARIABLE, CALL_SITE types
|
|
729
|
+
valueId?: string | null; // For LITERAL, EXPRESSION types
|
|
730
|
+
callLine?: number; // For CALL_SITE, METHOD_CALL types
|
|
731
|
+
callColumn?: number;
|
|
732
|
+
operator: string; // '=', '+=', '-=', '*=', etc.
|
|
733
|
+
|
|
734
|
+
// For LITERAL type - complete metadata for node creation
|
|
735
|
+
literalValue?: unknown; // Actual literal value (number, string, boolean, null)
|
|
736
|
+
|
|
737
|
+
// For EXPRESSION type - complete metadata for node creation
|
|
738
|
+
expressionType?: string; // 'MemberExpression', 'BinaryExpression', 'ConditionalExpression', etc.
|
|
739
|
+
expressionMetadata?: { // Type-specific metadata (matches VariableAssignmentInfo pattern)
|
|
740
|
+
// MemberExpression
|
|
741
|
+
object?: string;
|
|
742
|
+
property?: string;
|
|
743
|
+
computed?: boolean;
|
|
744
|
+
computedPropertyVar?: string | null;
|
|
745
|
+
|
|
746
|
+
// BinaryExpression, LogicalExpression
|
|
747
|
+
operator?: string;
|
|
748
|
+
leftSourceName?: string;
|
|
749
|
+
rightSourceName?: string;
|
|
750
|
+
|
|
751
|
+
// ConditionalExpression
|
|
752
|
+
consequentSourceName?: string;
|
|
753
|
+
alternateSourceName?: string;
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
file: string;
|
|
757
|
+
line: number; // Line of assignment statement
|
|
758
|
+
column: number;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
// === UPDATE EXPRESSION INFO (i++, obj.prop++, arr[i]++) ===
|
|
762
|
+
/**
|
|
763
|
+
* Information about update expressions (increment/decrement).
|
|
764
|
+
*
|
|
765
|
+
* Supports two target types:
|
|
766
|
+
* - IDENTIFIER: Simple variable (i++, --count)
|
|
767
|
+
* - MEMBER_EXPRESSION: Object property (obj.prop++, arr[i]++, this.count++)
|
|
768
|
+
*
|
|
769
|
+
* Creates:
|
|
770
|
+
* - UPDATE_EXPRESSION node with operator and target metadata
|
|
771
|
+
* - MODIFIES edge: UPDATE_EXPRESSION -> target (VARIABLE, PARAMETER, or CLASS)
|
|
772
|
+
* - READS_FROM self-loop: target -> target (reads current value before update)
|
|
773
|
+
* - CONTAINS edge: SCOPE -> UPDATE_EXPRESSION
|
|
774
|
+
*
|
|
775
|
+
* REG-288: Initial implementation for IDENTIFIER targets
|
|
776
|
+
* REG-312: Extended for MEMBER_EXPRESSION targets (obj.prop++, arr[i]++)
|
|
777
|
+
*/
|
|
778
|
+
export interface UpdateExpressionInfo {
|
|
779
|
+
// Common fields for all update expressions
|
|
780
|
+
operator: '++' | '--'; // Increment or decrement
|
|
781
|
+
prefix: boolean; // ++i (true) vs i++ (false)
|
|
782
|
+
file: string;
|
|
783
|
+
line: number; // Line of update expression
|
|
784
|
+
column: number;
|
|
785
|
+
parentScopeId?: string; // Containing scope for CONTAINS edge
|
|
786
|
+
|
|
787
|
+
// Discriminator: IDENTIFIER (i++) vs MEMBER_EXPRESSION (obj.prop++)
|
|
788
|
+
targetType: 'IDENTIFIER' | 'MEMBER_EXPRESSION';
|
|
789
|
+
|
|
790
|
+
// ===== IDENTIFIER fields (REG-288 behavior) =====
|
|
791
|
+
variableName?: string; // Name of variable being modified (for i++)
|
|
792
|
+
variableLine?: number; // Line where variable is referenced
|
|
793
|
+
|
|
794
|
+
// ===== MEMBER_EXPRESSION fields (REG-312 new) =====
|
|
795
|
+
objectName?: string; // Object name ("obj" from obj.prop++, "this" from this.count++)
|
|
796
|
+
objectLine?: number; // Line where object is referenced (for scope resolution)
|
|
797
|
+
enclosingClassName?: string; // Class name when objectName === 'this' (follows REG-152 pattern)
|
|
798
|
+
propertyName?: string; // Property name ("prop" from obj.prop++, "<computed>" for obj[key]++)
|
|
799
|
+
mutationType?: 'property' | 'computed'; // 'property' for obj.prop++, 'computed' for obj[key]++
|
|
800
|
+
computedPropertyVar?: string; // Variable name for computed access: obj[i]++ -> "i"
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
// === PROMISE EXECUTOR CONTEXT ===
|
|
804
|
+
/**
|
|
805
|
+
* Tracks Promise executor context during analysis.
|
|
806
|
+
* Used to detect when resolve/reject calls should create RESOLVES_TO edges.
|
|
807
|
+
*
|
|
808
|
+
* Stored in collections.promiseExecutorContexts Map, keyed by executor function's start:end position.
|
|
809
|
+
*/
|
|
810
|
+
export interface PromiseExecutorContext {
|
|
811
|
+
/** ID of the CONSTRUCTOR_CALL node for `new Promise()` */
|
|
812
|
+
constructorCallId: string;
|
|
813
|
+
/** Name of the first parameter (typically 'resolve') */
|
|
814
|
+
resolveName: string;
|
|
815
|
+
/** Name of the second parameter (typically 'reject'), if any */
|
|
816
|
+
rejectName?: string;
|
|
817
|
+
/** File path for edge creation */
|
|
818
|
+
file: string;
|
|
819
|
+
/** Line of the Promise constructor for debugging */
|
|
820
|
+
line: number;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// === PROMISE RESOLUTION INFO ===
|
|
824
|
+
/**
|
|
825
|
+
* Info for Promise resolution RESOLVES_TO edges.
|
|
826
|
+
* Created when resolve(value) or reject(error) is called inside Promise executor.
|
|
827
|
+
*
|
|
828
|
+
* Graph structure:
|
|
829
|
+
* CALL[resolve(42)] --RESOLVES_TO--> CONSTRUCTOR_CALL[new Promise]
|
|
830
|
+
*
|
|
831
|
+
* Edge direction: resolve CALL -> Promise CONSTRUCTOR_CALL
|
|
832
|
+
* This allows traceValues to follow RESOLVES_TO from Promise to find data sources.
|
|
833
|
+
*/
|
|
834
|
+
export interface PromiseResolutionInfo {
|
|
835
|
+
/** ID of the resolve/reject CALL node */
|
|
836
|
+
callId: string;
|
|
837
|
+
/** ID of the Promise CONSTRUCTOR_CALL node */
|
|
838
|
+
constructorCallId: string;
|
|
839
|
+
/** True if this is reject(), false for resolve() */
|
|
840
|
+
isReject: boolean;
|
|
841
|
+
/** File path */
|
|
842
|
+
file: string;
|
|
843
|
+
/** Line number of resolve/reject call */
|
|
844
|
+
line: number;
|
|
312
845
|
}
|
|
313
846
|
|
|
314
847
|
// === COUNTER REF ===
|
|
@@ -335,11 +868,20 @@ export interface ASTCollections {
|
|
|
335
868
|
functions: FunctionInfo[];
|
|
336
869
|
parameters?: ParameterInfo[];
|
|
337
870
|
scopes: ScopeInfo[];
|
|
871
|
+
// Branching
|
|
872
|
+
branches?: BranchInfo[];
|
|
873
|
+
cases?: CaseInfo[];
|
|
874
|
+
// Control flow (new)
|
|
875
|
+
loops?: LoopInfo[];
|
|
876
|
+
tryBlocks?: TryBlockInfo[];
|
|
877
|
+
catchBlocks?: CatchBlockInfo[];
|
|
878
|
+
finallyBlocks?: FinallyBlockInfo[];
|
|
338
879
|
variableDeclarations: VariableDeclarationInfo[];
|
|
339
880
|
callSites: CallSiteInfo[];
|
|
340
881
|
methodCalls?: MethodCallInfo[];
|
|
341
882
|
eventListeners?: EventListenerInfo[];
|
|
342
883
|
classInstantiations?: ClassInstantiationInfo[];
|
|
884
|
+
constructorCalls?: ConstructorCallInfo[];
|
|
343
885
|
classDeclarations?: ClassDeclarationInfo[];
|
|
344
886
|
methodCallbacks?: MethodCallbackInfo[];
|
|
345
887
|
callArguments?: CallArgumentInfo[];
|
|
@@ -348,6 +890,25 @@ export interface ASTCollections {
|
|
|
348
890
|
httpRequests?: HttpRequestInfo[];
|
|
349
891
|
literals?: LiteralInfo[];
|
|
350
892
|
variableAssignments?: VariableAssignmentInfo[];
|
|
893
|
+
// Object/Array literal tracking for data flow
|
|
894
|
+
objectLiterals?: ObjectLiteralInfo[];
|
|
895
|
+
objectProperties?: ObjectPropertyInfo[];
|
|
896
|
+
arrayLiterals?: ArrayLiteralInfo[];
|
|
897
|
+
arrayElements?: ArrayElementInfo[];
|
|
898
|
+
// Array mutation tracking for FLOWS_INTO edges
|
|
899
|
+
arrayMutations?: ArrayMutationInfo[];
|
|
900
|
+
// Object mutation tracking for FLOWS_INTO edges
|
|
901
|
+
objectMutations?: ObjectMutationInfo[];
|
|
902
|
+
// Variable reassignment tracking for FLOWS_INTO edges (REG-290)
|
|
903
|
+
variableReassignments?: VariableReassignmentInfo[];
|
|
904
|
+
// Return statement tracking for RETURNS edges
|
|
905
|
+
returnStatements?: ReturnStatementInfo[];
|
|
906
|
+
// Update expression tracking (i++, obj.prop++, arr[i]++) for MODIFIES edges (REG-288, REG-312)
|
|
907
|
+
updateExpressions?: UpdateExpressionInfo[];
|
|
908
|
+
// Promise resolution tracking for RESOLVES_TO edges (REG-334)
|
|
909
|
+
promiseResolutions?: PromiseResolutionInfo[];
|
|
910
|
+
// Promise executor contexts (REG-334) - keyed by executor function's start:end position
|
|
911
|
+
promiseExecutorContexts?: Map<string, PromiseExecutorContext>;
|
|
351
912
|
// TypeScript-specific collections
|
|
352
913
|
interfaces?: InterfaceDeclarationInfo[];
|
|
353
914
|
typeAliases?: TypeAliasInfo[];
|
|
@@ -361,7 +922,18 @@ export interface ASTCollections {
|
|
|
361
922
|
functionCounterRef?: CounterRef;
|
|
362
923
|
httpRequestCounterRef?: CounterRef;
|
|
363
924
|
literalCounterRef?: CounterRef;
|
|
925
|
+
objectLiteralCounterRef?: CounterRef;
|
|
926
|
+
arrayLiteralCounterRef?: CounterRef;
|
|
927
|
+
branchCounterRef?: CounterRef;
|
|
928
|
+
caseCounterRef?: CounterRef;
|
|
929
|
+
// Counter refs for control flow (add)
|
|
930
|
+
loopCounterRef?: CounterRef;
|
|
931
|
+
tryBlockCounterRef?: CounterRef;
|
|
932
|
+
catchBlockCounterRef?: CounterRef;
|
|
933
|
+
finallyBlockCounterRef?: CounterRef;
|
|
364
934
|
processedNodes?: ProcessedNodes;
|
|
935
|
+
// ScopeTracker for semantic ID generation
|
|
936
|
+
scopeTracker?: import('../../../core/ScopeTracker.js').ScopeTracker;
|
|
365
937
|
}
|
|
366
938
|
|
|
367
939
|
// === EXTRACTED VARIABLE ===
|
|
@@ -381,6 +953,12 @@ export interface GraphNode {
|
|
|
381
953
|
file?: string;
|
|
382
954
|
line?: number;
|
|
383
955
|
column?: number;
|
|
956
|
+
// IMPORT node fields
|
|
957
|
+
source?: string;
|
|
958
|
+
importType?: 'default' | 'named' | 'namespace';
|
|
959
|
+
importBinding?: 'value' | 'type' | 'typeof';
|
|
960
|
+
imported?: string;
|
|
961
|
+
local?: string;
|
|
384
962
|
[key: string]: unknown;
|
|
385
963
|
}
|
|
386
964
|
|
|
@@ -390,6 +968,18 @@ export interface GraphEdge {
|
|
|
390
968
|
src: string;
|
|
391
969
|
dst: string;
|
|
392
970
|
index?: number;
|
|
971
|
+
// For FLOWS_INTO edges (array mutations)
|
|
972
|
+
mutationMethod?: string;
|
|
973
|
+
argIndex?: number;
|
|
974
|
+
isSpread?: boolean;
|
|
975
|
+
nestedProperty?: string; // REG-117: Property name for nested mutations (obj.arr.push -> "arr")
|
|
976
|
+
// For FLOWS_INTO edges (object mutations)
|
|
977
|
+
mutationType?: 'property' | 'computed' | 'assign' | 'spread' | 'this_property';
|
|
978
|
+
propertyName?: string;
|
|
979
|
+
// For computed property resolution (enrichment phase)
|
|
980
|
+
computedPropertyVar?: string; // Variable name for obj[key] patterns
|
|
981
|
+
resolvedPropertyNames?: string[]; // Resolved names after enrichment
|
|
982
|
+
resolutionStatus?: ResolutionStatus; // How resolution was determined
|
|
393
983
|
metadata?: Record<string, unknown>;
|
|
394
984
|
}
|
|
395
985
|
|