Analyzer::Ruby::Grape
Inherits Analyzer::Ruby::RubyEngine < Analyzer < FileHelper < Reference < Object
Constants
Grape::API is absent from almost every .rb file in a large repo,
so String#includes? scanned each one end to end. One precompiled
matcher via content_matches? is the same test in a single pass.
class <Child> < <Super> declaration matcher (single capture: Super).
Full form capturing both Child and Super for the inheritance graph.
build_grape_index's whole-tree pre-pass gate OR-ed two
String#includes? scans over every file's content as a standalone
boolean gate. Folded into one precompiled union so it costs a single
PCRE2 match instead of up to two naive substring scans per file.
Crystal recompiles an interpolated regex literal (/^#{verb}.../)
on every evaluation — ~11000x slower than a precompiled one — so
matching the verb DSL inside the per-line loop used to recompile
14 regexes for every line of every Grape file. Build the per-verb
patterns once at load time instead. _WITH_PATH matches
get '/users' do (capturing the path literal/symbol); _BARE_DO
matches the path-less get do form.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.