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

Function controllerUrl

src/resolution/frameworks/codeigniter.ts:91–98  ·  view source on GitHub ↗

The URL a controller's `index` answers at, or null for a file that isn't one.

(filePath: string)

Source from the content-addressed store, hash-verified

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 {
92 const m = CONTROLLER_FILE.exec(filePath);
93 if (!m) return null;
94 const segments = m[2]!.toLowerCase().split('/');
95 const module = m[1]?.toLowerCase();
96 if (!module) return `/${segments.join('/')}`;
97 return segments.length === 1 && segments[0] === module ? `/${module}` : `/${[module, ...segments].join('/')}`;
98}
99
100function routeNode(filePath: string, line: number, verb: string, routePath: string, now: number): Node {
101 return {

Callers 2

classTableFunction · 0.85
extractFunction · 0.85

Calls 2

execMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected