# Reach v2.2.0 - Table of Contents

Program dependence graph for Elixir, Erlang, Gleam, JavaScript, and TypeScript

## GUIDES

- [Changelog](changelog.md)
- [License](license.md)

- Introduction
  - [Overview](overview.md)
  - [Installation](installation.md)
  - [Quickstart](quickstart.md)

- Canonical CLI
  - [Canonical CLI](cli.md)
  - [JSON Output](json-output.md)

- Configuration
  - [Configuration](configuration.md)

- Concepts
  - [Concepts](concepts.md)

- Validation
  - [Validation](validation.md)

- Recipes
  - [Recipes](recipes.md)

- Contributing
  - [Contributing](contributing.md)

## Modules

- [Reach.Analysis](Reach.Analysis.md): Shared analysis helpers for project-wide queries.
- [Reach.CallGraph](Reach.CallGraph.md): Builds call graph edges between function definitions.
- [Reach.CloneAnalysis](Reach.CloneAnalysis.md): Process-dictionary-cached clone detection dispatcher.
- [Reach.CloneAnalysis.Clone](Reach.CloneAnalysis.Clone.md): Struct for a clone family (a group of similar code fragments).
- [Reach.CloneAnalysis.ExDNA](Reach.CloneAnalysis.ExDNA.md): ExDNA-backed clone detection provider.
- [Reach.CloneAnalysis.Fragment](Reach.CloneAnalysis.Fragment.md): Struct for a single code fragment within a clone family.
- [Reach.Concurrency](Reach.Concurrency.md): Detects concurrency patterns (Task, spawn, GenServer calls).
- [Reach.Config](Reach.Config.md): Parses and normalizes .reach.exs architecture policy configuration.
- [Reach.DependencySummary](Reach.DependencySummary.md): Summarizes function dependencies (callers, callees, shared state).
- [Reach.Graph](Reach.Graph.md): Adjacency-list graph data structure with vertex and edge operations.
- [Reach.GraphAlgorithms](Reach.GraphAlgorithms.md): Graph traversal algorithms (BFS, DFS, reachability, SCC).
- [Reach.HigherOrder](Reach.HigherOrder.md): Resolves higher-order function references to concrete callees.
- [Reach.IR.Counter](Reach.IR.Counter.md): Monotonic ID counter for IR node construction.

- Public API
  - [Reach](Reach.md): Program Dependence Graph for Elixir and Erlang.
  - [Reach.Project](Reach.Project.md): Multi-file project analysis.

- CLI Commands
  - [Reach.CLI.Commands.Check](Reach.CLI.Commands.Check.md): Runs structural validation and change-safety checks.
  - [Reach.CLI.Commands.Inspect](Reach.CLI.Commands.Inspect.md): Explains one function, module, file, or line.
  - [Reach.CLI.Commands.Map](Reach.CLI.Commands.Map.md): Shows a project-level map of modules, coupling, hotspots, depth, effects,
boundaries, and data-flow summaries.
  - [Reach.CLI.Commands.OTP](Reach.CLI.Commands.OTP.md): Shows GenServer state machines, missing message handlers, and hidden coupling.
  - [Reach.CLI.Commands.OTP.Concurrency](Reach.CLI.Commands.OTP.Concurrency.md): Concurrency patterns — Task.async/await pairing, process monitors,
spawn_link chains, and supervisor topology.
  - [Reach.CLI.Commands.Report](Reach.CLI.Commands.Report.md): Analyze code with Reach and generate an interactive dependency graph.
  - [Reach.CLI.Commands.Trace](Reach.CLI.Commands.Trace.md): Traces data flow, taint paths, and forward/backward slices.
  - [Reach.CLI.Commands.Trace.Flow](Reach.CLI.Commands.Trace.Flow.md): Traces data flow from sources to sinks. Detects taint paths where
untrusted input reaches dangerous operations.
  - [Reach.CLI.Commands.Trace.Slice](Reach.CLI.Commands.Trace.Slice.md): Program slicing — finds the minimum set of statements that affect a value.

- Project Queries
  - [Reach.Project.Query](Reach.Project.Query.md): Query API for filtering and searching project nodes and edges.

- Inspect
  - [Reach.Inspect.Candidates](Reach.Inspect.Candidates.md): Finds advisory graph-backed refactoring candidates for one target function.

  - [Reach.Inspect.Context](Reach.Inspect.Context.md): Builds agent-readable context bundles for a single target function.

  - [Reach.Inspect.Data](Reach.Inspect.Data.md): Builds target-local data-flow summaries for `mix reach.inspect`.

  - [Reach.Inspect.Data.EdgeSummary](Reach.Inspect.Data.EdgeSummary.md): Struct for a cross-function data flow edge summary.
  - [Reach.Inspect.Data.NodeSummary](Reach.Inspect.Data.NodeSummary.md): Struct for a data flow node summary.
  - [Reach.Inspect.Data.Result](Reach.Inspect.Data.Result.md): Struct for data inspection results.
  - [Reach.Inspect.Data.VariableSummary](Reach.Inspect.Data.VariableSummary.md): Struct for a variable flow summary.
  - [Reach.Inspect.Deps](Reach.Inspect.Deps.md): Builds dependency summaries for one target function.

  - [Reach.Inspect.Impact](Reach.Inspect.Impact.md): Builds impact summaries for a target function.

  - [Reach.Inspect.Why](Reach.Inspect.Why.md): Finds and explains relationship paths between two targets.
  - [Reach.Inspect.Why.Path](Reach.Inspect.Why.Path.md): Struct for a single relationship path with evidence.
  - [Reach.Inspect.Why.Result](Reach.Inspect.Why.Result.md): Struct for why-path query results.

- Map
  - [Reach.Map.Analysis](Reach.Map.Analysis.md): Computes project-wide summaries including modules, hotspots, coupling, effects, depth, and data flow.
  - [Reach.Map.Boundary](Reach.Map.Boundary.md): Struct for functions with multiple distinct side-effect kinds.
  - [Reach.Map.Coupling](Reach.Map.Coupling.md): Struct for module coupling metrics including afferent, efferent, and instability.
  - [Reach.Map.Cycle](Reach.Map.Cycle.md): Struct for a module dependency cycle with its components.
  - [Reach.Map.DataFunction](Reach.Map.DataFunction.md): Struct for a function with cross-function data flow edges.
  - [Reach.Map.DataSummary](Reach.Map.DataSummary.md): Struct for a cross-function data flow summary.
  - [Reach.Map.DepthMetric](Reach.Map.DepthMetric.md): Struct for control nesting depth metrics of a function.
  - [Reach.Map.EffectCall](Reach.Map.EffectCall.md): Struct for a call site with its classified effect.
  - [Reach.Map.EffectRow](Reach.Map.EffectRow.md): Struct for a per-function effect classification row.
  - [Reach.Map.EffectSummary](Reach.Map.EffectSummary.md): Struct for project-wide effect distribution.
  - [Reach.Map.Hotspot](Reach.Map.Hotspot.md): Struct for complexity × callers hotspot metrics.
  - [Reach.Map.ModuleCoupling](Reach.Map.ModuleCoupling.md): Struct for per-module coupling detail.
  - [Reach.Map.ModuleMetric](Reach.Map.ModuleMetric.md): Struct for per-module complexity metrics.
  - [Reach.Map.Summary](Reach.Map.Summary.md): Struct for project-level summary statistics.
  - [Reach.Map.UnknownCall](Reach.Map.UnknownCall.md): Struct for a call with unresolved effect classification.
  - [Reach.Map.XrefEdge](Reach.Map.XrefEdge.md): Struct for a cross-function reference edge.

- Trace
  - [Reach.Trace.Flow](Reach.Trace.Flow.md): Taint and variable flow tracing through data dependence edges.
  - [Reach.Trace.Flow.Path](Reach.Trace.Flow.Path.md): Struct for a single taint flow path.
  - [Reach.Trace.Flow.Result](Reach.Trace.Flow.Result.md): Struct for flow trace results.
  - [Reach.Trace.Pattern](Reach.Trace.Pattern.md): Plugin-dispatched trace pattern presets.
  - [Reach.Trace.Slice](Reach.Trace.Slice.md): Backward and forward program slicing from a source location.
  - [Reach.Trace.Slice.Result](Reach.Trace.Slice.Result.md): Struct for program slice results.
  - [Reach.Trace.Slice.Statement](Reach.Trace.Slice.Statement.md): Struct for a single statement in a program slice.

- Check
  - [Reach.Check.Architecture](Reach.Check.Architecture.md): Validates `.reach.exs` architecture policies against project structure.
  - [Reach.Check.Candidate](Reach.Check.Candidate.md): Struct for an advisory refactoring candidate with confidence and proof.
  - [Reach.Check.Candidates](Reach.Check.Candidates.md): Generates graph-backed refactoring candidates from cycles, effects, and pure regions.
  - [Reach.Check.Changed](Reach.Check.Changed.md): Analyzes changed functions for risk, impact, and clone siblings.
  - [Reach.Check.Changed.Function](Reach.Check.Changed.Function.md): Struct for a changed function with risk metadata.
  - [Reach.Check.Changed.Result](Reach.Check.Changed.Result.md): Struct for changed-code analysis results.
  - [Reach.Check.DeadCode](Reach.Check.DeadCode.md): Finds dead code — pure expressions whose values are never used.

  - [Reach.Check.DeadCode.Finding](Reach.Check.DeadCode.Finding.md): Struct for a dead code finding.
  - [Reach.Check.Smells](Reach.Check.Smells.md): Runs structural and performance smell checks over a loaded project.

  - [Reach.Check.Violation](Reach.Check.Violation.md): Struct for an architecture policy violation.

- Smells
  - [Reach.Smell.Check](Reach.Smell.Check.md): Behaviour and shared helpers for IR-based smell checks.
  - [Reach.Smell.Checks.BehaviourCandidate](Reach.Smell.Checks.BehaviourCandidate.md): Detects module groups sharing the same public callback set.
  - [Reach.Smell.Checks.CloneConsistency](Reach.Smell.Checks.CloneConsistency.md): Detects structural drift across clone families.
  - [Reach.Smell.Checks.CollectionIdioms](Reach.Smell.Checks.CollectionIdioms.md): Pattern-based detection of suboptimal collection operations.
  - [Reach.Smell.Checks.ConfigPhase](Reach.Smell.Checks.ConfigPhase.md): Detects compile-time/runtime config phase mismatches.
  - [Reach.Smell.Checks.DualKeyAccess](Reach.Smell.Checks.DualKeyAccess.md): Detects mixed atom/string key access on the same map.
  - [Reach.Smell.Checks.FixedShapeMap](Reach.Smell.Checks.FixedShapeMap.md): Detects repeated map literals that should be structs.
  - [Reach.Smell.Checks.IdiomMismatch](Reach.Smell.Checks.IdiomMismatch.md): Detects non-idiomatic patterns such as guard equality and update-then-fetch.
  - [Reach.Smell.Checks.LoopAntipattern](Reach.Smell.Checks.LoopAntipattern.md): Detects O(n²) patterns in loops and recursive functions.
  - [Reach.Smell.Checks.PipelineWaste](Reach.Smell.Checks.PipelineWaste.md): Pattern-based detection of redundant pipeline operations.
  - [Reach.Smell.Checks.RedundantComputation](Reach.Smell.Checks.RedundantComputation.md): Detects duplicate pure calls within the same function.
  - [Reach.Smell.Checks.StringBuilding](Reach.Smell.Checks.StringBuilding.md): Detects string concatenation where iolists are more efficient.
  - [Reach.Smell.Finding](Reach.Smell.Finding.md): Struct for smell check findings with location and evidence.
  - [Reach.Smell.Helpers](Reach.Smell.Helpers.md): Shared helpers for smell checks including loop detection, statement pairs, and callbacks.
  - [Reach.Smell.PatternCheck](Reach.Smell.PatternCheck.md): Macro DSL for ExAST-backed pattern smell checks.
  - [Reach.Smell.Registry](Reach.Smell.Registry.md): Auto-discovers and lists all smell check modules.

- OTP
  - [Reach.OTP](Reach.OTP.md): Entry point for OTP analysis, covering GenServer, gen_statem, and supervisor patterns.
  - [Reach.OTP.Analysis](Reach.OTP.Analysis.md): Analyzes GenServer and gen_statem state machines from IR to extract behaviours, state transforms, and missing handlers.
  - [Reach.OTP.Analysis.Behaviour](Reach.OTP.Analysis.Behaviour.md): Struct representing a detected OTP behaviour with its callbacks and state transforms.
  - [Reach.OTP.Analysis.MissingHandler](Reach.OTP.Analysis.MissingHandler.md): Struct representing a missing GenServer or gen_statem handler finding.
  - [Reach.OTP.Analysis.Result](Reach.OTP.Analysis.Result.md): Struct holding the combined results of an OTP analysis run.
  - [Reach.OTP.Analysis.StateTransform](Reach.OTP.Analysis.StateTransform.md): Struct representing a state transformation performed within an OTP callback.
  - [Reach.OTP.Analysis.Supervisor](Reach.OTP.Analysis.Supervisor.md): Struct representing extracted supervisor child specifications.
  - [Reach.OTP.Concurrency](Reach.OTP.Concurrency.md): Detects concurrency patterns such as tasks, spawns, monitors, and supervisors across project functions.
  - [Reach.OTP.Concurrency.Result](Reach.OTP.Concurrency.Result.md): Struct holding the results of a concurrency pattern analysis.
  - [Reach.OTP.Coupling](Reach.OTP.Coupling.md): Detects hidden coupling across modules via shared ETS tables, process dictionary keys, and message patterns.
  - [Reach.OTP.CrossProcess](Reach.OTP.CrossProcess.md): Analyzes cross-process data dependencies by tracing effects through GenServer call/cast boundaries.
  - [Reach.OTP.DeadReply](Reach.OTP.DeadReply.md): Detects GenServer.call sites where the reply value is discarded.
  - [Reach.OTP.GenServer](Reach.OTP.GenServer.md): Extracts GenServer state access patterns, callbacks, and reply semantics from module IR.
  - [Reach.OTP.GenStatem](Reach.OTP.GenStatem.md): Extracts gen_statem states, transitions, and event handlers from module IR.

- IR
  - [Reach.IR](Reach.IR.md): Internal Representation tree utilities.
  - [Reach.IR.Helpers](Reach.IR.Helpers.md): Utility functions for IR node inspection and traversal.
  - [Reach.IR.Node](Reach.IR.Node.md): A node in the internal representation.

- Analysis
  - [Reach.ControlDependence](Reach.ControlDependence.md): Computes control dependence from CFG and post-dominators.
  - [Reach.ControlFlow](Reach.ControlFlow.md): Translates IR nodes into control flow graph vertices and edges.
  - [Reach.DataDependence](Reach.DataDependence.md): Computes data dependence (def-use chains) from IR.
  - [Reach.Dominator](Reach.Dominator.md): Immediate dominator/post-dominator trees and dominance frontiers.
  - [Reach.Effects](Reach.Effects.md): Effect classification for IR nodes.
  - [Reach.SystemDependence](Reach.SystemDependence.md): Builds system dependence graph from per-function PDGs.

- Frontends
  - [Reach.Frontend](Reach.Frontend.md): Registry dispatching source files to language-specific frontends.
  - [Reach.Frontend.BEAM](Reach.Frontend.BEAM.md): BEAM bytecode frontend for analyzing compiled .beam files.
  - [Reach.Frontend.Elixir](Reach.Frontend.Elixir.md): Translates Elixir AST into Reach IR nodes.
  - [Reach.Frontend.Erlang](Reach.Frontend.Erlang.md): Translates Erlang abstract forms into Reach IR nodes.
  - [Reach.Frontend.Gleam](Reach.Frontend.Gleam.md): Gleam source frontend — parses `.gleam` files into Reach IR.
  - [Reach.Frontend.JavaScript](Reach.Frontend.JavaScript.md): JavaScript source frontend — parses `.js` files into Reach IR.

- Visualization
  - [Reach.Visualize](Reach.Visualize.md): Generates interactive HTML reports from project analysis.
  - [Reach.Visualize.ControlFlow](Reach.Visualize.ControlFlow.md): Decomposes CFG into visualization blocks and edges.
  - [Reach.Visualize.Graph.JSON](Reach.Visualize.Graph.JSON.md): Serializes graph data to JSON for frontend rendering.
  - [Reach.Visualize.Helpers](Reach.Visualize.Helpers.md): Shared helpers for source extraction and line mapping.
  - [Reach.Visualize.Source](Reach.Visualize.Source.md): Extracts and highlights source code snippets for blocks.

- Plugins
  - [Reach.Plugin](Reach.Plugin.md): Behaviour for library-specific analysis plugins.
  - [Reach.Plugins.Ash](Reach.Plugins.Ash.md): Plugin for Ash framework action and resource semantics.
  - [Reach.Plugins.Ecto](Reach.Plugins.Ecto.md): Plugin for Ecto query DSL, Repo calls, and schema semantics.
  - [Reach.Plugins.GenStage](Reach.Plugins.GenStage.md): Plugin for GenStage producer/consumer semantics.
  - [Reach.Plugins.Helpers](Reach.Plugins.Helpers.md): Shared helpers for plugin callback implementations.
  - [Reach.Plugins.JSON](Reach.Plugins.JSON.md): Plugin for Jason encoding effect classification.
  - [Reach.Plugins.Jido](Reach.Plugins.Jido.md): Plugin for Jido action, signal, and tool semantics.
  - [Reach.Plugins.Oban](Reach.Plugins.Oban.md): Plugin for Oban worker and job semantics.
  - [Reach.Plugins.OpenTelemetry](Reach.Plugins.OpenTelemetry.md): Plugin for OpenTelemetry span and context propagation.
  - [Reach.Plugins.Phoenix](Reach.Plugins.Phoenix.md): Plugin for Phoenix conn, LiveView, and channel semantics.
  - [Reach.Plugins.QuickBEAM](Reach.Plugins.QuickBEAM.md): Plugin for cross-language analysis of QuickBEAM (Elixir + JavaScript).

## Mix Tasks

- [mix reach](Mix.Tasks.Reach.md): Generates an interactive HTML report for Elixir/Erlang/Gleam/JavaScript source files.

- [mix reach.boundaries](Mix.Tasks.Reach.Boundaries.md): Removed compatibility task.
- [mix reach.concurrency](Mix.Tasks.Reach.Concurrency.md): Removed compatibility task.
- [mix reach.coupling](Mix.Tasks.Reach.Coupling.md): Removed compatibility task.
- [mix reach.dead_code](Mix.Tasks.Reach.DeadCode.md): Removed compatibility task.
- [mix reach.deps](Mix.Tasks.Reach.Deps.md): Removed compatibility task.
- [mix reach.depth](Mix.Tasks.Reach.Depth.md): Removed compatibility task.
- [mix reach.effects](Mix.Tasks.Reach.Effects.md): Removed compatibility task.
- [mix reach.flow](Mix.Tasks.Reach.Flow.md): Removed compatibility task.
- [mix reach.graph](Mix.Tasks.Reach.Graph.md): Removed compatibility task.
- [mix reach.hotspots](Mix.Tasks.Reach.Hotspots.md): Removed compatibility task.
- [mix reach.impact](Mix.Tasks.Reach.Impact.md): Removed compatibility task.
- [mix reach.modules](Mix.Tasks.Reach.Modules.md): Removed compatibility task.
- [mix reach.otp](Mix.Tasks.Reach.Otp.md): Shows GenServer state machines, missing message handlers, and hidden coupling.
- [mix reach.slice](Mix.Tasks.Reach.Slice.md): Removed compatibility task.
- [mix reach.xref](Mix.Tasks.Reach.Xref.md): Removed compatibility task.

- Inspect
  - [mix reach.inspect](Mix.Tasks.Reach.Inspect.md): Explains one function, module, file, or line.

- Map
  - [mix reach.map](Mix.Tasks.Reach.Map.md): Shows a project-level map of modules, coupling, hotspots, depth, effects, boundaries, and data-flow summaries.

- Trace
  - [mix reach.trace](Mix.Tasks.Reach.Trace.md): Traces data flow, taint paths, and forward/backward slices.

- Check
  - [mix reach.check](Mix.Tasks.Reach.Check.md): Runs structural validation and change-safety checks.

- Smells
  - [mix reach.smell](Mix.Tasks.Reach.Smell.md): Removed compatibility task.

