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

Function clampNodeBudget

graph-ui/src/hooks/useGraphData.ts:30–37  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

28export const GRAPH_NODE_BUDGET_MAX = 10_000_000;
29
30export function clampNodeBudget(value: number): number {
31 if (!Number.isFinite(value)) return GRAPH_RENDER_NODE_LIMIT;
32 const stepped =
33 Math.round(value / GRAPH_NODE_BUDGET_STEP) * GRAPH_NODE_BUDGET_STEP;
34 if (stepped < GRAPH_NODE_BUDGET_STEP) return GRAPH_NODE_BUDGET_STEP;
35 if (stepped > GRAPH_NODE_BUDGET_MAX) return GRAPH_NODE_BUDGET_MAX;
36 return stepped;
37}
38
39/** Which graph to lay out: the code graph (default) or the missed graph —
40 * only files the indexer could not fully cover, as their file structure. */

Callers 3

loadNodeBudgetFunction · 0.90
GraphTabFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected