def hits

bolt@1.27.0.0 · src/rules/suspicious/concat.bend:185

import bolt@1.27.0.0/src/rules/suspicious/concat.bend as Concat
import Base
import bolt@1.27.0.0/src/finding.bend as F
import bolt@1.27.0.0/src/syntax/tree.bend as Tree

185# the findings on a self-call's arguments, each against the parameter in its
186# position (params, from the argument's own slot on)
187def hits(
188  as: List<&2, Tree.Node>,
189  +params: List<&2, String>,
190  +lets: List<&2, Let>,
191  +path: String,
192  acc: List<&2, F.Finding>
193) -> List<&2, F.Finding>:
194  match as:
195    case Nil{}:
196      List.reverse(&2, F.Finding, acc)
197    case Con{+a, rest}:
198      +slot = Maybe.default(&2, String, List.head(&2, String, params), "")
199      was = seen(a, lets)
200      hits(rest, List.tail(&2, String, params), lets, path, hit(was, slot, path, acc))

Uses (11)

Used by (1)