class

Analyzer::Perl::Catalyst

Inherits Analyzer::Perl::PerlEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

Constants

BARE_ATTR_VALUE = "__NOIR_BARE_ATTR__"
CONFIG_VALUE_PATTERNS = {"namespace" => [/namespace\s*=>\s*q\{([^}]*)\}/, /namespace\s*=>\s*q\(([^)]*)\)/, /namespace\s*=>\s*q\/([^\/]*)\//, /namespace\s*=>\s*'([^']*)'/, /namespace\s*=>\s*"([^"]*)"/], "path" => [/path\s*=>\s*q\{([^}]*)\}/, /path\s*=>\s*q\(([^)]*)\)/, /path\s*=>\s*q\/([^\/]*)\//, /path\s*=>\s*'([^']*)'/, /path\s*=>\s*"([^"]*)"/]}

Crystal recompiles an interpolated regex literal on every evaluation (a full PCRE2 JIT compile). config_value is only ever called with key "namespace" or "path" (see collect_controller_configs, which itself runs once per file from analyze/analyze_content and again from collect_actions), so precompile both key's pattern sets once at load time instead of rebuilding+recompiling five regexes per call.

HTTP_METHOD_ATTRS = {"get" => "GET", "post" => "POST", "put" => "PUT", "delete" => "DELETE", "patch" => "PATCH", "option" => "OPTIONS", "options" => "OPTIONS", "head" => "HEAD"}
HTTP_VERBS = ["get", "post", "put", "delete", "patch", "options", "head"] of ::String

Class methods

tech_name
Source

Instance methods

analyze
Source
analyze_content(content : String, file_path : String) : Array(Endpoint)
Source
analyze_file(path : String) : Array(Endpoint)
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