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

Function controllerUrl

src/resolution/frameworks/codeigniter.ts:89–96  ·  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

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

Callers 2

classTableFunction · 0.85
extractFunction · 0.85

Calls 2

execMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected