Analyzer::Javascript::Adonisjs
Inherits Analyzer < FileHelper < Reference < Object
Constants
ADONIS_MARKERS_RE = Regex.union("@adonisjs/core", "@ioc:Adonis")
Precompiled once — a single PCRE2-JIT scan replaces two naive String#includes? substring scans over the whole file content. Regex.union auto-escapes each literal, so it is provably equivalent to the OR-of-includes? it replaces.
ADONIS_ROOT_MARKERS = ["adonisrc.ts", "adonisrc.js", "package.json"]
CONTROLLER_EXTENSIONS = [".ts", ".js"]
CONTROLLER_IMPORT_RE = /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*\(\s*\)\s*=>\s*import\s*\(\s*['"]([^'"]+)['"]\s*\)|\bimport\s+([A-Za-z_$][\w$]*)\s+from\s+['"]([^'"]+)['"]/
const NotesController = () => import('#controllers/notes_controller')
(v6 lazy import) and import NotesController from '...'.
DESTRUCTURED_RE = /\{([^{}]*)\}\s*=\s*request\s*\.\s*(qs|body|all)\s*\(\s*\)/
JS_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts"]
REQUEST_BODY_RE = /\brequest\s*\.\s*body\s*\(\s*\)\s*(?:\.\s*([A-Za-z_$][\w$]*)|\[\s*['"]([^'"]+)['"]\s*\])/
REQUEST_COOKIE_RE = /\brequest\s*\.\s*(?:plainCookie|encryptedCookie|cookie)\s*\(\s*['"]([^'"]+)['"]/
REQUEST_HEADER_RE = /\brequest\s*\.\s*header\s*\(\s*['"]([^'"]+)['"]/
REQUEST_INPUT_RE = /\brequest\s*\.\s*input\s*\(\s*['"]([^'"]+)['"]/
REQUEST_ONLY_RE = /\brequest\s*\.\s*only\s*\(\s*\[([^\]]*)\]/
REQUEST_QS_RE = /\brequest\s*\.\s*qs\s*\(\s*\)\s*(?:\.\s*([A-Za-z_$][\w$]*)|\[\s*['"]([^'"]+)['"]\s*\])/
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.