Elixir Code Analysis
Structural analysis of Elixir applications, Phoenix services, and OTP supervision tree architectures
What Axiom Refract Analyzes in Elixir
Module and Alias Resolution
Resolves Elixir alias, import, use, and require directives. Maps the dependency graph across modules, including dependencies created by macro expansion from use statements.
OTP Supervision Tree Mapping
Maps the supervision tree hierarchy — supervisors, workers, GenServers, and dynamic supervisors. Identifies architectural patterns in fault-tolerant OTP applications and detects supervision strategy risks.
Phoenix Component Analysis
Maps Phoenix contexts, schemas, controllers, live views, and channels. Identifies coupling between Phoenix web layer components and domain logic contexts.
Behaviour Implementation Tracking
Tracks Elixir behaviour definitions and their implementations. Maps the contract-to-implementation dependency graph across the application.
How It Works
Elixir is parsed using a hand-hardened Tree-sitter grammar supporting Elixir 1.14 through 1.17 syntax, including dbg, multi-letter sigils, and binary matching improvements. The parser handles Elixir's macro system by recognizing common use macro patterns (use GenServer, use Phoenix.Controller) and inferring the dependencies they create. Mix project configurations and umbrella project structures are parsed for application-level dependency mapping.
Common Findings in Elixir Codebases
Context Boundary Violations
Phoenix contexts are intended to be bounded contexts, but applications frequently develop coupling between contexts through direct schema access. Axiom detects cross-context schema usage that violates boundary design.
GenServer Bottleneck Detection
Single GenServer processes that handle too many responsibilities become system bottlenecks. Axiom identifies GenServers with high interface complexity and many calling modules.
Umbrella App Coupling
Elixir umbrella applications can develop circular dependencies between child applications. Axiom detects inter-app dependency cycles that undermine the isolation umbrella apps are designed to provide.
Polyglot Support
Elixir is one of 145+ languages Axiom Refract supports through Tree-sitter AST parsing. Elixir analysis covers mix.exs, mix.lock, and umbrella project configurations. Phoenix, Ecto, Absinthe, and other framework-specific configurations are detected and included in structural analysis. Your entire codebase is analyzed in a single scan — regardless of how many languages it contains.