Analyzer::Swift::Kitura
Inherits Analyzer::Swift::SwiftEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object
Constants
Maximum number of lines to look ahead for function parameters
route_definition? runs on every scanned line (route detection, param
lookahead, body-boundary checks). One precompiled Regex.union scan
(PCRE2 JIT) replaces six naive String#includes? char scans; union
auto-escapes each literal so it is provably equivalent to the
OR-of-substrings it replaces.
Patterns for route definitions in Kitura: router.get("path") { ... } router.post("path", handler: handler) router.all("/path") { ... }
let router = Router() / func boot(router: Router) — the receivers a
Kitura route is registered on. Tracking them makes detection
receiver-aware, so look-alike .get/.delete/... calls on models or
services (Grade.delete(id:), cache.get(...)) stop becoming phantom
endpoints.
Class methods
Instance methods
Extract parameters from function body
Extract path parameters from the route pattern (e.g., :id, :userID)
Parse route path from route arguments Examples: "/hello" -> /hello "/users/:id" -> /users/:id "/api/users/:userID" -> /api/users/:userID
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.