redline
LowPerformanceunbounded-fanout

Unbounded parallel calls

Unbounded parallel calls. Promise.all(ids.map starts one call per item, all at once. With 10,000 items that's 10,000 open requests.

This is how the comment reads inline, under the flagged line.

Why it matters

Unbounded fan-out exhausts connection pools, trips rate limits and can take down the service it calls.

What to do

Cap concurrency (p-limit, a semaphore, batches).

Examples

Flagged
await Promise.all(ids.map((id) => fetchUser(id)));
Better
await mapLimit(ids, 8, fetchUser);

What it catches

It reads a pattern on each line, aware of strings and comments. Languages: TypeScript and JavaScript, Python. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.

Flagged

await Promise.all(ids.map((id) => get(id)));
src/app.py
await asyncio.gather(*[f(x) for x in xs])

Left alone

await mapLimit(ids, 8, get);

Research

`Promise.all(items.map(...))` or `gather(*...)` with no limit. Thousands of calls at once exhaust pools and trip rate limits.

Turn it off or change it

In a config file for the CLI, or in the API's rules field:

{
  "rules": {
    "disable": [
      "unbounded-fanout"
    ],
    "severity": {
      "unbounded-fanout": "medium"
    }
  }
}

Read the source or report a false positive.