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

Function imports

__tests__/php-nested-include.test.ts:74–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72});
73
74function imports(): string[] {
75 const db = (cg as unknown as { db: { getDb(): { prepare(sql: string): { all(...a: unknown[]): Array<{ s: string; t: string; l: number }> } } } }).db;
76 return db.getDb().prepare(`
77 SELECT s.kind || ' ' || s.qualified_name s, t.file_path t, e.line l FROM edges e
78 JOIN nodes s ON s.id = e.source JOIN nodes t ON t.id = e.target
79 WHERE e.kind = 'imports' AND t.kind = 'file'`).all().map((r) => `${r.s} -> ${r.t} @${r.l}`).sort();
80}
81
82describe('a PHP include inside a function body (#3296)', () => {
83 it('links the function, or the method, to the file it includes; a top-level include stays the file\'s', () => {

Callers 1

Calls 4

mapMethod · 0.80
getDbMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected