Find safer places to modify behavior reached from one node
Source:R/change_impact.R
find_modification_points.RdWalks the internal callees reachable from a root node and ranks candidate functions by how locally they are used.
Arguments
- graph
An insider_graph object, a source directory, or an installed package name.
- name
Exact node name to look up.
Examples
dir <- tempfile()
dir.create(dir)
writeLines(
c(
"root <- function() mid()",
"mid <- function() leaf()",
"leaf <- function() 1"
),
file.path(dir, "code.R")
)
g <- build_graph(dir, cache = FALSE)
find_modification_points(g, "root")
#>
#> ── root ────────────────────────────────────────────────────────────────────────
#> • leaf | callers: 1 | exported: FALSE | compiled: FALSE | safe to patch locally
#> • mid | callers: 1 | exported: FALSE | compiled: FALSE | safe to patch locally