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

Method getUnresolvedReferencesCount

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

4619 * sweep or the `status` pending-refs warning.
4620 */
4621 getUnresolvedReferencesCount(): number {
4622 if (!this.stmts.getUnresolvedCount) {
4623 // An index built before schema v8 (1.4.0 and older) has no `status`,
4624 // and the v8 migration marks every one of its rows pending. A read-only
4625 // open migrates nothing (`codegraph status`, #2913), so count them all
4626 // until a writer's open has migrated it.
4627 if (!this.hasSchema('unresolved_refs', 'status')) {
4628 return (this.db.prepare('SELECT COUNT(*) as count FROM unresolved_refs').get() as { count: number }).count;
4629 }
4630 this.stmts.getUnresolvedCount = this.db.prepare(
4631 "SELECT COUNT(*) as count FROM unresolved_refs WHERE status = 'pending'"
4632 );
4633 }
4634 const row = this.stmts.getUnresolvedCount.get() as { count: number };
4635 return row.count;
4636 }
4637
4638 /**
4639 * 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