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

Function classTable

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

Source from the content-addressed store, hash-verified

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