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

Function connectedness

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

Source from the content-addressed store, hash-verified

32 // implementation. Let those observed connections rank companion headers;
33 // do not special-case a repository's module names.
34 const connectedness = (path: string) => /\.(h|hpp)$/.test(path)
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))

Callers 1

scoreFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected