Analyzer::Python::Pyramid
Inherits Analyzer::Python::PythonEngine < Analyzer < FileHelper < Reference < Object
Constants
ACCESSOR_MAP = {"query" => ["params", "GET"], "form" => ["POST"], "json" => ["json_body", "json"], "header" => ["headers"], "cookie" => ["cookies"]}
ACCESSOR_PATTERNS = ACCESSOR_MAP.flat_map do |param_type, accessors|
accessors.map do |accessor|
{param_type, /(?:self\.)?request\.#{accessor}\s*\[\s*[rf]?['"]([^'"]+)['"]\s*\]/, /(?:self\.)?request\.#{accessor}\.get(?:all|one)?\s*\(\s*[rf]?['"]([^'"]+)['"]/}
end
end
extract_request_params runs once per endpoint and used to rebuild
two PCRE2 patterns per accessor on every call (an interpolated regex
literal recompiles on every evaluation). The accessor set is fixed,
so precompile the access patterns once here; the .to_s expansion
is byte-identical to the previous inline form.
Tuple shape: {noir_param_type, bracket_re, get_re}
Class methods
tech_name
SourceInstance methods
analyze
Sourcetech
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.