MCPcopy
hub / github.com/colbymchenry/codegraph / getOutgoingEdges

Method getOutgoingEdges

src/db/queries.ts:1313–1337  ·  view source on GitHub ↗

* Get outgoing edges from a node

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

Source from the content-addressed store, hash-verified

1311 * Get outgoing edges from a node
1312 */
1313 getOutgoingEdges(sourceId: string, kinds?: EdgeKind[], provenance?: string): Edge[] {
1314 if ((kinds && kinds.length > 0) || provenance) {
1315 let sql = 'SELECT * FROM edges WHERE source = ?';
1316 const params: (string | number)[] = [sourceId];
1317
1318 if (kinds && kinds.length > 0) {
1319 sql += ` AND kind IN (${kinds.map(() => '?').join(',')})`;
1320 params.push(...kinds);
1321 }
1322
1323 if (provenance) {
1324 sql += ' AND provenance = ?';
1325 params.push(provenance);
1326 }
1327
1328 const rows = this.db.prepare(sql).all(...params) as EdgeRow[];
1329 return rows.map(rowToEdge);
1330 }
1331
1332 if (!this.stmts.getEdgesBySource) {
1333 this.stmts.getEdgesBySource = this.db.prepare('SELECT * FROM edges WHERE source = ?');
1334 }
1335 const rows = this.stmts.getEdgesBySource.all(sourceId) as EdgeRow[];
1336 return rows.map(rowToEdge);
1337 }
1338
1339 /**
1340 * Get incoming edges to a node

Callers 15

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

Calls 3

joinMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected