VS Code Extension

DRY

Duplicate Detection + Refactor Assistant for VS Code

Scans JS/TS workspaces, publishes duplicate diagnostics, and offers exact-match quick fixes.

src/features/duplicates.ts
native diagnostics + quick fixes
11export function groupUsersByRole(users: User[]) {
12 return users.reduce((map, user) => {
13 const key = user.role ?? "unknown";
14 if (!map[key]) map[key] = [];
15 map[key].push(user);
16 return map;
17 }, {} as Record<string, User[]>);
18}
20export function groupAdminsByRole(admins: User[]) {
21 return admins.reduce((map, admin) => {
22 const key = admin.role ?? "unknown";
23 if (!map[key]) map[key] = [];
24 map[key].push(admin);
25 return map;
26 }, {} as Record<string, User[]>);
27}
29function buildUserBadge(total: number) {
30 return `Users: ${total}`;
31}
33function buildAdminBadge(count: number) {
34 return `Admins: ${count}`;
35}

Problems (0)

Activation complete. Listening for edit/open/save/create/delete/rename/config events.

DRY report idle

Free & Open Source|MIT License

The Problem

Duplicate code is silent technical debt

Without DRY

Copy-paste logic spreads across files with no visibility.

Small fixes must be repeated in many places.

Near-duplicates hide behind renamed variables and literals.

Refactors happen late, usually after review feedback.

Problems: 0 duplicate diagnostics
Repeated blocks keep growing
No linked occurrences
Duplicate debt compounds

With DRY

Diagnostics highlight exact and normalized duplicate clusters.

Problems panel links related duplicate occurrences.

Quick Fix extracts exact duplicates to reusable functions.

DRY Report exposes score, top clusters, and hotspots.

Problems: exact duplicate (4 occurrences, 8 lines)
Code Action: Extract duplicate to function
DRY Report: score 86/100
Refactored before review

Features

Everything you need to keep code truly DRY

Auto workspace scan

Runs on startup and refreshes on edit/open/save/create/delete/rename/config changes.

Native diagnostics

Publishes exact duplicates as warnings and normalized duplicates as info in Problems.

Related duplicate links

Each diagnostic includes related occurrences so you can jump across files quickly.

Exact and normalized detection

Matches strict duplicates plus near-duplicates by normalizing comments, literals, and identifiers.

DRY Report sidebar

Shows project score, top duplicate clusters, and duplication hotspots by file.

Settings UI and Quick Options

Open settings webview, toggle normalized detection, scan now, or reset defaults directly.

Exact-only quick fixes

Extract duplicate to function or move duplicate to shared util for exact clusters.

Use Cases

Built for teams that want less copy-paste and cleaner reviews

Example: const user = await api.get('/users/:id')

When fetch and validation logic gets copied across files

Example: <UserCard name={name} email={email} role={role} />

When JSX blocks repeat with only small prop or text changes

Example: if (!input) throw new Error('required')

When guard clauses and handlers are duplicated everywhere

Example: const slug = value.toLowerCase().replace(/\s+/g, '-')

When utility logic drifts into multiple modules

Example: DRY: Scan Workspace for Duplicates

When you want duplicate clusters surfaced before review

Example: DRY: Move Duplicate to Shared Util

When repeated logic should become one shared abstraction

Settings UI

Mirrors the live DRY settings dashboard

Same controls, ranges, and workflow as the extension webview.

DRY: Settings UI

DRY Settings Dashboard

Enable Normalized Detection

Detect near-duplicates by normalizing comments, literals, and identifiers

Min Lines

4

Minimum block size to consider as duplicate

Max Lines

12

Maximum block size scanned per window

Exclude Glob

active

Skip generated/output folders during workspace scans

Excluded Paths

**/node_modules/**
**/.git/**
**/dist/**
**/build/**
**/out/**
**/.next/**
Status: Synced
"Copy-paste happens.
DRY helps you refactor before debt compounds."

Ready to reduce duplicate code?

Install DRY and refactor repetition before it becomes debt.

Install from Marketplace
DRYBuilt by Toufiq Hasan Kiron
MIT LicenseGitHub