Search documentation of Metastatic

# API Reference Metastatic v#0.2.0

View Source

## Modules

Metastatic

Documentation for `Metastatic`.

Metastatic.AST

M2: Meta-Model for Programming Language Abstract Syntax.

Metastatic.Adapter

Behaviour for language adapters (M1 ↔ M2 transformations).

Metastatic.Adapter.Registry

Registry for language adapters.

Metastatic.Adapters.Elixir

Elixir language adapter for MetaAST transformations.

Metastatic.Adapters.Elixir.FromMeta

Transform MetaAST (M2) back to Elixir AST (M1).

Metastatic.Adapters.Elixir.ToMeta

Transform Elixir AST (M1) to MetaAST (M2).

Metastatic.Adapters.Erlang

Erlang language adapter for MetaAST transformations.

Metastatic.Adapters.Erlang.FromMeta

Transform MetaAST (M2) back to Erlang AST (M1).

Metastatic.Adapters.Erlang.ToMeta

Transform Erlang AST (M1) to MetaAST (M2).

Metastatic.Adapters.Haskell

Haskell language adapter for Metastatic.

Metastatic.Adapters.Haskell.FromMeta

Transform MetaAST (M2) back to Haskell AST (M1).

Metastatic.Adapters.Haskell.Subprocess

Manages subprocess communication with the Haskell parser.

Metastatic.Adapters.Haskell.ToMeta

Transform Haskell AST (M1) to MetaAST (M2).

Metastatic.Adapters.Python

Python language adapter for MetaAST transformations.

Metastatic.Adapters.Python.FromMeta

Transform MetaAST (M2) back to Python AST (M1).

Metastatic.Adapters.Python.Subprocess

Subprocess management for Python parser and unparser.

Metastatic.Adapters.Python.ToMeta

Transform Python AST (M1) to MetaAST (M2).

Metastatic.Adapters.Ruby

Ruby language adapter for MetaAST transformations.

Metastatic.Adapters.Ruby.FromMeta

Transform MetaAST (M2) back to Ruby AST (M1).

Metastatic.Adapters.Ruby.Subprocess

Subprocess management for Ruby parser and unparser.

Metastatic.Adapters.Ruby.ToMeta

Transform Ruby AST (M1) to MetaAST (M2).

Metastatic.Analysis.Complexity

Code complexity analysis at the MetaAST level.

Metastatic.Analysis.Complexity.Cognitive

Cognitive complexity calculation.

Metastatic.Analysis.Complexity.Cyclomatic

Cyclomatic complexity calculation (McCabe metric).

Metastatic.Analysis.Complexity.Formatter

Formats complexity analysis results for different output formats.

Metastatic.Analysis.Complexity.FunctionMetrics

Function-level complexity metrics.

Metastatic.Analysis.Complexity.Halstead

Halstead complexity metrics calculation.

Metastatic.Analysis.Complexity.LoC

Lines of Code (LoC) metrics calculation.

Metastatic.Analysis.Complexity.Nesting

Maximum nesting depth calculation.

Metastatic.Analysis.Complexity.Result

Result structure for complexity analysis.

Metastatic.Analysis.ControlFlow

Control flow graph construction at the MetaAST level.

Metastatic.Analysis.ControlFlow.Result

Result structure for control flow graph analysis.

Metastatic.Analysis.DeadCode

Dead code detection at the MetaAST level.

Metastatic.Analysis.DeadCode.Result

Result structure for dead code analysis.

Metastatic.Analysis.Duplication

Code duplication detection at the MetaAST level.

Metastatic.Analysis.Duplication.Fingerprint

Structural fingerprinting for ASTs.

Metastatic.Analysis.Duplication.Reporter

Reporting and formatting for code duplication detection results.

Metastatic.Analysis.Duplication.Result

Result struct for code duplication detection analysis.

Metastatic.Analysis.Duplication.Similarity

Similarity calculation between ASTs for Type III clone detection.

Metastatic.Analysis.Duplication.Types

Clone type definitions for code duplication detection.

Metastatic.Analysis.Purity

Function purity analysis at the MetaAST level.

Metastatic.Analysis.Purity.Effects

Detects side effects in MetaAST nodes.

Metastatic.Analysis.Purity.Formatter

Formats purity analysis results for display.

Metastatic.Analysis.Purity.Result

Result structure for purity analysis.

Metastatic.Analysis.Security

Security vulnerability detection at the MetaAST level.

Metastatic.Analysis.Security.Result

Result structure for security vulnerability detection.

Metastatic.Analysis.Smells

Code smell detection at the MetaAST level.

Metastatic.Analysis.Smells.Result

Result structure for code smell detection.

Metastatic.Analysis.Taint

Taint analysis at the MetaAST level.

Metastatic.Analysis.Taint.Result

Result structure for taint analysis.

Metastatic.Analysis.UnusedVariables

Unused variable detection at the MetaAST level.

Metastatic.Analysis.UnusedVariables.Result

Result structure for unused variable analysis.

Metastatic.Builder

High-level API for building MetaAST documents from source code.

Metastatic.CLI

Shared utilities for Metastatic CLI commands.

Metastatic.CLI.Formatter

Output formatting utilities for Metastatic CLI.

Metastatic.CLI.Inspector

AST inspection and analysis logic for Metastatic CLI.

Metastatic.CLI.Translator

Cross-language translation orchestration for Metastatic CLI.

Metastatic.Document

A MetaAST Document wraps an M2 AST with metadata and language information.

Metastatic.Supplemental

Behaviour for supplemental modules that extend language adapter capabilities.

Metastatic.Supplemental.CompatibilityMatrix

Provides a compatibility matrix showing which supplemental modules support which constructs for each language.

Metastatic.Supplemental.Error

Error types for supplemental module system.

Metastatic.Supplemental.Error.ConflictError

Raised when multiple supplementals attempt to handle the same construct.

Metastatic.Supplemental.Error.IncompatibleSupplementalError

Raised when a supplemental module's dependencies are incompatible.

Metastatic.Supplemental.Error.MissingSupplementalError

Raised when a required supplemental module is not registered.

Metastatic.Supplemental.Error.UnsupportedConstructError

Raised when a MetaAST construct has no transformation path.

Metastatic.Supplemental.Info

Metadata structure for supplemental modules.

Metastatic.Supplemental.Python.Asyncio

Supplemental module for Python's `asyncio` library.

Metastatic.Supplemental.Python.Pykka

Pykka actor library supplemental for Python.

Metastatic.Supplemental.Registry

Registry for supplemental modules.

Metastatic.Supplemental.Transformer

Helper module for transforming MetaAST using registered supplementals.

Metastatic.Supplemental.Validator

Validates supplemental module availability and compatibility.

Metastatic.Test.AdapterHelper

Testing utilities for language adapters (M1 ↔ M2 transformations).

Metastatic.Test.FixtureHelper

Helper utilities for loading and managing test fixtures.

Metastatic.Validator

Conformance validation for MetaAST.

## Mix Tasks

mix metastatic.analyze

Analyze MetaAST structure and provide detailed metrics.

mix metastatic.code_smells
mix metastatic.complexity

Analyzes code complexity for a given file.

mix metastatic.control_flow
mix metastatic.dead_code

Detects dead code in a given file.

mix metastatic.detect_duplicates

Detects code duplication across MetaAST documents.

mix metastatic.gen.supplemental

Generates a new supplemental module scaffold.

mix metastatic.inspect

Inspect the MetaAST structure of source code files.

mix metastatic.purity_check

Analyzes code purity for a given file.

mix metastatic.security_scan
mix metastatic.supplemental_check

Analyzes code to detect required supplemental modules.

mix metastatic.taint_check
mix metastatic.translate

Translate source code from one programming language to another using MetaAST.

mix metastatic.unused_vars

Detects unused variables in a given file.

mix metastatic.validate_equivalence

Validate that two source files have semantically equivalent MetaAST representations.