MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / getImportedByCount

Function getImportedByCount

src/tools/search-codebase.ts:595–604  ·  view source on GitHub ↗
(result: SearchResult)

Source from the content-addressed store, hash-verified

593
594 // Get the count of files that import a given result (compact mode graph context)
595 function getImportedByCount(result: SearchResult): number {
596 const rPathNorm = normalizeGraphPath(result.filePath);
597 const importers = new Set<string>();
598 for (const [dep, imps] of reverseImports) {
599 if (dep === rPathNorm || dep.endsWith(rPathNorm) || rPathNorm.endsWith(dep)) {
600 for (const imp of imps) importers.add(imp);
601 }
602 }
603 return importers.size;
604 }
605
606 // Get up to maxCount named exports for a file from relationships.graph.exports
607 function getTopExports(filePath: string, maxCount = 3): string[] {

Callers 1

handleFunction · 0.85

Calls 2

normalizeGraphPathFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected