MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / flowEdgeLabel

Function flowEdgeLabel

src/ui-server/api/flow.ts:313–327  ·  view source on GitHub ↗
(edge: Edge, upward: boolean)

Source from the content-addressed store, hash-verified

311 * §3.5 fixes the phrasing — "via callback · registered at file:line".
312 */
313export function flowEdgeLabel(edge: Edge, upward: boolean): string {
314 const meta = (edge.metadata ?? {}) as Record<string, unknown>;
315 const parts: string[] = [];
316 if (edge.provenance === 'heuristic' && typeof meta.synthesizedBy === 'string') {
317 const mechanism = meta.synthesizedBy.replace(/-/g, ' ');
318 parts.push(`via ${mechanism}`);
319 if (typeof meta.via === 'string' && meta.via) parts.push(meta.via);
320 if (typeof meta.registeredAt === 'string' && meta.registeredAt) {
321 parts.push(`registered at ${meta.registeredAt}`);
322 }
323 } else {
324 parts.push(upward ? 'called by' : edge.kind);
325 }
326 return parts.join(' · ');
327}
328
329function toFlowEdge(edge: Edge, upward: boolean): WireFlowEdge {
330 const meta = (edge.metadata ?? {}) as Record<string, unknown>;

Callers 2

toFlowEdgeFunction · 0.85

Calls 2

pushMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected