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

Method getResolutionEdgesInto

src/db/queries.ts:3797–3827  ·  view source on GitHub ↗

* The resolution edges into `targetIds` — every edge into one of them but * `contains` and synthesized (`provenance='heuristic'`) ones — with the * source file and language a resurrection needs and the file of each target.

(
    targetIds: readonly string[]
  )

Source from the content-addressed store, hash-verified

3795 * source file and language a resurrection needs and the file of each target.
3796 */
3797 getResolutionEdgesInto(
3798 targetIds: readonly string[]
3799 ): Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language; targetFilePath: string }> {
3800 const out: Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language; targetFilePath: string }> = [];
3801 const unique = [...new Set(targetIds)];
3802 for (let i = 0; i < unique.length; i += SQLITE_PARAM_CHUNK_SIZE) {
3803 const chunk = unique.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
3804 const placeholders = chunk.map(() => '?').join(',');
3805 const rows = this.db
3806 .prepare(
3807 `SELECT e.*, src.file_path AS source_file_path, src.language AS source_language, tgt.file_path AS target_file_path
3808 FROM edges e
3809 JOIN nodes src ON src.id = e.source
3810 JOIN nodes tgt ON tgt.id = e.target
3811 WHERE e.target IN (${placeholders})
3812 AND e.kind != 'contains'
3813 AND (e.provenance IS NULL OR e.provenance != 'heuristic')`
3814 )
3815 .all(...chunk) as Array<EdgeRow & { source_file_path: string; source_language: Language; target_file_path: string }>;
3816 for (const row of rows) {
3817 out.push({
3818 ...rowToEdge(row),
3819 edgeId: row.id,
3820 sourceFilePath: row.source_file_path,
3821 sourceLanguage: row.source_language,
3822 targetFilePath: row.target_file_path,
3823 });
3824 }
3825 }
3826 return out;
3827 }
3828
3829 /**
3830 * The row ids of the failed references of `filePath` that import one of

Calls 6

rowToEdgeFunction · 0.85
mapMethod · 0.80
pushMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected