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

Method getIncomingEdges

src/db/queries.ts:1745–1757  ·  view source on GitHub ↗

* Get incoming edges to a node

(targetId: string, kinds?: EdgeKind[])

Source from the content-addressed store, hash-verified

1743 * Get incoming edges to a node
1744 */
1745 getIncomingEdges(targetId: string, kinds?: EdgeKind[]): Edge[] {
1746 if (kinds && kinds.length > 0) {
1747 const sql = `SELECT * FROM edges WHERE target = ? AND kind IN (${kinds.map(() => '?').join(',')})`;
1748 const rows = this.db.prepare(sql).all(targetId, ...kinds) as EdgeRow[];
1749 return rows.map(rowToEdge);
1750 }
1751
1752 if (!this.stmts.getEdgesByTarget) {
1753 this.stmts.getEdgesByTarget = this.db.prepare('SELECT * FROM edges WHERE target = ?');
1754 }
1755 const rows = this.stmts.getEdgesByTarget.all(targetId) as EdgeRow[];
1756 return rows.map(rowToEdge);
1757 }
1758
1759 /**
1760 * Find all edges where both source and target are in the given node set.

Callers 15

fieldChannelEdgesFunction · 0.45
reactRenderEdgesFunction · 0.45
rnCrossPlatformEdgesFunction · 0.45
targetsOfFunction · 0.45
containerOfMethod · 0.45
isPolymorphicSiblingMethod · 0.45
getAdjacentEdgesMethod · 0.45
getCallersRecursiveMethod · 0.45
getTypeDescendantsMethod · 0.45

Calls 3

allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected