Metastatic.Analysis.Cohesion.Formatter
(Metastatic v0.10.4)
View Source
Formatters for cohesion analysis results.
Supports multiple output formats:
:text- Human-readable text format:json- Machine-readable JSON format:detailed- Detailed text with all metrics and recommendations
Examples
iex> result = %Metastatic.Analysis.Cohesion.Result{
...> container_name: "Calculator",
...> lcom: 0,
...> tcc: 1.0,
...> assessment: :excellent
...> }
iex> Metastatic.Analysis.Cohesion.Formatter.format(result, :text)
"Calculator: Excellent cohesion (LCOM: 0, TCC: 1.00)"
Summary
Functions
Format cohesion analysis result.
Functions
@spec format(Metastatic.Analysis.Cohesion.Result.t(), :text | :json | :detailed) :: String.t()
Format cohesion analysis result.
Formats
:text- Single line summary:json- JSON object:detailed- Multi-line detailed report
Examples
iex> result = %Metastatic.Analysis.Cohesion.Result{container_name: "Foo", lcom: 0, tcc: 1.0, assessment: :excellent}
iex> Metastatic.Analysis.Cohesion.Formatter.format(result, :text)
"Foo: Excellent cohesion (LCOM: 0, TCC: 1.00)"