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

Function resolveServiceMethod

src/resolution/frameworks/express.ts:740–756  ·  view source on GitHub ↗

* Resolve service/helper method using name-based lookup

(
  serviceName: string,
  method: string,
  context: ResolutionContext
)

Source from the content-addressed store, hash-verified

738 * Resolve service/helper method using name-based lookup
739 */
740function resolveServiceMethod(
741 serviceName: string,
742 method: string,
743 context: ResolutionContext
744): string | null {
745 // Look for the method in files matching the service name
746 const methodCandidates = context.getNodesByName(method);
747 const stripped = serviceName.replace(/(Service|Helper|Utils?)$/i, '').toLowerCase();
748 const methodNodes = methodCandidates.filter(
749 (n) => (n.kind === 'method' || n.kind === 'function') &&
750 n.filePath.toLowerCase().includes(stripped)
751 );
752
753 if (methodNodes.length > 0) return methodNodes[0]!.id;
754
755 return null;
756}
757
758/**
759 * Detect language from file extension

Callers 1

resolveFunction · 0.85

Calls 1

getNodesByNameMethod · 0.65

Tested by

no test coverage detected