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

Function sourceUseReading

graph-ui/tools/smoke-w14.mjs:266–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

264}
265
266async function sourceUseReading() {
267 const source = await readFile(join(FIXTURE, UNUSED_IMPORT_PROBE.file), 'utf8');
268 const outsideImportDeclarations = source.split('\n')
269 .filter((line) => !/^\s*import\b/.test(line))
270 .join('\n');
271 return {
272 sourceImportCount: (source.match(/^\s*import\s*\{[^}]*\binsert\b[^}]*\}\s*from\s*['"][^'"]+['"];?\s*$/gm) ?? []).length,
273 sourceUseCount: (outsideImportDeclarations.match(/\binsert\b/g) ?? []).length,
274 };
275}
276
277async function beforeTextReading() {
278 const encoded = await readFile(BEFORE_LEVELS, 'utf8');

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected