jscpd

jscpd

Find duplicate code blocks and analyze duplication metrics across files. Use when identifying copy-pasted code, measuring technical debt, or preparing for refactoring.

2звезд
0форков
Обновлено 1/25/2026
SKILL.md
readonlyread-only
name
jscpd
description

Find duplicate code blocks and analyze duplication metrics across files. Use when identifying copy-pasted code, measuring technical debt, or preparing for refactoring.

jscpd

Duplicate code detector supporting 150+ languages.

Usage

# Analyze directory
npx jscpd /path/to/source

# With pattern filter
npx jscpd --pattern "src/**/*.js" .

# Ignore directories
npx jscpd --ignore "**/node_modules/**,**/dist/**" .

# Minimum tokens to match (default: 50)
npx jscpd --min-tokens 30 .

# Output formats
npx jscpd --reporters json --output report.json .
npx jscpd --reporters html --output ./report/ .

Common Options

Option Description
--min-tokens N Minimum tokens for duplicate detection
--min-lines N Minimum lines for duplicate detection
--threshold N Fail if duplication % exceeds threshold
--ignore "glob" Ignore patterns (comma-separated)
--reporters type Output format: console, json, html
--output path Output directory for reports
--silent Suppress console output

Workflow

  1. Run jscpd to find duplicates
  2. Review the reported duplicates
  3. Refactor to eliminate duplication
  4. Re-run to verify cleanup

You Might Also Like

Related Skills

fix

fix

243Kdev-testing

Use when you have lint errors, formatting issues, or before committing code to ensure it passes CI.

peekaboo

peekaboo

179Kdev-testing

Capture and automate macOS UI with the Peekaboo CLI.

frontend-testing

frontend-testing

128Kdev-testing

Generate Vitest + React Testing Library tests for Dify frontend components, hooks, and utilities. Triggers on testing, spec files, coverage, Vitest, RTL, unit tests, integration tests, or write/review test requests.

frontend-code-review

frontend-code-review

127Kdev-testing

Trigger when the user requests a review of frontend files (e.g., `.tsx`, `.ts`, `.js`). Support both pending-change reviews and focused file reviews while applying the checklist rules.

code-reviewer

code-reviewer

92Kdev-testing

Use this skill to review code. It supports both local changes (staged or working tree) and remote Pull Requests (by ID or URL). It focuses on correctness, maintainability, and adherence to project standards.

google-gemini avatargoogle-gemini
Получить
session-logs

session-logs

90Kdev-testing

Search and analyze your own session logs (older/parent conversations) using jq.