jscpd Configuration
Copy/paste detector for programming source code
| Type | object |
|---|---|
| File match |
.jscpd.json
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/jscpd-configuration/latest.json |
| Source | https://www.schemastore.org/jscpd.json |
Validate with Lintel
npx @lintel/lintel check
Properties
minimum size of code block in lines to check for duplication
maximum size of source file in lines to check for duplication
maximum size of source file in bytes to check for duplication (e.g.,: 1kb, 1mb, 120kb)
minimum size of code block in tokens to check for duplication
maximum allowed duplicate lines expressed as a percentage; exit with error and exit code 1 when threshold exceeded
custom mapping from formats to file extensions (default: https://github.com/kucherenko/jscpd/blob/master/packages/tokenizer/src/formats.ts); see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md
{}
path to directory for non-console reports
paths that should be included in duplicate detection (default: [process.cwd()])
glob pattern for files that should be included in duplicate detection (e.g., **/*.txt); only used to filter directories configured via path option
ignore code blocks matching these regular expressions
[]
mode of detection quality; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#mode
glob pattern for files that should be excluded from duplicate detection
[]
list of formats for which to detect duplication (default: all); see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md
store used to collect information about code (default: in-memory store); install @jscpd/leveldb-store and use leveldb for big repositories
a list of reporters to use to output information about duplication; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#reporters
[
"console"
]
get information about authors and dates of duplicated blocks from Git
do not write duplicate detection progress and result to console
show full information during duplicate detection
use absolute paths in reports
do not follow symlinks
skip duplicates within folders; just detect cross-folder duplicates
ignore case of symbols in code (experimental)
ignore all files from .gitignore file
{}
1 nested properties
9 nested properties
output path for duplication level badge (default: path.join(output, 'jscpd-badge.svg'))
badge subject text (URL-encoding needed for spaces or special characters)
badge value text (URL-encoding needed for spaces or special characters, default: duplication %)
badge look: flat or classic
URL for icon to display in front of badge subject text (e.g., data:image/svg+xml;base64,...)
SVG width of icon to display in front of badge subject text; set this if icon is not square
size of badge relative to default of 1
exit code to use when at least one duplicate code block is detected but threshold is not exceeded