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

Function graphOf

scripts/regression/gate.mjs:212–218  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

210}
211
212function graphOf(dir) {
213 const dumped = spawnSync(node, [join(repo, 'scripts', 'dump-graph.mjs'), dir], { env, stdio: ['ignore', 'pipe', 'inherit'], maxBuffer: 2 ** 31 - 1 });
214 if (dumped.status !== 0 || !dumped.stdout) throw new Error(`dump-graph.mjs failed for ${dir}`);
215 const counts = {};
216 for (const [, section, count] of dumped.stdout.toString('utf8').matchAll(/^== (\w+) \((\d+)\)$/gm)) counts[section] = Number(count);
217 return { hash: sha('sha256', dumped.stdout).slice(0, 16), ...counts };
218}
219
220/** A budget that holds on a slower machine, kept as it is while the time stays well inside it. */
221function budgetFor(seconds, kept) {

Callers 1

gate.mjsFile · 0.70

Calls 3

NumberInterface · 0.85
shaFunction · 0.85
joinFunction · 0.50

Tested by

no test coverage detected