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

Function score

graph-ui/src/architecture/repository-guide.ts:37–38  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

35 ? Math.max(degree.get(path) ?? 0, ...['c', 'cc', 'cpp', 'cxx'].map(extension => degree.get(path.replace(/\.(h|hpp)$/, `.${extension}`)) ?? 0))
36 : degree.get(path) ?? 0;
37 const score = (path: string) => (/\/README\.md$/i.test(path) ? 30000 : 0) + (/\.(h|hpp)$/.test(path) ? 10000 : 0) + (path.split('/').at(-1)?.split('.')[0] === part ? 20000 : 0)
38 + Math.min(5000, connectedness(path)) - path.split('/').length;
39 return area.files.filter(path => /\.(h|hpp|c|cc|cpp|cxx|ts|tsx|js|jsx|py|rs|go|java|cs|md)$/.test(path))
40 .sort((a, b) => score(b) - score(a) || a.localeCompare(b)).slice(0, 2);
41}

Callers 1

sourceCandidatesFunction · 0.70

Calls 1

connectednessFunction · 0.85

Tested by

no test coverage detected