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

Function contextLines

graph-ui/src/twin/render-model.ts:768–781  ·  view source on GitHub ↗

Facts whose impact is useful before any level-specific shape begins.

(ir: SemanticIR, facets: ReadonlySet<Facet>)

Source from the content-addressed store, hash-verified

766
767/** Facts whose impact is useful before any level-specific shape begins. */
768function contextLines(ir: SemanticIR, facets: ReadonlySet<Facet>): string[] {
769 const lines: string[] = [];
770 if (facets.has(Facet.Data)) {
771 const names = sharedNames(ir);
772 if (names.length > 0) {
773 lines.push(`${ir.symbol.name} leans on shared names declared outside its own lines: ${joinNames(names)}.`);
774 }
775 }
776 if (facets.has(Facet.Calls) && ir.calledBy.value.length > 0) {
777 const callers = ir.calledBy.value.map((caller) => callerLabel(caller.name)).filter((name) => name.length > 0);
778 lines.push(`${callers.length} callers reach ${ir.symbol.name}: ${joinNames(callers)}.`);
779 }
780 return lines;
781}
782
783/** Module callers are shown as plain labels, never as path-shaped jargon. */
784function callerLabel(name: string): string {

Callers 1

emptyModelFunction · 0.85

Calls 4

joinNamesFunction · 0.90
sharedNamesFunction · 0.85
callerLabelFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected