class

Analyzer::Scala::Akka

Inherits Analyzer::Scala::ScalaEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

Constants

DIRECTIVE_ARGS_PATTERNS = {"pathPrefix" => /(?<![.\w])pathPrefix\s*\(([^)]*)\)/, "path" => /(?<![.\w])path\s*\(([^)]*)\)/}

Crystal recompiles an interpolated regex literal on every evaluation (a full PCRE2 JIT compile). directive_args runs twice per source line and the method matchers run once per HTTP verb per route, so precompile the fixed sets once at load time.

HTTP_METHODS = ["get", "post", "put", "delete", "patch", "head", "options"] of ::String
METHOD_BLOCK_PATTERNS = HTTP_METHODS.to_h do |method| {method, /(?<![.\w])#{Regex.escape(method)}\s*\{/} end
METHOD_SCOPE_PATTERNS = HTTP_METHODS.to_h do |method| {method, /(?<![.\w])#{Regex.escape(method)}(?![\w])/} end
PATH_DIRECTIVE_RE = /(?<![.\w])path[A-Za-z]*/

Any path-matching directive (path/pathPrefix/pathEnd/pathSingleSlash/…), used to keep a leaf-method emission from firing on a line that already carries its own path directive.

Class methods

tech_name
Source

Instance methods

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