MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cyclicClosure

Function cyclicClosure

graph-ui/src/pseudocode/flow-model.test.ts:74–96  ·  view source on GitHub ↗

A closure of two symbols that call each other, which is where a naive walk never returns.

()

Source from the content-addressed store, hash-verified

72
73/** A closure of two symbols that call each other, which is where a naive walk never returns. */
74function cyclicClosure(): ClosureDocument {
75 const symbol = (name: string) => ({
76 nodeId: `p.${name}`,
77 name,
78 qualifiedName: `p.${name}`,
79 kind: 'function' as const,
80 uri: `file:///workspace/src/${name}.ts`,
81 range: { start: { line: 0, character: 0 }, end: { line: 4, character: 0 } },
82 selectionRange: { start: { line: 0, character: 0 }, end: { line: 0, character: 0 } },
83 });
84 const ping = symbol('ping');
85 const pong = symbol('pong');
86 return {
87 root: ping,
88 symbols: [ping, pong],
89 edges: [
90 { from: 'p.ping', to: 'p.pong', line: 2 },
91 { from: 'p.pong', to: 'p.ping', line: 6 },
92 ],
93 truncated: false,
94 visited: 2,
95 };
96}
97
98describe('unfolding a closure into a walk', () => {
99 const nodes = flowNodes(CLOSURE);

Callers 1

flow-model.test.tsFile · 0.85

Calls 1

symbolFunction · 0.70

Tested by

no test coverage detected