Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>DRYNew to Visual Studio Code? Get it now.
DRY

DRY

Toufiq Hasan Kiron

| (0) | Free
Detect duplicate code and refactor it before it becomes debt.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info
DRY Icon

DRY

Duplicate Detection + Refactor Assistant for VS Code

Catch repeated code while you write, then refactor it in one click.


Overview

DRY is a VS Code extension that scans your workspace for duplicate or near-duplicate code blocks across JS/TS files.

It raises duplicates as native diagnostics in the editor and Problems panel, then offers Quick Fix actions to extract repetition into reusable code.

If copy-paste creeps in, DRY shows where it is and helps you clean it up fast.


Features

  • Duplicate block detection across .js, .jsx, .ts, .tsx
  • Exact duplicate matching
  • Normalized structure matching (ignores comments, literals, and identifier names)
  • Problems panel diagnostics with related duplicate links
  • Status bar DRY indicator (click opens Quick Options)
  • Quick Fix actions:
    • DRY: Extract duplicate to function for same-file exact duplicates
    • DRY: Move duplicate to shared util for cross-file exact duplicates
  • Sidebar DRY Report with:
    • Project DRY score
    • Top duplicate clusters
    • Duplication hotspots by file

Commands

Open Command Palette and run:

  • DRY: Scan Workspace for Duplicates
  • DRY: Extract Duplicate to Function
  • DRY: Move Duplicate to Shared Util
  • DRY: Open Settings UI
  • DRY: Quick Options
  • DRY: Reset Settings

Configuration

DRY settings are available in VS Code Settings:

  • dry.minLines - Minimum block size to consider as duplicate
  • dry.maxLines - Maximum block size scanned per window
  • dry.enableNormalizedDetection - Enable near-duplicate structural matching
  • dry.excludeGlob - Files/folders excluded from scan

Use Case

DRY is useful when you:

  • Copy fetch/validation/error-handling logic across files
  • Repeat similar JSX sections with small prop/text changes
  • Duplicate utility logic in multiple modules
  • Want abstraction opportunities surfaced before CI or review

Press F5 in VS Code to run the extension in Extension Development Host.


Notes

  • Refactor quick fixes are intentionally conservative in MVP.
  • Auto-refactor is enabled only for exact duplicate clusters.
  • Normalized clusters are reported for awareness and manual follow-up.
  • Settings UI includes quick actions for save, reset defaults, and instant scan.

License

MIT License © Toufiq Hasan Kiron

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft