Reach.OTP (Reach v2.3.1)

Copy Markdown View Source

Entry point for OTP analysis, covering GenServer, gen_statem, and supervisor patterns.

Summary

Functions

Adds OTP semantic edges to a libgraph based on IR analysis.

Detects which OTP behaviour a module uses, based on IR nodes.

Types

otp_edge_label()

@type otp_edge_label() ::
  :state_read
  | :state_write
  | :state_pass
  | :init_state
  | {:call_msg, atom()}
  | {:cast_msg, atom()}
  | :call_reply
  | {:ets_dep, atom() | nil}
  | {:pdict_dep, atom() | nil}
  | :message_order
  | {:state_transition, atom(), atom()}

Functions

analyze(ir_nodes, opts \\ [])

Adds OTP semantic edges to a libgraph based on IR analysis.

Returns a new Graph.t() containing only OTP edges. Merge this with the existing PDG/SDG graph.

detect_behaviour(ir_nodes)

@spec detect_behaviour([Reach.IR.Node.t()]) :: atom() | nil

Detects which OTP behaviour a module uses, based on IR nodes.

Returns :genserver, :gen_statem, :supervisor, :agent, or nil.