Rulesnorthwind-list-without-pagination

northwind-list-without-pagination

warning

northwind/correctness/list-without-pagination

Docs page ↗

A .list() result is treated as the complete set — the code reduces or maps over page.data and never looks at has_more or passes starting_after.

17

codebases affected, of 58

29%

of everything we scanned

no docs fix scored yet

0

docs commits aimed at this

Where it’s failing

List result is consumed as a complete collection, but has_more is never checked.

what we find

what we change it to

const page = await northwind.customers.list({ limit: 100 })
const outstanding = page.data
.reduce((sum, c) => sum + c.balance, 0)
// stops at customer 100 — the report just under-counts
let starting_after
let outstanding = 0
for (;;) {
const page = await northwind.customers.list({ limit: 100, starting_after })
for (const c of page.data) outstanding += c.balance
if (!page.has_more) break
starting_after = page.data[page.data.length - 1].id
}

Loop while page.has_more, passing starting_after: page.data[page.data.length - 1].id, or use the SDK auto-pagination helper (for await (const c of northwind.customers.list({ limit: 100 }).autoPaging())).

Metadata

Category
correctness
Type
suggestion
Severity
warning
Recommended
yes
Languages
javascriptpython

Live telemetry

17 / 58 scans

Fired in 29% of scanned codebases.

After every docs commit

No docs commits target this rule yet. When one merges, the next weeks of scans re-score it here.

A fix for your docs page

Wherever this rule fires, a page on your docs site taught it. api-doctor writes the edit and opens it as a pull request on your docs repo — you review and merge.

No fix yet

Draft a docs fix for this rule

api-doctor writes the docs change from the fire pattern — you review it