Search documentation of Metastatic

# mix metastatic.control_flow (Metastatic v0.13.2)

View Source

Generates a control flow graph (CFG) for a given source file.

## Usage

    mix metastatic.control_flow FILE [options]

## Options

- `--format` - Output format: json (default), dot, or d3
- `--language` - Source language: python, elixir, erlang, ruby, or haskell (auto-detected if not specified)
- `--output` - Write output to file instead of stdout

## Examples

    # Generate CFG in DOT format (for Graphviz)
    mix metastatic.control_flow my_file.py --format dot

    # Generate D3.js JSON for interactive visualization
    mix metastatic.control_flow my_file.ex --format d3 --output cfg.json

    # JSON output (default)
    mix metastatic.control_flow my_file.rb

## Output Formats

- `json` - Full CFG as JSON map (default)
- `dot` - DOT format for Graphviz rendering
- `d3` - D3.js JSON for web visualization

## Exit Codes

- 0 - Success
- 2 - Error during analysis