Skip to content

Rules

Configure a rule as off, warning, or error. The CLI also accepts warn as an alias for warning.

Rule Default Meaning
duplicate-matcher Error Definitions use the same effective matcher.
normalized-matcher Error Matchers become equivalent after normalization.
ambiguous-step Error A concrete feature step matches multiple definitions.
overlapping-matcher Warning Two matchers accept the same step text, even if no feature exercises it.
duplicate-handler Error Different matchers have the same alpha-normalized handler.
near-duplicate-step Warning Matcher wording is close and handler behavior substantially overlaps.
parameterization-candidate Warning Handler structures differ primarily in literal values.
unused-definition Warning No discovered feature step uses the definition.

Each rule has its own reference page with meaning, evidence, remediation, and language support — see the Rules Reference section in the sidebar.

Jest-Cucumber’s inline scenario steps are positional rather than global matcher registrations. duplicate-matcher, normalized-matcher, ambiguous-step, overlapping-matcher, and unused-definition do not apply to them. The three handler-reuse rules still apply across Jest scenarios, and duplicate-handler can report identical matcher text. Handler pairs involving Jest-Cucumber or Vitest Cucumber Plugin must belong to the same framework, preserving their different argument conventions.

Rules run on the shared representation, but each source language supplies different evidence. Cucumber-Ruby support is experimental; its details are in Discovery and frameworks.

Inline suppressions: JavaScript/TypeScript // cuke-dedup:ignore RULE -- REASON, Cucumber-Ruby # cuke-dedup:ignore RULE -- REASON.

Exact matcher and handler groups with up to four definitions produce a linear spanning set of pair findings. Larger groups produce one bounded cluster finding with the complete member count and an explicit truncation signal. Duplication thresholds still count every member.

Fuzzy and structural-similarity rules remain pair findings so individual scores and comparisons are visible. Candidate blocking and work limits are described in Safety and limitations.

threshold is the percentage of discovered definitions permitted to participate in active, error-level duplication findings. It accepts 0 through 100 and defaults to 0.

Terminal window
cuke-dedup . --threshold 5

The numerator contains unique definition locations involved in these error-level rules:

  • duplicate-matcher
  • normalized-matcher
  • duplicate-handler
  • near-duplicate-step, when configured as an error
  • parameterization-candidate, when configured as an error

A definition is counted once even when it participates in several findings. Suppressed and baselined findings do not count. The denominator is every discovered definition, including those without findings.

The threshold passes when the unrounded percentage is less than or equal to the configured value. Active ambiguous-step, overlapping-matcher, and unused-definition errors remain independently fatal because they represent policies other than duplication tolerance. An empty project has a 0% duplication rate.

See Configuration for per-rule severities and suppressions.