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

Method getOutgoingEdges

src/db/queries.ts:1716–1740  ·  view source on GitHub ↗

* Get outgoing edges from a node

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

Source from the content-addressed store, hash-verified

1714 * Get outgoing edges from a node
1715 */
1716 getOutgoingEdges(sourceId: string, kinds?: EdgeKind[], provenance?: string): Edge[] {
1717 if ((kinds && kinds.length > 0) || provenance) {
1718 let sql = 'SELECT * FROM edges WHERE source = ?';
1719 const params: (string | number)[] = [sourceId];
1720
1721 if (kinds && kinds.length > 0) {
1722 sql += ` AND kind IN (${kinds.map(() => '?').join(',')})`;
1723 params.push(...kinds);
1724 }
1725
1726 if (provenance) {
1727 sql += ' AND provenance = ?';
1728 params.push(provenance);
1729 }
1730
1731 const rows = this.db.prepare(sql).all(...params) as EdgeRow[];
1732 return rows.map(rowToEdge);
1733 }
1734
1735 if (!this.stmts.getEdgesBySource) {
1736 this.stmts.getEdgesBySource = this.db.prepare('SELECT * FROM edges WHERE source = ?');
1737 }
1738 const rows = this.stmts.getEdgesBySource.all(sourceId) as EdgeRow[];
1739 return rows.map(rowToEdge);
1740 }
1741
1742 /**
1743 * 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