MetaCredo.Check.Refactor.CodeDuplication (MetaCredo v0.1.0)

View Source

Detects duplicate function bodies within the same module by comparing normalized AST structure. Functions with identical logic should be consolidated into a shared helper.

Category: Refactoring Opportunity / Priority: normal

Configuration

Accepts the following parameters via .metacredo.exs:

  • min_body_size - Minimum number of AST nodes in a function body to consider for duplication (default: 3) (default: 3)