Getting Started

Introduction

Welcome to jscpd documentation.

Welcome to jscpd, a powerful copy/paste detector for programming source code that supports 150+ languages and formats.

What is jscpd?

jscpd is a tool that helps you find duplicated blocks in programming source code. Copy/paste is a common source of technical debt in software projects, and jscpd helps you identify and eliminate these duplications.

The tool implements the Rabin-Karp algorithm for efficient searching of duplications across large codebases.

Key Features

150+ Languages

Supports JavaScript, TypeScript, Python, Java, C++, Go, Rust, and many more programming languages and document formats.

Fast Detection

Uses the efficient Rabin-Karp algorithm for quick duplicate detection even in large codebases.

CLI & API

Use via command line or integrate programmatically into your Node.js applications.

Multiple Reporters

Generate reports in HTML, JSON, XML, Markdown, and more for easy integration with CI/CD.

Packages

jscpd is modular and consists of several packages:

PackageDescription
jscpdMain package with CLI and detection API
jscpd-serverStandalone server application
@jscpd/coreCore detection algorithm
@jscpd/finderFile duplication detector
@jscpd/tokenizerSource code tokenizer
@jscpd/html-reporterHTML report generator
@jscpd/badge-reporterBadge generator for README files
@jscpd/leveldb-storeLevelDB store for big repositories

Quick Example

# Install globally
npm install -g jscpd

# Run on your source code
jscpd /path/to/source

# Or use npx without installing
npx jscpd /path/to/source

Ready to get started? Head to the Installation guide.