KogenCredo.Diff.Rules.QueryLostLimit (KogenCredo v0.1.0)
View Sourcequery-lost-limit: a changed function that builds or runs an Ecto query bounded it in SQL at
the base (limit, from ... limit:, first/last, a *paginat* call) and no longer does
at the head.
Bounds and repo reads are counted in the function plus every same-module function it reaches
(transitively, by name), so moving the limit into a helper is quiet. A bound that left
together with its whole query (fewer repo reads) is not a hit. The repo receiver is
alias-aware (:repo_names, :repo_modules). Multi-clause and guarded functions are judged as
a whole.
Evidence in the message: Enum stages after Repo.all (take, uniq_by, slice, ...), the
usual in-memory replacement.
Limits
A bound moved into another module's query builder is a false hit; a query built in one function and run unbounded in its caller is only caught when the builder itself lost the bound; limits held in module attributes or macros are invisible. Bounds are counted over the whole function plus its helpers, so a bound lost from one query can be masked by a bound added to another query of the same function. Advisory by default; this implementation has not been swept on any history, and no precision is claimed.