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

Method isUsageIsolated

src/mcp/tools.ts:5030–5044  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

5028 */
5029 const isolationCache = new Map<string, boolean>();
5030 const isUsageIsolated = (node: Node): boolean => {
5031 if ((subgraphUsageDegree.get(node.id) ?? 0) > 0) return false;
5032 const cached = isolationCache.get(node.id);
5033 if (cached !== undefined) return cached;
5034 let isolated = true;
5035 try {
5036 const used = (e: Edge) => RELEVANCE_USAGE_EDGES.has(e.kind);
5037 isolated = !cg.getIncomingEdges(node.id).some(used)
5038 && !cg.getOutgoingEdges(node.id).some(used);
5039 } catch {
5040 isolated = false; // a probe failure must not manufacture a penalty
5041 }
5042 isolationCache.set(node.id, isolated);
5043 return isolated;
5044 };
5045 /**
5046 * A `method_signature` reaches here as a `method`, which the kind table
5047 * rates 1.0: "a callable — the unit an architecture question is about". It

Callers

nothing calls this directly

Calls 4

getMethod · 0.65
getIncomingEdgesMethod · 0.65
getOutgoingEdgesMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected