Expand description
Per-function effect/risk detection and Hotspot assembly.
detect/mod.rs owns the own-body recursion driver (walk_own_body) — the
single place that decides, per the spec’s wrapper/inner-call attribution rules,
which sub-nodes are evaluated in the enclosing body (and so charged to this
function) and which are deferred (a nested def/lambda body, or a lazy
generator-expression element body — their own unit or simply uncounted).
Detectors (calls, later mutation/risk) stay pure: they receive the driver’s
callbacks and push Effects. analyze_unit is the single owner of turning the
collected effects/risks into a scored Hotspot.
Modules§
- calls
- World-effect detection: classifies effectful Python calls (fs/net/db, process
control, env read/write, concurrency, time, random, logging, stdin) plus bare
assert/raisestatements, emitting anEffectper signal. - expr
- Shared callee-rendering helpers used by both
callsandriskdetectors. - mutation
- Mutation detection with escape analysis for Python — the
fxrank-lang-pythonanalog offxrank-lang-ts’sdetect/mutation.rs. - risk
- Dynamic-code risk detection for the Python frontend.
Traits§
- Effect
Sink - A sink that receives the eagerly-evaluated effect sites of a function’s own
body, as decided by
walk_own_body. Each method is aclassify_* → pushhook.
Functions§
- analyze_
unit - Analyze one function-unit into an owned
Hotspot. - walk_
own_ body - Walk a function-unit’s own body and drive
sinkover every effect site that is evaluated in the enclosing body, per the spec’s attribution rules.