Muex.FileAnalyzer (Muex v0.6.1)

View Source

Analyzes source files to determine which ones should be included in mutation testing.

Filters out files that are unlikely to benefit from mutation testing:

  • Framework/library internals (behaviours, protocols, supervisors)
  • Generated code and configuration
  • Pure data structures without logic
  • Files without test coverage

Summary

Functions

Analyzes a file entry and returns a priority score.

Filters a list of file entries based on analysis results.

Functions

analyze_file(map)

@spec analyze_file(map()) :: {:ok, non_neg_integer()} | {:skip, String.t()}

Analyzes a file entry and returns a priority score.

Returns {:ok, score} where score is:

  • 0: should skip (no business logic to test)
  • 1-10: low priority (mostly boilerplate)
  • 11-50: medium priority (some testable logic)
  • 51-100: high priority (significant business logic)

Returns {:skip, reason} if the file should be excluded.

filter_files(files, opts \\ [])

@spec filter_files(
  [map()],
  keyword()
) :: {[map()], [map()]}

Filters a list of file entries based on analysis results.

Options:

  • :min_score - Minimum score to include (default: 20)
  • :verbose - Show analysis details (default: false)