Search

PythonReactSEOPDF
GitHub Skill

jscpd

Detect and analyze duplicate code in JavaScript, TypeScript, and other languages. Use when identifying duplicate code blocks, analyzing code duplication metrics, improving maintainability, or supporting refactoring efforts.

knoopx☆ 2 Repository stars0 Repository forks

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

View source ↗Guides

Skill instructions

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

Examples

Read the usage examples in the source repository.

View source ↗

Source history

Indexed on
2026-01-20
Index updated
2026-01-26
Branch
main

Index and sync dates describe this directory. View the source repository for code history.

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!