class

Analyzer::Javascript::Express

Inherits Analyzer::Javascript::ExpressConstants < Analyzer::Javascript::JavascriptEngine < Analyzer < FileHelper < Reference < Object

Constants

EXPRESS_SOURCE_RE = Regex.union("require('express')", "require(\"express\")", "from 'express'", "from \"express\"", "express()", "express.Router(")

Precompiled once — a single PCRE2-JIT scan replaces six naive String#includes? substring scans over the whole file content. Regex.union auto-escapes each literal, so this is provably equivalent to the OR-of-includes? it replaces.

MAX_CHAIN_METHOD_DISTANCE = 1000

Constants for method chaining detection

MAX_CHAIN_SEARCH_DISTANCE = 5000

Class methods

tech_name
Source

Instance methods

analyze
Source
extract_path_from_route_handler(line : String) : String
Source
line_to_endpoint(line : String, router_detected : Bool = false) : Endpoint
Source
line_to_endpoint_multiline(line : String, next_line : String, router_detected : Bool = false) : Endpoint

Helper method to handle multi-line route definitions

Source
line_to_param(line : String) : Param
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