class

Analyzer::Python::Tornado

Inherits Analyzer::Python::PythonEngine < Analyzer < FileHelper < Reference < Object

Constants

APP_INSTANCE_RE = /(#{PYTHON_VAR_NAME_REGEX})(?::#{PYTHON_VAR_NAME_REGEX})?=(?:tornado\.web\.)?Application\(/

Per-line matchers that interpolate only constants — hoisted so the analyze loop doesn't recompile identical PCRE2 patterns on every source line. The .to_s expansion is byte-identical to the inline literals, so matching behaviour is unchanged.

CLASS_DEF_REGEX = /^class\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*[\(:]/
HANDLER_LIST_RE = /^(#{PYTHON_VAR_NAME_REGEX})(?::#{DOT_NATION})?=\[/
REQUEST_PARAM_FIELDS = {"arguments" => {["GET"], "query"}, "body_arguments" => {["POST", "PUT", "PATCH", "DELETE"], "form"}, "files" => {["POST", "PUT", "PATCH", "DELETE"], "form"}, "body" => {["POST", "PUT", "PATCH", "DELETE"], "body"}, "headers" => {nil, "header"}, "cookies" => {nil, "cookie"}}

Reference: https://tornadoweb.org/en/stable/web.html Reference: https://tornadoweb.org/en/stable/httputil.html#tornado.httputil.HTTPServerRequest

REQUEST_PARAM_TYPES = {"query" => nil, "form" => ["POST", "PUT", "PATCH", "DELETE"], "body" => ["POST", "PUT", "PATCH", "DELETE"], "cookie" => nil, "header" => nil}

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

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.

Source