Skip to main content

Module detect

Module detect 

Source
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/raise statements, emitting an Effect per signal.
expr
Shared callee-rendering helpers used by both calls and risk detectors.
mutation
Mutation detection with escape analysis for Python — the fxrank-lang-python analog of fxrank-lang-ts’s detect/mutation.rs.
risk
Dynamic-code risk detection for the Python frontend.

Traits§

EffectSink
A sink that receives the eagerly-evaluated effect sites of a function’s own body, as decided by walk_own_body. Each method is a classify_* → push hook.

Functions§

analyze_unit
Analyze one function-unit into an owned Hotspot.
walk_own_body
Walk a function-unit’s own body and drive sink over every effect site that is evaluated in the enclosing body, per the spec’s attribution rules.