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

Method getResolutionEdgesInto

src/db/queries.ts:3908–3938  ·  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

3906 * source file and language a resurrection needs and the file of each target.
3907 */
3908 getResolutionEdgesInto(
3909 targetIds: readonly string[]
3910 ): Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language; targetFilePath: string }> {
3911 const out: Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language; targetFilePath: string }> = [];
3912 const unique = [...new Set(targetIds)];
3913 for (let i = 0; i < unique.length; i += SQLITE_PARAM_CHUNK_SIZE) {
3914 const chunk = unique.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
3915 const placeholders = chunk.map(() => '?').join(',');
3916 const rows = this.db
3917 .prepare(
3918 `SELECT e.*, src.file_path AS source_file_path, src.language AS source_language, tgt.file_path AS target_file_path
3919 FROM edges e
3920 JOIN nodes src ON src.id = e.source
3921 JOIN nodes tgt ON tgt.id = e.target
3922 WHERE e.target IN (${placeholders})
3923 AND e.kind != 'contains'
3924 AND (e.provenance IS NULL OR e.provenance != 'heuristic')`
3925 )
3926 .all(...chunk) as Array<EdgeRow & { source_file_path: string; source_language: Language; target_file_path: string }>;
3927 for (const row of rows) {
3928 out.push({
3929 ...rowToEdge(row),
3930 edgeId: row.id,
3931 sourceFilePath: row.source_file_path,
3932 sourceLanguage: row.source_language,
3933 targetFilePath: row.target_file_path,
3934 });
3935 }
3936 }
3937 return out;
3938 }
3939
3940 /**
3941 * 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