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

Function handlerMethodOf

src/graph/dynamic-boundary-report.ts:282–300  ·  view source on GitHub ↗
(cg: CodeGraph, cls: Node)

Source from the content-addressed store, hash-verified

280}
281
282function handlerMethodOf(cg: CodeGraph, cls: Node): Node | null {
283 try {
284 return (
285 cg
286 .getOutgoingEdges(cls.id)
287 .filter((e) => e.kind === 'contains')
288 .map((e) => {
289 try {
290 return cg.getNode(e.target);
291 } catch {
292 return null;
293 }
294 })
295 .find((c): c is Node => !!c && c.kind === 'method' && HANDLER_METHODS.test(c.name)) ?? null
296 );
297 } catch {
298 return null; // a class whose members do not resolve — show the class itself
299 }
300}
301
302// =============================================================================
303// Continuations

Callers 1

Calls 3

mapMethod · 0.80
getNodeMethod · 0.80
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected