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

Function sharedDirectory

graph-ui/src/galaxy/organic-clusters.ts:231–241  ·  view source on GitHub ↗
(nodes: readonly GraphNode[])

Source from the content-addressed store, hash-verified

229}
230
231function sharedDirectory(nodes: readonly GraphNode[]): string {
232 const paths = nodes.flatMap(node => node.file_path ? [node.file_path.replace(/\\/g, '/').split('/').slice(0, -1)] : []);
233 if (!paths.length) return 'Relationship group';
234 const common = [...paths[0]!];
235 for (const path of paths.slice(1)) {
236 let length = 0;
237 while (length < common.length && common[length] === path[length]) length++;
238 common.length = length;
239 }
240 return common.join('/') || 'Relationship group';
241}
242
243/** Pure deterministic multilevel cloud layout. Fixed iteration budgets keep
244 * work O(N + E) per pass; metadata/source paths only label the graph-derived

Callers 1

layoutOrganicClustersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected