

























I maintain dupehound, an open source duplicate-code detector, and I hit a problem I do not have a clean answer to.
Tests repeat the same setup on purpose: build a fake user, spin up a test database, arrange the inputs the same way, across dozens of tests. To a structural detector that looks exactly like real duplication, just repeated structure, so it gets flagged. But it is not something anyone wants to delete.
The problem is that intentional repetition and accidental duplication look identical from the inside, so I do not think the tool can reliably guess which is which. The direction I am leaning is a human in the loop: an opt-in ignore or baseline, the way linters let you accept something once, while keeping the default first run zero-config so the tool stays useful out of the box.
How have you seen this handled well, in linters, static analysis, or other duplicate detectors? What worked, and what turned into noise or config hell?
Open issue with more detail: https://github.com/Rafaelpta/dupehound/issues/23
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。