class

Analyzer::Dart::Cli

Inherits CliEndpointSupport < Analyzer < FileHelper < Reference < Object

Surfaces the command-line attack surface of Dart programs as cli:// endpoints: the args package (ArgParser / CommandRunner) plus main(List<String>) argv and Platform.environment. Line-scan, merged by URL.

Constants

ADD_COMMAND = /\.addCommand\s*\(\s*['"]([^'"]+)['"]/
ADD_FLAG = /(\w+)\s*\.\s*addFlag\s*\(\s*['"]([^'"]+)['"]/
ADD_OPTION = /(\w+)\s*\.\s*addOption\s*\(\s*['"]([^'"]+)['"]/
ARGPARSER_VAR = /(\w+)\s*=\s*ArgParser\s*\(/
ARGS_IDX = /\bargs\s*\[\s*(\d+)\s*\]/
MARKERS = /package:args\/|package:dcli\/|\bArgParser\s*\(|\bCommandRunner\b|\bextends\s+Command\b|main\s*\(\s*List<String>/
PLATFORM_ENV = /Platform\.environment\s*\[\s*['"]([^'"]+)['"]\s*\]/
RUNNER_NAME = /\bget\s+name\s*=>\s*['"]([^'"]+)['"]/
SUBCOMMAND_VAR = /(\w+)\s*=\s*\w+\s*\.\s*addCommand\s*\(\s*['"]([^'"]+)['"]/
TEST_PATH_RE = Regex.union("/test/", "_test.")

Per-path test-file gate. A precompiled Regex.union (PCRE2 JIT) replaces the two OR-ed String#includes? scans it used to run — provably equivalent since union auto-escapes each literal.

WEB_RE = /package:shelf\/|package:dart_frog|package:angel3|package:alfred|\bHttpServer\.bind\b/

Class methods

tech_name
Source

Instance methods

analyze
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