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

Function resolveServiceMethod

src/resolution/frameworks/express.ts:725–741  ·  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

723 * Resolve service/helper method using name-based lookup
724 */
725function resolveServiceMethod(
726 serviceName: string,
727 method: string,
728 context: ResolutionContext
729): string | null {
730 // Look for the method in files matching the service name
731 const methodCandidates = context.getNodesByName(method);
732 const stripped = serviceName.replace(/(Service|Helper|Utils?)$/i, '').toLowerCase();
733 const methodNodes = methodCandidates.filter(
734 (n) => (n.kind === 'method' || n.kind === 'function') &&
735 n.filePath.toLowerCase().includes(stripped)
736 );
737
738 if (methodNodes.length > 0) return methodNodes[0]!.id;
739
740 return null;
741}
742
743/**
744 * Detect language from file extension

Callers 1

resolveFunction · 0.85

Calls 1

getNodesByNameMethod · 0.65

Tested by

no test coverage detected