@grafema/core 0.1.0-alpha.4 → 0.1.1-alpha
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 +24 -2
- package/dist/Orchestrator.d.ts.map +1 -1
- package/dist/Orchestrator.js +197 -24
- package/dist/config/ConfigLoader.d.ts +72 -0
- package/dist/config/ConfigLoader.d.ts.map +1 -0
- package/dist/config/ConfigLoader.js +187 -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/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 +225 -17
- package/dist/core/NodeFactory.d.ts.map +1 -1
- package/dist/core/NodeFactory.js +208 -18
- 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 +41 -0
- package/dist/core/nodes/CallSiteNode.d.ts +28 -0
- package/dist/core/nodes/CallSiteNode.d.ts.map +1 -1
- package/dist/core/nodes/CallSiteNode.js +46 -0
- package/dist/core/nodes/ClassNode.d.ts +33 -1
- package/dist/core/nodes/ClassNode.d.ts.map +1 -1
- package/dist/core/nodes/ClassNode.js +46 -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 +62 -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 +54 -0
- package/dist/core/nodes/ExportNode.d.ts +37 -1
- package/dist/core/nodes/ExportNode.d.ts.map +1 -1
- package/dist/core/nodes/ExportNode.js +48 -2
- 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 +178 -0
- package/dist/core/nodes/ExternalModuleNode.d.ts +28 -0
- package/dist/core/nodes/ExternalModuleNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalModuleNode.js +41 -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/ImportNode.d.ts +19 -5
- package/dist/core/nodes/ImportNode.d.ts.map +1 -1
- package/dist/core/nodes/ImportNode.js +23 -5
- 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 +55 -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/MethodCallNode.d.ts +30 -0
- package/dist/core/nodes/MethodCallNode.d.ts.map +1 -1
- package/dist/core/nodes/MethodCallNode.js +49 -0
- package/dist/core/nodes/MethodNode.d.ts +32 -0
- package/dist/core/nodes/MethodNode.d.ts.map +1 -1
- package/dist/core/nodes/MethodNode.js +48 -0
- 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 +41 -0
- 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 +53 -0
- package/dist/core/nodes/VariableDeclarationNode.d.ts +27 -0
- package/dist/core/nodes/VariableDeclarationNode.d.ts.map +1 -1
- package/dist/core/nodes/VariableDeclarationNode.js +40 -0
- package/dist/core/nodes/index.d.ts +12 -1
- package/dist/core/nodes/index.d.ts.map +1 -1
- package/dist/core/nodes/index.js +14 -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 +77 -0
- package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -0
- package/dist/diagnostics/DiagnosticReporter.js +159 -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 +118 -0
- package/dist/errors/GrafemaError.d.ts.map +1 -0
- package/dist/errors/GrafemaError.js +131 -0
- package/dist/index.d.ts +57 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -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 +13 -6
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressAnalyzer.js +27 -19
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +21 -14
- package/dist/plugins/analysis/FetchAnalyzer.d.ts +1 -0
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/FetchAnalyzer.js +34 -14
- 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 +180 -17
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/JSASTAnalyzer.js +1171 -471
- 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 +15 -10
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
- package/dist/plugins/analysis/SQLiteAnalyzer.js +9 -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.map +1 -1
- package/dist/plugins/analysis/SocketIOAnalyzer.js +27 -15
- 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 +34 -4
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/GraphBuilder.js +318 -298
- 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 +176 -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 +9 -4
- 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 +99 -9
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +663 -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 +4 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +128 -63
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +11 -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 +4 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +17 -13
- 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 +136 -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 +14 -8
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +14 -7
- 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 +18 -12
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
- package/dist/plugins/enrichment/MountPointResolver.js +8 -3
- 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 +17 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +129 -10
- 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.map +1 -1
- package/dist/plugins/indexing/JSModuleIndexer.js +63 -31
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -1
- package/dist/plugins/indexing/RustModuleIndexer.js +5 -4
- 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/CallResolverValidator.d.ts.map +1 -1
- package/dist/plugins/validation/CallResolverValidator.js +8 -7
- package/dist/plugins/validation/DataFlowValidator.d.ts.map +1 -1
- package/dist/plugins/validation/DataFlowValidator.js +17 -12
- 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 +19 -23
- 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 +59 -16
- 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/storage/backends/RFDBServerBackend.d.ts +10 -17
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +31 -10
- package/dist/validation/PathValidator.d.ts +1 -2
- package/dist/validation/PathValidator.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/Orchestrator.ts +237 -24
- package/src/config/ConfigLoader.ts +263 -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/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 +401 -18
- 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 +65 -0
- package/src/core/nodes/CallSiteNode.ts +58 -0
- package/src/core/nodes/ClassNode.ts +63 -2
- package/src/core/nodes/DecoratorNode.ts +91 -0
- package/src/core/nodes/EnumNode.ts +86 -0
- package/src/core/nodes/ExportNode.ts +70 -2
- package/src/core/nodes/ExpressionNode.ts +231 -0
- package/src/core/nodes/ExternalModuleNode.ts +56 -0
- package/src/core/nodes/ExternalStdioNode.ts +17 -9
- package/src/core/nodes/FunctionNode.ts +101 -1
- package/src/core/nodes/ImportNode.ts +32 -10
- package/src/core/nodes/InterfaceNode.ts +91 -0
- package/src/core/nodes/IssueNode.ts +177 -0
- package/src/core/nodes/MethodCallNode.ts +64 -0
- package/src/core/nodes/MethodNode.ts +63 -0
- package/src/core/nodes/ModuleNode.ts +50 -0
- package/src/core/nodes/NetworkRequestNode.ts +77 -0
- package/src/core/nodes/ObjectLiteralNode.ts +65 -0
- package/src/core/nodes/ScopeNode.ts +65 -0
- package/src/core/nodes/TypeNode.ts +78 -0
- package/src/core/nodes/VariableDeclarationNode.ts +52 -0
- package/src/core/nodes/index.ts +18 -1
- package/src/diagnostics/DiagnosticCollector.ts +163 -0
- package/src/diagnostics/DiagnosticReporter.ts +204 -0
- package/src/diagnostics/DiagnosticWriter.ts +50 -0
- package/src/diagnostics/index.ts +16 -0
- package/src/errors/GrafemaError.ts +174 -0
- package/src/index.ts +148 -1
- package/src/logging/Logger.ts +152 -0
- package/src/plugins/Plugin.ts +42 -0
- package/src/plugins/analysis/DatabaseAnalyzer.ts +14 -8
- package/src/plugins/analysis/ExpressAnalyzer.ts +29 -19
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +22 -21
- package/src/plugins/analysis/FetchAnalyzer.ts +39 -16
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +84 -101
- package/src/plugins/analysis/JSASTAnalyzer.ts +1483 -503
- package/src/plugins/analysis/ReactAnalyzer.ts +57 -57
- package/src/plugins/analysis/RustAnalyzer.ts +15 -10
- package/src/plugins/analysis/SQLiteAnalyzer.ts +10 -7
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +22 -16
- package/src/plugins/analysis/SocketIOAnalyzer.ts +31 -22
- package/src/plugins/analysis/SystemDbAnalyzer.ts +16 -11
- package/src/plugins/analysis/ast/GraphBuilder.ts +439 -327
- package/src/plugins/analysis/ast/IdGenerator.ts +177 -0
- package/src/plugins/analysis/ast/types.ts +209 -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 +11 -8
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +909 -83
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +97 -44
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +159 -93
- package/src/plugins/analysis/ast/visitors/ImportExportVisitor.ts +12 -8
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +41 -14
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +37 -17
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +3 -2
- package/src/plugins/discovery/SimpleProjectDiscovery.ts +6 -1
- package/src/plugins/discovery/WorkspaceDiscovery.ts +177 -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 +14 -8
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +14 -7
- package/src/plugins/enrichment/ImportExportLinker.ts +24 -6
- package/src/plugins/enrichment/MethodCallResolver.ts +18 -12
- package/src/plugins/enrichment/MountPointResolver.ts +8 -3
- package/src/plugins/enrichment/PrefixEvaluator.ts +16 -7
- package/src/plugins/enrichment/RustFFIEnricher.ts +6 -5
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +149 -12
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +23 -14
- package/src/plugins/indexing/JSModuleIndexer.ts +74 -34
- package/src/plugins/indexing/RustModuleIndexer.ts +5 -4
- package/src/plugins/validation/CallResolverValidator.ts +8 -7
- package/src/plugins/validation/DataFlowValidator.ts +16 -12
- package/src/plugins/validation/EvalBanValidator.ts +17 -16
- package/src/plugins/validation/GraphConnectivityValidator.ts +19 -23
- package/src/plugins/validation/NodeCreationValidator.ts +554 -0
- package/src/plugins/validation/SQLInjectionValidator.ts +61 -15
- 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/storage/backends/RFDBServerBackend.ts +43 -29
- 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
|
@@ -22,22 +22,20 @@ import type {
|
|
|
22
22
|
import type { NodePath } from '@babel/traverse';
|
|
23
23
|
import { ASTVisitor, type VisitorModule, type VisitorCollections, type VisitorHandlers } from './ASTVisitor.js';
|
|
24
24
|
import type { AnalyzeFunctionBodyCallback } from './FunctionVisitor.js';
|
|
25
|
-
import type { DecoratorInfo } from '../types.js';
|
|
25
|
+
import type { DecoratorInfo, ParameterInfo } from '../types.js';
|
|
26
26
|
import { ExpressionEvaluator } from '../ExpressionEvaluator.js';
|
|
27
|
+
import { createParameterNodes } from '../utils/createParameterNodes.js';
|
|
28
|
+
import { ScopeTracker } from '../../../../core/ScopeTracker.js';
|
|
29
|
+
import { ClassNode, type ClassNodeRecord } from '../../../../core/nodes/ClassNode.js';
|
|
30
|
+
import { computeSemanticId } from '../../../../core/SemanticId.js';
|
|
31
|
+
import { getLine, getColumn } from '../utils/location.js';
|
|
27
32
|
|
|
28
33
|
/**
|
|
29
34
|
* Class declaration info
|
|
35
|
+
* Extends ClassNodeRecord with TypeScript-specific metadata
|
|
30
36
|
*/
|
|
31
|
-
interface ClassInfo {
|
|
32
|
-
|
|
33
|
-
type: 'CLASS';
|
|
34
|
-
name: string;
|
|
35
|
-
file: string;
|
|
36
|
-
line: number;
|
|
37
|
-
column: number;
|
|
38
|
-
superClass: string | null;
|
|
39
|
-
implements?: string[]; // TypeScript implements
|
|
40
|
-
methods: string[];
|
|
37
|
+
interface ClassInfo extends ClassNodeRecord {
|
|
38
|
+
implements?: string[]; // TypeScript implements (visitor extension)
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
/**
|
|
@@ -45,7 +43,6 @@ interface ClassInfo {
|
|
|
45
43
|
*/
|
|
46
44
|
interface ClassFunctionInfo {
|
|
47
45
|
id: string;
|
|
48
|
-
stableId: string;
|
|
49
46
|
type: 'FUNCTION';
|
|
50
47
|
name: string;
|
|
51
48
|
file: string;
|
|
@@ -58,6 +55,7 @@ interface ClassFunctionInfo {
|
|
|
58
55
|
isClassMethod?: boolean;
|
|
59
56
|
className: string;
|
|
60
57
|
methodKind?: 'constructor' | 'method' | 'get' | 'set';
|
|
58
|
+
legacyId?: string; // Kept for debugging/migration purposes
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
/**
|
|
@@ -65,6 +63,7 @@ interface ClassFunctionInfo {
|
|
|
65
63
|
*/
|
|
66
64
|
interface ScopeInfo {
|
|
67
65
|
id: string;
|
|
66
|
+
semanticId?: string;
|
|
68
67
|
type: 'SCOPE';
|
|
69
68
|
scopeType: string;
|
|
70
69
|
name: string;
|
|
@@ -76,19 +75,23 @@ interface ScopeInfo {
|
|
|
76
75
|
|
|
77
76
|
export class ClassVisitor extends ASTVisitor {
|
|
78
77
|
private analyzeFunctionBody: AnalyzeFunctionBodyCallback;
|
|
78
|
+
private scopeTracker: ScopeTracker;
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* @param module - Current module being analyzed
|
|
82
82
|
* @param collections - Must contain arrays and counter refs
|
|
83
83
|
* @param analyzeFunctionBody - Callback to analyze method internals
|
|
84
|
+
* @param scopeTracker - REQUIRED for semantic ID generation
|
|
84
85
|
*/
|
|
85
86
|
constructor(
|
|
86
87
|
module: VisitorModule,
|
|
87
88
|
collections: VisitorCollections,
|
|
88
|
-
analyzeFunctionBody: AnalyzeFunctionBodyCallback
|
|
89
|
+
analyzeFunctionBody: AnalyzeFunctionBodyCallback,
|
|
90
|
+
scopeTracker: ScopeTracker // REQUIRED, not optional
|
|
89
91
|
) {
|
|
90
92
|
super(module, collections);
|
|
91
93
|
this.analyzeFunctionBody = analyzeFunctionBody;
|
|
94
|
+
this.scopeTracker = scopeTracker;
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
/**
|
|
@@ -124,15 +127,17 @@ export class ClassVisitor extends ASTVisitor {
|
|
|
124
127
|
return null; // Unsupported decorator type
|
|
125
128
|
}
|
|
126
129
|
|
|
127
|
-
const
|
|
130
|
+
const decoratorLine = getLine(decorator);
|
|
131
|
+
const decoratorColumn = getColumn(decorator);
|
|
132
|
+
const decoratorId = `DECORATOR#${decoratorName}#${module.file}#${decoratorLine}:${decoratorColumn}`;
|
|
128
133
|
|
|
129
134
|
return {
|
|
130
135
|
id: decoratorId,
|
|
131
136
|
type: 'DECORATOR',
|
|
132
137
|
name: decoratorName,
|
|
133
138
|
file: module.file,
|
|
134
|
-
line:
|
|
135
|
-
column:
|
|
139
|
+
line: decoratorLine,
|
|
140
|
+
column: decoratorColumn,
|
|
136
141
|
arguments: decoratorArgs,
|
|
137
142
|
targetId,
|
|
138
143
|
targetType
|
|
@@ -145,11 +150,13 @@ export class ClassVisitor extends ASTVisitor {
|
|
|
145
150
|
functions,
|
|
146
151
|
scopes,
|
|
147
152
|
classDeclarations,
|
|
148
|
-
decorators
|
|
153
|
+
decorators,
|
|
154
|
+
parameters
|
|
149
155
|
} = this.collections;
|
|
150
156
|
|
|
151
157
|
const analyzeFunctionBody = this.analyzeFunctionBody;
|
|
152
158
|
const collections = this.collections;
|
|
159
|
+
const scopeTracker = this.scopeTracker;
|
|
153
160
|
|
|
154
161
|
return {
|
|
155
162
|
ClassDeclaration: (classPath: NodePath) => {
|
|
@@ -158,12 +165,22 @@ export class ClassVisitor extends ASTVisitor {
|
|
|
158
165
|
|
|
159
166
|
const className = classNode.id.name;
|
|
160
167
|
|
|
161
|
-
//
|
|
162
|
-
const classId = `CLASS#${className}#${module.file}#${classNode.loc!.start.line}`;
|
|
168
|
+
// Extract superClass name
|
|
163
169
|
const superClassName = classNode.superClass?.type === 'Identifier'
|
|
164
170
|
? (classNode.superClass as Identifier).name
|
|
165
171
|
: null;
|
|
166
172
|
|
|
173
|
+
const classLine = getLine(classNode);
|
|
174
|
+
const classColumn = getColumn(classNode);
|
|
175
|
+
|
|
176
|
+
// Create CLASS node using NodeFactory with semantic ID
|
|
177
|
+
const classRecord = ClassNode.createWithContext(
|
|
178
|
+
className,
|
|
179
|
+
scopeTracker.getContext(),
|
|
180
|
+
{ line: classLine, column: classColumn },
|
|
181
|
+
{ superClass: superClassName || undefined }
|
|
182
|
+
);
|
|
183
|
+
|
|
167
184
|
// Extract implements (TypeScript)
|
|
168
185
|
const implementsNames: string[] = [];
|
|
169
186
|
const classNodeWithImplements = classNode as ClassDeclaration & { implements?: Array<{ expression: { type: string; name?: string } }> };
|
|
@@ -175,23 +192,20 @@ export class ClassVisitor extends ASTVisitor {
|
|
|
175
192
|
}
|
|
176
193
|
}
|
|
177
194
|
|
|
195
|
+
// Store ClassNodeRecord + TypeScript metadata
|
|
178
196
|
(classDeclarations as ClassInfo[]).push({
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
name: className,
|
|
182
|
-
file: module.file,
|
|
183
|
-
line: classNode.loc!.start.line,
|
|
184
|
-
column: classNode.loc!.start.column,
|
|
185
|
-
superClass: superClassName,
|
|
186
|
-
implements: implementsNames.length > 0 ? implementsNames : undefined,
|
|
187
|
-
methods: []
|
|
197
|
+
...classRecord,
|
|
198
|
+
implements: implementsNames.length > 0 ? implementsNames : undefined
|
|
188
199
|
});
|
|
189
200
|
|
|
201
|
+
// Enter class scope for tracking methods
|
|
202
|
+
scopeTracker.enterScope(className, 'CLASS');
|
|
203
|
+
|
|
190
204
|
// Extract class decorators
|
|
191
205
|
const classNodeWithDecorators = classNode as ClassDeclaration & { decorators?: Decorator[] };
|
|
192
206
|
if (classNodeWithDecorators.decorators && classNodeWithDecorators.decorators.length > 0 && decorators) {
|
|
193
207
|
for (const decorator of classNodeWithDecorators.decorators) {
|
|
194
|
-
const decoratorInfo = this.extractDecoratorInfo(decorator,
|
|
208
|
+
const decoratorInfo = this.extractDecoratorInfo(decorator, classRecord.id, 'CLASS', module);
|
|
195
209
|
if (decoratorInfo) {
|
|
196
210
|
(decorators as DecoratorInfo[]).push(decoratorInfo);
|
|
197
211
|
}
|
|
@@ -216,11 +230,14 @@ export class ClassVisitor extends ASTVisitor {
|
|
|
216
230
|
? propNode.key.name
|
|
217
231
|
: (propNode.key as { value?: string }).value || 'anonymous';
|
|
218
232
|
|
|
233
|
+
const propLine = getLine(propNode);
|
|
234
|
+
const propColumn = getColumn(propNode);
|
|
235
|
+
|
|
219
236
|
// Extract property decorators (even for non-function properties)
|
|
220
237
|
const propNodeWithDecorators = propNode as ClassProperty & { decorators?: Decorator[] };
|
|
221
238
|
if (propNodeWithDecorators.decorators && propNodeWithDecorators.decorators.length > 0 && decorators) {
|
|
222
239
|
// For function properties, target will be set later; for regular properties, create a target ID
|
|
223
|
-
const propertyTargetId = `PROPERTY#${className}.${propName}#${module.file}#${
|
|
240
|
+
const propertyTargetId = `PROPERTY#${className}.${propName}#${module.file}#${propLine}`;
|
|
224
241
|
for (const decorator of propNodeWithDecorators.decorators) {
|
|
225
242
|
const decoratorInfo = this.extractDecoratorInfo(decorator, propertyTargetId, 'PROPERTY', module);
|
|
226
243
|
if (decoratorInfo) {
|
|
@@ -236,41 +253,56 @@ export class ClassVisitor extends ASTVisitor {
|
|
|
236
253
|
|
|
237
254
|
const funcNode = propNode.value as ArrowFunctionExpression | FunctionExpression;
|
|
238
255
|
|
|
239
|
-
|
|
256
|
+
// Use semantic ID as primary ID (matching FunctionVisitor pattern)
|
|
257
|
+
const legacyId = `FUNCTION#${className}.${propName}#${module.file}#${propLine}:${propColumn}`;
|
|
258
|
+
const functionId = computeSemanticId('FUNCTION', propName, scopeTracker.getContext());
|
|
240
259
|
|
|
241
260
|
// Add method to class methods list for CONTAINS edges
|
|
242
261
|
currentClass.methods.push(functionId);
|
|
243
262
|
|
|
244
263
|
(functions as ClassFunctionInfo[]).push({
|
|
245
264
|
id: functionId,
|
|
246
|
-
stableId: functionId,
|
|
247
265
|
type: 'FUNCTION',
|
|
248
266
|
name: propName,
|
|
249
267
|
file: module.file,
|
|
250
|
-
line:
|
|
251
|
-
column:
|
|
268
|
+
line: propLine,
|
|
269
|
+
column: propColumn,
|
|
252
270
|
async: funcNode.async || false,
|
|
253
271
|
generator: funcNode.type === 'FunctionExpression' ? funcNode.generator || false : false,
|
|
254
272
|
arrowFunction: funcNode.type === 'ArrowFunctionExpression',
|
|
255
273
|
isClassProperty: true,
|
|
256
|
-
className: className
|
|
274
|
+
className: className,
|
|
275
|
+
legacyId // Keep for debugging/migration purposes
|
|
257
276
|
});
|
|
258
277
|
|
|
278
|
+
// Enter method scope for tracking
|
|
279
|
+
scopeTracker.enterScope(propName, 'FUNCTION');
|
|
280
|
+
|
|
281
|
+
// Create PARAMETER nodes for class property function parameters (REG-134)
|
|
282
|
+
if (parameters) {
|
|
283
|
+
createParameterNodes(funcNode.params, functionId, module.file, propLine, parameters as ParameterInfo[], scopeTracker);
|
|
284
|
+
}
|
|
285
|
+
|
|
259
286
|
// Create SCOPE for property function body
|
|
260
|
-
const propBodyScopeId = `SCOPE#${className}.${propName}:body#${module.file}#${
|
|
287
|
+
const propBodyScopeId = `SCOPE#${className}.${propName}:body#${module.file}#${propLine}`;
|
|
288
|
+
const propBodySemanticId = computeSemanticId('SCOPE', 'body', scopeTracker.getContext());
|
|
261
289
|
(scopes as ScopeInfo[]).push({
|
|
262
290
|
id: propBodyScopeId,
|
|
291
|
+
semanticId: propBodySemanticId,
|
|
263
292
|
type: 'SCOPE',
|
|
264
293
|
scopeType: 'property_body',
|
|
265
294
|
name: `${className}.${propName}:body`,
|
|
266
295
|
conditional: false,
|
|
267
296
|
file: module.file,
|
|
268
|
-
line:
|
|
297
|
+
line: propLine,
|
|
269
298
|
parentFunctionId: functionId
|
|
270
299
|
});
|
|
271
300
|
|
|
272
301
|
const funcPath = propPath.get('value') as NodePath<ArrowFunctionExpression | FunctionExpression>;
|
|
273
302
|
analyzeFunctionBody(funcPath, propBodyScopeId, module, collections);
|
|
303
|
+
|
|
304
|
+
// Exit method scope
|
|
305
|
+
scopeTracker.exitScope();
|
|
274
306
|
}
|
|
275
307
|
},
|
|
276
308
|
|
|
@@ -285,24 +317,29 @@ export class ClassVisitor extends ASTVisitor {
|
|
|
285
317
|
return;
|
|
286
318
|
}
|
|
287
319
|
|
|
288
|
-
const
|
|
320
|
+
const methodLine = getLine(methodNode);
|
|
321
|
+
const methodColumn = getColumn(methodNode);
|
|
322
|
+
|
|
323
|
+
// Use semantic ID as primary ID (matching FunctionVisitor pattern)
|
|
324
|
+
const legacyId = `FUNCTION#${className}.${methodName}#${module.file}#${methodLine}:${methodColumn}`;
|
|
325
|
+
const functionId = computeSemanticId('FUNCTION', methodName, scopeTracker.getContext());
|
|
289
326
|
|
|
290
327
|
// Add method to class methods list for CONTAINS edges
|
|
291
328
|
currentClass.methods.push(functionId);
|
|
292
329
|
|
|
293
330
|
const funcData: ClassFunctionInfo = {
|
|
294
331
|
id: functionId,
|
|
295
|
-
stableId: functionId,
|
|
296
332
|
type: 'FUNCTION',
|
|
297
333
|
name: methodName,
|
|
298
334
|
file: module.file,
|
|
299
|
-
line:
|
|
300
|
-
column:
|
|
335
|
+
line: methodLine,
|
|
336
|
+
column: methodColumn,
|
|
301
337
|
async: methodNode.async || false,
|
|
302
338
|
generator: methodNode.generator || false,
|
|
303
339
|
isClassMethod: true,
|
|
304
340
|
className: className,
|
|
305
|
-
methodKind: methodNode.kind as 'constructor' | 'method' | 'get' | 'set'
|
|
341
|
+
methodKind: methodNode.kind as 'constructor' | 'method' | 'get' | 'set',
|
|
342
|
+
legacyId // Keep for debugging/migration purposes
|
|
306
343
|
};
|
|
307
344
|
(functions as ClassFunctionInfo[]).push(funcData);
|
|
308
345
|
|
|
@@ -317,22 +354,38 @@ export class ClassVisitor extends ASTVisitor {
|
|
|
317
354
|
}
|
|
318
355
|
}
|
|
319
356
|
|
|
357
|
+
// Enter method scope for tracking
|
|
358
|
+
scopeTracker.enterScope(methodName, 'FUNCTION');
|
|
359
|
+
|
|
360
|
+
// Create PARAMETER nodes for class method parameters (REG-134)
|
|
361
|
+
if (parameters) {
|
|
362
|
+
createParameterNodes(methodNode.params, functionId, module.file, methodLine, parameters as ParameterInfo[], scopeTracker);
|
|
363
|
+
}
|
|
364
|
+
|
|
320
365
|
// Create SCOPE for method body
|
|
321
|
-
const methodBodyScopeId = `SCOPE#${className}.${methodName}:body#${module.file}#${
|
|
366
|
+
const methodBodyScopeId = `SCOPE#${className}.${methodName}:body#${module.file}#${methodLine}`;
|
|
367
|
+
const methodBodySemanticId = computeSemanticId('SCOPE', 'body', scopeTracker.getContext());
|
|
322
368
|
(scopes as ScopeInfo[]).push({
|
|
323
369
|
id: methodBodyScopeId,
|
|
370
|
+
semanticId: methodBodySemanticId,
|
|
324
371
|
type: 'SCOPE',
|
|
325
372
|
scopeType: 'method_body',
|
|
326
373
|
name: `${className}.${methodName}:body`,
|
|
327
374
|
conditional: false,
|
|
328
375
|
file: module.file,
|
|
329
|
-
line:
|
|
376
|
+
line: methodLine,
|
|
330
377
|
parentFunctionId: functionId
|
|
331
378
|
});
|
|
332
379
|
|
|
333
380
|
analyzeFunctionBody(methodPath, methodBodyScopeId, module, collections);
|
|
381
|
+
|
|
382
|
+
// Exit method scope
|
|
383
|
+
scopeTracker.exitScope();
|
|
334
384
|
}
|
|
335
385
|
});
|
|
386
|
+
|
|
387
|
+
// Exit class scope
|
|
388
|
+
scopeTracker.exitScope();
|
|
336
389
|
}
|
|
337
390
|
};
|
|
338
391
|
}
|