jscpd Configuration
Copy/paste detector for programming source code
.jscpd.json
Validate
Check your file against this schema
Opens the validator with this schema already loaded. Paste your
.jscpd.json and it validates in your browser — nothing is uploaded.
Reference
Fields
Generated directly from the schema, following local
$refs, to two levels of nesting.
| Field | Type | Description |
|---|---|---|
minLines | integer | minimum size of code block in lines to check for duplication default: 5 |
maxLines | integer | maximum size of source file in lines to check for duplication default: 1000 |
maxSize | anyOf | maximum size of source file in bytes to check for duplication (e.g., 102400, 1kb, 1m, 120kb) default: "100kb" |
minTokens | integer | minimum size of code block in tokens to check for duplication default: 50 |
threshold | number | maximum allowed duplicate lines expressed as a percentage; exit with error and exit code 1 when threshold exceeded |
formatsExts | anyOf | — |
output | string | path to directory for non-console reports default: "./report" |
path | array<string> | paths that should be included in duplicate detection (default: [process.cwd()]) |
pattern | string | glob pattern for files that should be included in duplicate detection (e.g., **/*.txt); only used to filter directories configured via path option default: "**/*" |
ignorePattern | array<string> | ignore code blocks matching these regular expressions default: [] |
mode | enum | mode of detection quality; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#mode default: "mild"one of: "mild", "strict", "weak" |
ignore | array<string> | glob pattern for files that should be excluded from duplicate detection default: [] |
format | oneOf | format or list of formats for which to detect duplication (default: all); see https://github.com/kucherenko/jscpd/blob/master/FORMATS.md |
store | anyOf | store used to collect information about code. v4 supports external stores such as leveldb and redis; v5 reports this config field as migrated to the CLI --store flag. |
reporters | array | a list of reporters to use to output information about duplication; built-ins include console, consoleFull/console-full, json, xml, csv, html, markdown, badge, sarif, ai, xcode, threshold, and silent; third-party reporters are also default: ["console"] |
blame | boolean | get information about authors and dates of duplicated blocks from Git default: false |
silent | boolean | do not write duplicate detection progress and result to console default: false |
verbose | boolean | show full information during duplicate detection default: false |
absolute | boolean | use absolute paths in reports default: false |
noSymlinks | boolean | do not follow symlinks default: false |
skipLocal | boolean | skip duplicates within folders; just detect cross-folder duplicates default: false |
ignoreCase | boolean | ignore case of symbols in code (experimental) default: false |
gitignore | boolean | respect .gitignore files. Enabled by default in current jscpd; set false to opt out in v4 configs. default: true |
reportersOptions | object | — default: {} |
reportersOptions.badge | object | — |
reportersOptions.badge.path | string | output path for duplication level badge (default: path.join(output, 'jscpd-badge.svg')) |
reportersOptions.badge.label | string | badge subject text (URL-encoding needed for spaces or special characters) default: "Copy/Paste" |
reportersOptions.badge.labelColor | oneOf | — |
reportersOptions.badge.status | string | badge value text (URL-encoding needed for spaces or special characters, default: duplication %) |
reportersOptions.badge.color | oneOf | — |
reportersOptions.badge.style | enum | badge look: flat or classic default: "classic"one of: "flat", "classic" |
reportersOptions.badge.icon | string | URL for icon to display in front of badge subject text (e.g., data:image/svg+xml;base64,...) |
reportersOptions.badge.iconWidth | number | SVG width of icon to display in front of badge subject text; set this if icon is not square default: 13 |
reportersOptions.badge.scale | number | size of badge relative to default of 1 default: 1 |
exitCode | integer | exit code to use when at least one duplicate code block is detected but threshold is not exceeded default: 0 |
formatsNames | anyOf | — |
formats | oneOf | v5 alias for format; format or list of formats for which to detect duplication |
storePath | string | directory used by the v4 store for cache files, useful for isolating parallel LevelDB runs. v5 reports this config field as migrated to the CLI --store-path flag. |
noGitignore | boolean | v5 config field matching --no-gitignore; do not respect .gitignore files default: false |
followSymlinks | boolean | v5 config field matching --follow-symlinks; follow symbolic links default: false |
noSymLinks | boolean | compatibility alias for noSymlinks with a capital L; prefer noSymlinks or followSymlinks default: false |
noColors | boolean | disable ANSI color output default: false |
noTips | boolean | suppress tips and promotional messages after detection default: false |
debug | boolean | show debug information and do not run detection in v4; silently ignored by v5 config compatibility handling default: false |
min-tokens | integer | v5 kebab-case alias for minTokens. minimum size of code block in tokens to check for duplication default: 50 |
min-lines | integer | v5 kebab-case alias for minLines. minimum size of code block in lines to check for duplication default: 5 |
max-lines | integer | v5 kebab-case alias for maxLines. maximum size of source file in lines to check for duplication default: 1000 |
max-size | anyOf | v5 kebab-case alias for maxSize. maximum size of source file in bytes to check for duplication (e.g., 102400, 1kb, 1m, 120kb) default: "100kb" |
ignore-pattern | array<string> | v5 kebab-case alias for ignorePattern. ignore code blocks matching these regular expressions default: [] |
ignore-case | boolean | v5 kebab-case alias for ignoreCase. ignore case of symbols in code (experimental) default: false |
no-gitignore | boolean | v5 kebab-case alias for noGitignore. v5 config field matching --no-gitignore; do not respect .gitignore files default: false |
follow-symlinks | boolean | v5 kebab-case alias for followSymlinks. v5 config field matching --follow-symlinks; follow symbolic links default: false |
skip-local | boolean | v5 kebab-case alias for skipLocal. skip duplicates within folders; just detect cross-folder duplicates default: false |
exit-code | integer | v5 kebab-case alias for exitCode. exit code to use when at least one duplicate code block is detected but threshold is not exceeded default: 0 |
no-colors | boolean | v5 kebab-case alias for noColors. disable ANSI color output default: false |
no-tips | boolean | v5 kebab-case alias for noTips. suppress tips and promotional messages after detection default: false |
formats-exts | anyOf | — |
formats-names | anyOf | — |
Audit
What we found in this schema
- Declared draft: draft-07
- Validates cleanly against its own meta-schema.
- Has 5 place(s) where keywords sit beside
$ref. Under draft-07 those keywords are silently ignored by every conforming validator — first at#/properties/formatsExts. - 58 properties, 97% carrying a description, max nesting depth 9.
Standards
Specification sections for the keywords in this schema
| Keyword | Document | Section |
|---|---|---|
$id | JSON Schema Core, draft 2020-12 | §8.2.1 — The "$id" Keyword |
$ref | JSON Schema Core, draft 2020-12 | §8.2.3.1 — Direct References with "$ref" |
$schema | JSON Schema Core, draft 2020-12 | §8.1.1 — "$schema" |
additionalProperties | JSON Schema Core, draft 2020-12 | §10.3.2.3 — "additionalProperties" |
anyOf | JSON Schema Core, draft 2020-12 | §10.2.1.2 — "anyOf" |
default | JSON Schema Validation, draft 2020-12 | §9.2 — "default" |
description | JSON Schema Validation, draft 2020-12 | §9.1 — "title" and "description" |
enum | JSON Schema Validation, draft 2020-12 | §6.1.2 — "enum" |
format | JSON Schema Validation, draft 2020-12 | §7 — Vocabularies for Semantic Content With "format" |
items | JSON Schema Core, draft 2020-12 | §10.3.1.2 — "items" |
minLength | JSON Schema Validation, draft 2020-12 | §6.3.2 — "minLength" |
oneOf | JSON Schema Core, draft 2020-12 | §10.2.1.3 — "oneOf" |
pattern | JSON Schema Validation, draft 2020-12 | §6.3.3 — "pattern" |
properties | JSON Schema Core, draft 2020-12 | §10.3.2.1 — "properties" |
type | JSON Schema Validation, draft 2020-12 | §6.1.1 — "type" |
Documents
- JSON Schema Core, draft 2020-12 — JSON Schema: A Media Type for Describing JSON Documents, A. Wright, H. Andrews, B. Hutton, G. Dennis, Eds., 2022. draft-bhutton-json-schema-01. An expired Internet-Draft with no formal standing in the IETF standards process; it is nonetheless the specification of record for JSON Schema 2020-12, published by json-schema.org.
- JSON Schema Validation, draft 2020-12 — JSON Schema Validation: A Vocabulary for Structural Validation of JSON, A. Wright, H. Andrews, B. Hutton, Eds., 2022.
- RFC 8259 (STD 90) — The JavaScript Object Notation (JSON) Data Interchange Format, T. Bray, Ed., 2017. The format a schema describes.
- RFC 6901 — JavaScript Object Notation (JSON) Pointer. Defines the pointer syntax used by $ref fragments and the ~0 / ~1 escapes.
Source
Attribution
This schema comes from SchemaStore, distributed under the Apache License 2.0. Copyright 2015–present Mads Kristensen and contributors. View the original file. The field table and audit on this page are generated by JSONTools.tools; the schema itself is unmodified.