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

Function rank

src/resolution/pascal-scope.ts:2041–2041  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

2039 const used = usedUnitFiles(fromFile, context);
2040 // How near a helper's unit is: its own unit's nearest, then the units used last.
2041 const rank = (file: string): number => (own.includes(file) ? Infinity : used.indexOf(file));
2042 return helpers.filter((h) => rank(h.filePath) >= 0)
2043 .sort((a, b) => rank(b.filePath) - rank(a.filePath) || b.startLine - a.startLine)[0] ?? null;
2044}

Callers 2

nearestHelperFunction · 0.70
findRelevantContextMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected