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

Method isUsageIsolated

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

Source from the content-addressed store, hash-verified

4972 */
4973 const isolationCache = new Map<string, boolean>();
4974 const isUsageIsolated = (node: Node): boolean => {
4975 if ((subgraphUsageDegree.get(node.id) ?? 0) > 0) return false;
4976 const cached = isolationCache.get(node.id);
4977 if (cached !== undefined) return cached;
4978 let isolated = true;
4979 try {
4980 const used = (e: Edge) => RELEVANCE_USAGE_EDGES.has(e.kind);
4981 isolated = !cg.getIncomingEdges(node.id).some(used)
4982 && !cg.getOutgoingEdges(node.id).some(used);
4983 } catch {
4984 isolated = false; // a probe failure must not manufacture a penalty
4985 }
4986 isolationCache.set(node.id, isolated);
4987 return isolated;
4988 };
4989 /**
4990 * A `method_signature` reaches here as a `method`, which the kind table
4991 * 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