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

Function classTable

src/resolution/frameworks/codeigniter.ts:73–86  ·  view source on GitHub ↗
(context: ResolutionContext)

Source from the content-addressed store, hash-verified

71}
72
73function classTable(context: ResolutionContext): ClassTable {
74 const all = context.getNodesByKind('class');
75 const cached = tables.get(context);
76 if (cached && cached.source === all) return cached;
77 const table: ClassTable = { source: all, loadable: new Map(), controllers: new Map(), aliases: new Map() };
78 for (const node of all) {
79 if (node.language !== 'php') continue;
80 const url = controllerUrl(node.filePath);
81 if (url !== null) add(table.controllers, url.slice(1), node);
82 else if (LOADABLE_FILE.test(node.filePath)) add(table.loadable, node.name.toLowerCase(), node);
83 }
84 tables.set(context, table);
85 return table;
86}
87
88/** The URL a controller's `index` answers at, or null for a file that isn't one. */
89function controllerUrl(filePath: string): string | null {

Callers 2

routeHandlerFunction · 0.85
propertyClassFunction · 0.85

Calls 5

controllerUrlFunction · 0.85
addFunction · 0.70
getNodesByKindMethod · 0.65
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected