Duplytic
A VS Code extension that helps you find and visualize duplicate code in your projects.
Marketplace
·
Features
·
Installation
·
Usage
·
Configuration
Features
- Workspace-wide scanning – Analyze your entire project for duplicated code blocks.
- Rich duplication report – See total duplicated lines, percentage of duplication, and affected files.
- Clickable navigation – Jump straight into duplicated regions from the report.
- Inline code previews – View the duplicated fragments side-by-side in a modern webview.
- Multi-language support – Works with TypeScript, JavaScript, HTML, CSS, JSON, Markdown, and more.
Installation
From the VS Code Marketplace
- Open the Extensions view in VS Code.
- Search for "Duplytic" or install directly via:
code --install-extension thompson-development-group.duplytic
- Reload VS Code if prompted.
From source
- Clone the repository:
git clone https://github.com/Thompson-Development-Group/Duplytic.git
cd Duplytic
- Install dependencies:
npm install
- Compile the extension:
npm run compile
- Press
F5 in VS Code to launch a new Extension Development Host with Duplytic loaded.
Usage
- Open a workspace folder in VS Code.
- Open the Command Palette (
Cmd+Shift+P on macOS / Ctrl+Shift+P on Windows/Linux).
- Run "Scan for Code Duplication".
- A Duplytic report webview will open, showing:
- Overall duplication statistics.
- A list of duplicated blocks.
- Links you can click to open each duplicated region in the editor.
Configuration
You can customize how Duplytic scans your code by adding these settings to your VS Code settings.json:
{
"codeDuplicationDetector.minLines": 5,
"codeDuplicationDetector.minTokens": 50,
"codeDuplicationDetector.formats": ["**/*.{ts,tsx,js,jsx,html,css,scss,json,md}"],
"codeDuplicationDetector.exclude": ["**/node_modules/**", "**/dist/**"]
}
Extension settings
codeDuplicationDetector.minLines – Minimum number of lines to consider as a duplicate (default: 5).
codeDuplicationDetector.minTokens – Minimum number of tokens to consider as a duplicate (default: 50).
codeDuplicationDetector.formats – Glob patterns for files to include in the scan.
codeDuplicationDetector.exclude – Glob patterns for files and folders to exclude.
Requirements
- Node.js v14 or later available in your
PATH.
- Visual Studio Code
1.75.0 or higher.
Known Issues
- Large codebases may take some time to scan.
- Very small or highly similar boilerplate may produce occasional false positives.
Release Notes
0.1.0
- Initial release of Duplytic.
License
This project is licensed under the MIT License.
| |