def hit.cont

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

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/lex.bend as Lex

317# a finding when the name is one of the reportable parameters
318def hit.cont(
319  mm: Maybe<&2, Lex.Tok>,
320  +accs: List<&2, String>,
321  +path: String,
322  +acc: List<&2, F.Finding>
323) -> List<&2, F.Finding>:
324  match mm:
325    case None{}:
326      acc
327    case Some{Lex.Tok{k, +t, l, c}}:
328      Bool.pick(List<&2, F.Finding>, List.contains(~String, ~String.eq, accs, t),
329        F.Finding{path, l, c, U32.from_nat(String.length(t)), "concat",
330          t ++ " is appended to and passed on through a continuation, which copies it on every step and makes the loop quadratic; prepend each chunk and reverse once at the end."} <> acc,
331        acc)

Uses (11)

Used by (1)