Cracker (cracker v0.1.0)
Analyzes Elixir code to generate a function call graph starting from a specified entry point. Outputs the graph in Mermaid format for visualization. Uses automatic ETS caching that cleans up after analysis.
Example usage
defmodule Example do @moduledoc false def run do # First verify ripgrep is installed case Cracker.verify_ripgrep_installed() do
{:ok, _} ->
graph_data =
Cracker.generate_graph({OpolloChat.Iris, :auto_reply, 3}, "/Users/bluzky/onpoint/opollo/",
ignore_modules: [
"OpolloOrderStatus",
"OrderStatus",
"Nested",
".changeset",
"QueryBuilder",
".t/0",
"Utils.",
"Status",
"Repo",
"FromType"
]
)
graph = Cracker.MermaidGenerator.generate(graph_data)
copy(graph)
IO.puts("Text copied to clipboard!")
# Write to file
# File.write!("function_graph.mmd", graph)
:ok
{:error, message} ->
IO.puts(message)
:error
end end
defp copy(text) do port = Port.open({:spawn, "pbcopy"}, [:binary]) Port.command(port, text) Port.close(port) end end