Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Turn a Repeated Mistake Into a Check

说明与用途

开发者多次复制数据库读取模式,产生44个重复代码块。引入单一通用Reader类型和工具检查消除重复并防止未来错误。

问题

Developers repeatedly copy generic database read patterns, creating 44 duplicated code blocks that differ only in error messages, leading to maintenance overhead and hidden bugs.

结果

Reduced code duplication from 44 instances to a single generic implementation, improving maintainability and preventing future mistakes.

工作流

  • Audit code for duplicate read patterns
  • Identify existing generic Reader implementation
  • Refactor duplicated code to use Reader
  • Add tooling checks (linter, tests, blocking hooks) to enforce non‑duplication

证据

44 copies of four shapes of reading rows out of the database.

来源

The rule said "don't copy a generic".

来源

  • 记录日期: 2026-09-15T17:30:38.297Z