Build DISPATCHES_ON and EXTENDS edges for OOP patterns
Source:R/edge_builders.R
build_dispatch_edges.RdScans R source files for S4 generics/methods, R5 reference classes, and R6 classes. Emits:
EXTENDSFrom child class node to parent, detected via
setClass(contains=),R6Class(inherit=), andsetRefClass(contains=).DISPATCHES_ONFrom a concrete S4 method node to the corresponding generic node when both appear in the parsed node set.
Arguments
- func_nodes
A list of node records from
extract_function_nodes().- r_files
Character vector of absolute paths to
.Rsource files.
Value
A data.frame with columns from, to,
weight, and edge_type. Zero rows when no OOP patterns
are detected.
Examples
if (FALSE) { # \dontrun{
proj <- detect_rproject("/path/to/mypkg")
nodes <- extract_function_nodes(proj$r_files)
edges <- build_dispatch_edges(nodes, proj$r_files)
} # }