Analyzer::Go::Httprouter
Inherits Analyzer < FileHelper < Reference < Object
Constants
IMPORT_MARKER = "github.com/julienschmidt/httprouter"
IMPORT_MARKER_RE = Regex.union(IMPORT_MARKER)
One precompiled matcher instead of a String#includes? scan per
.go file: includes? runs Rabin-Karp over the whole buffer and
the marker is absent in the overwhelming majority of files in a
polyglot repo, so every one of them pays the full scan. See
Analyzer#content_matches?.
PARAM_PATTERNS = [{"ByName(", /ByName\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "path"}, {"Query().Get(", /Query\(\)\s*\.\s*Get\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "query"}, {"PostFormValue(", /PostFormValue\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "form"}, {"Header.Get(", /Header\s*\.\s*Get\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "header"}, {"Cookie(", /Cookie\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "cookie"}]
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.