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

Method cfmlMethodOf

src/resolution/index.ts:4290–4305  ·  view source on GitHub ↗

A CFML component's method by its lowercased name (CFML names ignore case): its own, else one a supertype has.

(cls: Node, lowerName: string, seen: Set<string>)

Source from the content-addressed store, hash-verified

4288
4289 /** A CFML component's method by its lowercased name (CFML names ignore case): its own, else one a supertype has. */
4290 private cfmlMethodOf(cls: Node, lowerName: string, seen: Set<string>): Node | undefined {
4291 if (seen.has(cls.id) || seen.size >= 8) return undefined;
4292 seen.add(cls.id);
4293 const own = this.context.getNodesInFile(cls.filePath).find((n) =>
4294 n.kind === 'method' &&
4295 n.name.toLowerCase() === lowerName &&
4296 n.qualifiedName.toLowerCase() === `${cls.name}::${n.name}`.toLowerCase() &&
4297 n.startLine >= cls.startLine && n.endLine <= cls.endLine
4298 );
4299 if (own) return own;
4300 for (const supertype of this.context.getSupertypeNodes?.(cls.id) ?? []) {
4301 const inherited = this.cfmlMethodOf(supertype, lowerName, seen);
4302 if (inherited) return inherited;
4303 }
4304 return undefined;
4305 }
4306
4307 /**
4308 * The file a CFML include names (#2651) — `include "x.cfm";`,

Callers 1

Calls 4

hasMethod · 0.80
getSupertypeNodesMethod · 0.80
getNodesInFileMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected