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

Method getUnresolvedReferencesCount

src/db/queries.ts:4510–4525  ·  view source on GitHub ↗

* Get the count of PENDING (never-attempted) references without loading * them into memory. Rows marked status='failed' — attempted by a completed * pass, no match — are excluded: they are not outstanding work, only retry * candidates for the #1240 sweep, so they must not trip the #1187 orp

()

Source from the content-addressed store, hash-verified

4508 * sweep or the `status` pending-refs warning.
4509 */
4510 getUnresolvedReferencesCount(): number {
4511 if (!this.stmts.getUnresolvedCount) {
4512 // An index built before schema v8 (1.4.0 and older) has no `status`,
4513 // and the v8 migration marks every one of its rows pending. A read-only
4514 // open migrates nothing (`codegraph status`, #2913), so count them all
4515 // until a writer's open has migrated it.
4516 if (!this.hasSchema('unresolved_refs', 'status')) {
4517 return (this.db.prepare('SELECT COUNT(*) as count FROM unresolved_refs').get() as { count: number }).count;
4518 }
4519 this.stmts.getUnresolvedCount = this.db.prepare(
4520 "SELECT COUNT(*) as count FROM unresolved_refs WHERE status = 'pending'"
4521 );
4522 }
4523 const row = this.stmts.getUnresolvedCount.get() as { count: number };
4524 return row.count;
4525 }
4526
4527 /**
4528 * Get a batch of PENDING unresolved references using LIMIT/OFFSET

Callers 9

indexAllMethod · 0.80
syncMethod · 0.80
constructorMethod · 0.80
db-perf.test.tsFile · 0.80

Calls 3

hasSchemaMethod · 0.95
getMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected