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

Method getOutgoingEdges

src/db/queries.ts:1822–1846  ·  view source on GitHub ↗

* Get outgoing edges from a node

(sourceId: string, kinds?: EdgeKind[], provenance?: string)

Source from the content-addressed store, hash-verified

1820 * Get outgoing edges from a node
1821 */
1822 getOutgoingEdges(sourceId: string, kinds?: EdgeKind[], provenance?: string): Edge[] {
1823 if ((kinds && kinds.length > 0) || provenance) {
1824 let sql = 'SELECT * FROM edges WHERE source = ?';
1825 const params: (string | number)[] = [sourceId];
1826
1827 if (kinds && kinds.length > 0) {
1828 sql += ` AND kind IN (${kinds.map(() => '?').join(',')})`;
1829 params.push(...kinds);
1830 }
1831
1832 if (provenance) {
1833 sql += ' AND provenance = ?';
1834 params.push(provenance);
1835 }
1836
1837 const rows = this.db.prepare(sql).all(...params) as EdgeRow[];
1838 return rows.map(rowToEdge);
1839 }
1840
1841 if (!this.stmts.getEdgesBySource) {
1842 this.stmts.getEdgesBySource = this.db.prepare('SELECT * FROM edges WHERE source = ?');
1843 }
1844 const rows = this.stmts.getEdgesBySource.all(sourceId) as EdgeRow[];
1845 return rows.map(rowToEdge);
1846 }
1847
1848 /**
1849 * Get incoming edges to a node

Callers 15

createContextMethod · 0.45
reactRenderEdgesFunction · 0.45
flutterBuildEdgesFunction · 0.45
arkuiStateBuildEdgesFunction · 0.45
methodsOfFunction · 0.45
cppOverrideEdgesFunction · 0.45
methodNameSetFunction · 0.45
interfaceOverrideEdgesFunction · 0.45
goGrpcStubImplEdgesFunction · 0.45

Calls 3

allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected