ElixirScope.ASTRepository.ModuleData (elixir_scope v0.0.1)

Complete module representation with static AST and runtime correlation data.

This structure stores all information about a module including:

  • Original AST with instrumentation metadata
  • Static analysis results
  • Runtime correlation data
  • Performance metrics

Summary

Functions

Adds an error pattern to the module's runtime data.

Gets the AST node IDs for this module.

Gets the correlation IDs associated with this module.

Gets all function keys for this module.

Checks if the module has runtime correlation data.

Creates a new ModuleData structure from parsed AST.

Updates execution frequency data for a specific function.

Updates performance data for a specific function.

Updates the runtime insights for this module.

Types

ast_node_id()

@type ast_node_id() :: binary()

correlation_id()

@type correlation_id() :: binary()

function_key()

@type function_key() :: {module_name(), atom(), non_neg_integer()}

module_name()

@type module_name() :: atom()

t()

@type t() :: %ElixirScope.ASTRepository.ModuleData{
  ast: term(),
  ast_node_mapping: term(),
  attributes: term(),
  callbacks: term(),
  compilation_hash: term(),
  compilation_timestamp: term(),
  complexity_metrics: term(),
  correlation_metadata: term(),
  created_at: term(),
  dependencies: term(),
  error_patterns: term(),
  execution_frequency: term(),
  exports: term(),
  instrumentation_points: term(),
  message_flows: term(),
  module_name: term(),
  module_type: term(),
  patterns: term(),
  performance_data: term(),
  runtime_insights: term(),
  source_file: term(),
  updated_at: term(),
  version: term()
}

Functions

add_error_pattern(module_data, error_pattern)

@spec add_error_pattern(t(), map()) :: t()

Adds an error pattern to the module's runtime data.

get_ast_node_ids(module_data)

@spec get_ast_node_ids(t()) :: [ast_node_id()]

Gets the AST node IDs for this module.

get_correlation_ids(module_data)

@spec get_correlation_ids(t()) :: [correlation_id()]

Gets the correlation IDs associated with this module.

get_function_keys(module_data)

@spec get_function_keys(t()) :: [function_key()]

Gets all function keys for this module.

has_runtime_data?(module_data)

@spec has_runtime_data?(t()) :: boolean()

Checks if the module has runtime correlation data.

new(module_name, ast, opts \\ [])

@spec new(module_name(), term(), keyword()) :: t()

Creates a new ModuleData structure from parsed AST.

Parameters

  • module_name - The module name (atom)
  • ast - The parsed AST
  • opts - Optional parameters including source_file, instrumentation_points, etc.

update_execution_frequency(module_data, function_key, frequency)

@spec update_execution_frequency(t(), function_key(), non_neg_integer()) :: t()

Updates execution frequency data for a specific function.

update_performance_data(module_data, function_key, performance_metrics)

@spec update_performance_data(t(), function_key(), map()) :: t()

Updates performance data for a specific function.

update_runtime_insights(module_data, insights)

@spec update_runtime_insights(t(), map()) :: t()

Updates the runtime insights for this module.