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

Function route

__tests__/codeigniter.test.ts:274–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272 const cg = CodeGraph.initSync(dir);
273 await cg.indexAll();
274 const route = (): string | undefined => {
275 const node = cg.getNodesByKind('route').find((n) => n.name === 'ANY /read/(:num)')!;
276 return cg.getOutgoingEdges(node.id).filter((e) => e.kind === 'references').map((e) => cg.getNode(e.target)?.qualifiedName)[0];
277 };
278 const index = (): string[] => {
279 const node = cg.getNodesInFile('application/controllers/Welcome.php').find((n) => n.name === 'index')!;
280 return cg.getCallees(node.id).map((c) => c.node.qualifiedName);

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected