Skip to contents

Resolves a call to the function that really runs (following S3 dispatch), walks its internal call tree, and reports how replayable the call would be as standalone code, together with a static security scan of the involved functions.

Usage

explain_call(expr, max_depth = 5L)

Arguments

expr

An unevaluated function call, written as you would normally run it, e.g. predict(fit, newdata = recent_data) or stats::fivenum(x). For S3 generics the dispatch argument is evaluated once to determine the method.

max_depth

Maximum depth to follow same-package internal helpers.

Value

An object of class insider_explain with components resolution (the resolved function and method), tree (the static call tree), status (replay feasibility), and audit (a data frame of risky calls found by the static scan).

Examples

x <- c(1, 3, 5, 7, 100)
explain_call(stats::fivenum(x))
#> 
#> ── insideR call explanation ────────────────────────────────────────────────────
#> Original call: `stats::fivenum(x)`
#> Executing function: `fivenum()` from stats
#> 
#> ── Function path ──
#> 
#> fivenum()
#> ── Replay status ──
#> 
#> Full standalone replay looks possible.
#> 
#> ── Security notes (static scan) ──
#> 
#> No risky calls detected by the static scan.