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

Function aliasesIn

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

Source from the content-addressed store, hash-verified

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