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

Function pickHit

graph-ui/src/traces/bug-paths.ts:710–724  ·  view source on GitHub ↗
(hits: readonly SymbolSearchHit[], hop: BugPathNode)

Source from the content-addressed store, hash-verified

708 * when no reading named a file.
709 */
710export function pickHit(hits: readonly SymbolSearchHit[], hop: BugPathNode): SymbolSearchHit | undefined {
711 if (hop.qualifiedName !== undefined) {
712 const exact = hits.find((hit) => hit.qualifiedName === hop.qualifiedName);
713 if (exact !== undefined) {
714 return exact;
715 }
716 }
717 if (hop.filePath !== undefined) {
718 const inFile = hits.find((hit) => hit.filePath === hop.filePath && hit.name === hop.name);
719 if (inFile !== undefined) {
720 return inFile;
721 }
722 }
723 return hits.find((hit) => hit.name === hop.name);
724}

Callers 2

bug-paths.test.tsFile · 0.90
resolveHopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected