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

Function aliasesIn

src/resolution/frameworks/codeigniter.ts:254–266  ·  view source on GitHub ↗
(file: string, table: ClassTable, context: ResolutionContext)

Source from the content-addressed store, hash-verified

252}
253
254function aliasesIn(file: string, table: ClassTable, context: ResolutionContext): Map<string, string> {
255 const known = table.aliases.get(file);
256 if (known) return known;
257 const aliases = new Map<string, string>();
258 const source = context.readFile(file) ?? '';
259 for (const re of [MODEL_ALIAS_RE, LIBRARY_ALIAS_RE]) {
260 re.lastIndex = 0;
261 let m: RegExpExecArray | null;
262 while ((m = re.exec(source)) !== null) aliases.set(m[2]!, m[1]!.split('/').pop()!.toLowerCase());
263 }
264 table.aliases.set(file, aliases);
265 return aliases;
266}
267
268/** The class a property holds in `file`: by its own name, or by the alias a load there gave it. */
269function propertyClass(property: string, file: string, context: ResolutionContext): Node | null {

Callers 1

propertyClassFunction · 0.85

Calls 4

getMethod · 0.65
readFileMethod · 0.65
execMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected