Detector::Elixir::Plug
Constants
forward "/api", to: SomeRouter — Plug.Router's mount macro, in the
bare and parenthesized call forms.
The marker this replaces was "forward " AND "do:", and neither
half is Plug's: do: is Elixir's one-line function body and appears
in nearly every module, while forward is an ordinary identifier. Any
context module with a forward variable and a def …, do: … was
detected as Plug, so a plain Phoenix/Ecto project ran the Plug
analyzer over its whole tree for nothing.
to: is matched anywhere after the path rather than as the first
option, because forward/2 takes :host, :init_opts, :private
and :assigns in any order (forward "/", host: "api.", to: Api).
Instance methods
Cheap filename-only filter the detector pass uses to skip
detect on files the detector cannot possibly match. The
default true preserves prior behavior (every detector runs on
every file). Override with the same predicate the body of
detect starts with — e.g., filename.ends_with?(".py") for a
Python framework detector — so the detector loop avoids the
detect dispatch on files outside the detector's language.
On large codebases (saleor's 4255 .py files) this lifts ~100
virtual detect calls per file out of the hot loop because
most detectors' inner first-line is exactly this kind of cheap
filename check.