Ragex. Analysis. Runner
(Ragex v0.18.2)
View Source
Shared analysis runner logic used by both Mix tasks and MCP tools.
Extracts the "run all analyses" pipeline so that:
mix ragex.analyzecan run it locally- The
comprehensive_analyzeMCP tool can run it on the server - Mix tasks can delegate to the running server via MCP without starting a second BEAM VM
Summary
Functions
Analyzes a directory and populates the knowledge graph.
Analyzes an explicit list of file paths and populates the knowledge graph.
Filters analysis results to only include issues touching the given files.
Runs all enabled analyses based on the config.
Types
@type analyze_result() :: %{ files_analyzed: non_neg_integer(), entities_found: non_neg_integer(), errors: list() }
Functions
@spec analyze_directory( String.t(), keyword() ) :: {:ok, analyze_result()} | {:error, term()}
Analyzes a directory and populates the knowledge graph.
Returns {:ok, analyze_result} or {:error, reason}.
@spec analyze_files( [String.t()], keyword() ) :: {:ok, analyze_result()} | {:error, term()}
Analyzes an explicit list of file paths and populates the knowledge graph.
Used by diff-based analysis to index only changed files.
Filters analysis results to only include issues touching the given files.
changed_files is a MapSet of relative file paths. Results whose file
path is not in the set are removed. Whole-project analyses (circulars,
coupling, etc.) pass through unfiltered since they represent structural
properties, not per-file issues.
Runs all enabled analyses based on the config.
Returns a map of %{analysis_type => result} matching the format
expected by Mix.Tasks.Ragex.Analyze formatters.