CodeGraph/docs
Section 4.1

Analytics Engine Architecture

The single entry point orchestrating graph traversal, upstream impact analysis, downstream dependencies, cycles, topological ordering, and connectivity.

Source: server/src/analytics/AnalysisEngine.ts

Analyzer Dependency Composition

AnalysisEngine is instantiated with an immutable Graph instance and wires specialized analyzer classes:

server/src/analytics/AnalysisEngine.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
export class AnalysisEngine { private readonly impactAnalyzer: ImpactAnalyzer; private readonly dependencyAnalyzer: DependencyAnalyzer; private readonly cycleAnalyzer: CycleAnalyzer; private readonly dependencyOrderingAnalyzer: DependencyOrderingAnalyzer; private readonly fanInOutAnalyzer: FanInOutAnalyzer; private readonly callPathAnalyzer: CallPathAnalyzer; private readonly graphTraversal: GraphTraversal; constructor(private readonly graph: Graph) { this.graphTraversal = new GraphTraversal(graph); this.impactAnalyzer = new ImpactAnalyzer(this.graphTraversal); this.dependencyAnalyzer = new DependencyAnalyzer(this.graphTraversal); this.cycleAnalyzer = new CycleAnalyzer(graph); this.dependencyOrderingAnalyzer = new DependencyOrderingAnalyzer(graph); this.fanInOutAnalyzer = new FanInOutAnalyzer(graph); this.callPathAnalyzer = new CallPathAnalyzer(graph); } }

Architectural Contracts

ContractGuaranteeRationale
Read-Only ExecutionNo analyzer ever mutates the Graph maps or node objects.Guarantees thread-safe parallel analysis across multiple queries.
Stateless per CallVisited sets, queues, and recursion stacks are local to method execution.Zero state leakage between subsequent requests.
Pure Functional MathAll metrics compute deterministic outputs from static graph facts.Complete repeatability across developer machines and CI/CD.