Configuration for ExDNA.
Options can be provided in three layers (later wins):
- Built-in defaults
.ex_dna.exsconfig file in the project root- Keyword options passed to
ExDNA.analyze/1or CLI flags
Config file
Create .ex_dna.exs in your project root:
%{
min_mass: 25,
min_occurrences: 3,
ignore: ["lib/my_app_web/templates/**"],
excluded_macros: [:schema, :pipe_through, :plug],
normalize_pipes: true
}The file is evaluated with Code.eval_file/1 and must return a map.
Advanced tuning
:max_window_size— maximum number of consecutive sibling functions combined into a single fingerprint for cross-module clone detection. Higher values catch clones spanning more adjacent functions at the cost of more fragments to compare. Must be ≥ 2. Default:4.:mass_tolerance— maximum relative size difference allowed between two fragments for Type-III (fuzzy) comparison. A value of0.3means fragments are compared only if the smaller is at least 70% the size of the larger. Raise toward0.5to catch clones between thin wrappers and fat implementations. Must be in(0.0, 1.0]. Default:0.3.
Summary
Types
@type literal_mode() :: :keep | :abstract
@type t() :: %ExDNA.Config{ excluded_macros: [atom()], ignore: [String.t()], ignored_attributes: [atom()], literal_mode: literal_mode(), mass_tolerance: float(), max_window_size: pos_integer(), min_mass: pos_integer(), min_occurrences: pos_integer(), min_similarity: float(), normalize_pipes: boolean(), parse_timeout: pos_integer(), paths: [String.t()], reporters: [module()] }