Discover modules > cue.dev/x/npmjs/jscpd
v0.1.0
#Schema: ¶
minLines?: int ¶

minimum size of code block in lines to check for duplication

maxLines?: int ¶

maximum size of source file in lines to check for duplication

maxSize?: matchN(>=1, [=~"^\\+?[0-9]+(\\.[0-9]+)? *[kKmMgGtTpP][bB]$", int]) ¶

maximum size of source file in bytes to check for duplication (e.g.,: 1kb, 1mb, 120kb)

minTokens?: int ¶

minimum size of code block in tokens to check for duplication

threshold?: number ¶

maximum allowed duplicate lines expressed as a percentage; exit with error and exit code 1 when threshold exceeded

formatsExts?: [string]: [...string] ¶

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

output?: string ¶

path to directory for non-console reports

path?: [...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

ignorePattern?: [...string] ¶

ignore code blocks matching these regular expressions

mode?: "mild" | "strict" | "weak" ¶

mode of detection quality; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#mode

ignore?: [...string] ¶

glob pattern for files that should be excluded from duplicate detection

format?: [...#format] ¶

list of formats for which to detect duplication (default: all); see https://github.com/kucherenko/jscpd/blob/master/supported_formats.md

store?: "leveldb" | "redis" ¶

store used to collect information about code (default: in-memory store); install @jscpd/leveldb-store and use leveldb for big repositories

reporters?: [..."xml" | "json" | "csv" | "markdown" | "consoleFull" | "html" | "console" | "silent" | "threshold" | "xcode"] ¶

a list of reporters to use to output information about duplication; see https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#reporters

blame?: bool ¶

get information about authors and dates of duplicated blocks from Git

silent?: bool ¶

do not write duplicate detection progress and result to console

verbose?: bool ¶

show full information during duplicate detection

absolute?: bool ¶

use absolute paths in reports

noSymlinks?: bool ¶

do not follow symlinks

skipLocal?: bool ¶

skip duplicates within folders; just detect cross-folder duplicates

ignoreCase?: bool ¶

ignore case of symbols in code (experimental)

gitignore?: bool ¶

ignore all files from .gitignore file

reportersOptions?: ¶
badge?: ¶
path?: string ¶

output path for duplication level badge (default: path.join(output, 'jscpd-badge.svg'))

label?: string ¶

badge subject text (URL-encoding needed for spaces or special characters)

labelColor?: #color ¶
status?: string ¶

badge value text (URL-encoding needed for spaces or special characters, default: duplication %)

color?: #color ¶
style?: "flat" | "classic" ¶

badge look: flat or classic

icon?: string ¶

URL for icon to display in front of badge subject text (e.g., data:image/svg+xml;base64,...)

iconWidth?: number ¶

SVG width of icon to display in front of badge subject text; set this if icon is not square

scale?: number ¶

size of badge relative to default of 1

exitCode?: int ¶

exit code to use when at least one duplicate code block is detected but threshold is not exceeded

#color: matchN(1, [#colorPreset, #colorHex]) ¶
#colorHex: =~"([0-9a-fA-F]{3}){1,2}" ¶
#colorPreset: "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "pink" | "grey" | "gray" | "cyan" | "black" ¶
#format:
click to see definition
"abap" | "actionscript" | "ada" | "apacheconf" | "apl" | "applescript" | "arduino" | "arff" | "asciidoc" | "asm6502" | "aspnet" | "autohotkey" | "autoit" | "bash" | "basic" | "batch" | "bison" | "brainfuck" | "bro" | "c" | "c-header" | "clike" | "clojure" | "coffeescript" | "comments" | "cpp" | "cpp-header" | "crystal" | "csharp" | "csp" | "css-extras" | "css" | "d" | "dart" | "diff" | "django" | "docker" | "eiffel" | "elixir" | "elm" | "erb" | "erlang" | "flow" | "fortran" | "fsharp" | "gedcom" | "gherkin" | "git" | "glsl" | "go" | "graphql" | "groovy" | "haml" | "handlebars" | "haskell" | "haxe" | "hpkp" | "hsts" | "http" | "ichigojam" | "icon" | "inform7" | "ini" | "io" | "j" | "java" | "javascript" | "jolie" | "json" | "jsx" | "julia" | "keymap" | "kotlin" | "latex" | "less" | "liquid" | "lisp" | "livescript" | "lolcode" | "lua" | "makefile" | "markdown" | "markup" | "matlab" | "mel" | "mizar" | "monkey" | "n4js" | "nasm" | "nginx" | "nim" | "nix" | "nsis" | "objectivec" | "ocaml" | "opencl" | "oz" | "parigp" | "pascal" | "perl" | "php" | "plsql" | "powershell" | "processing" | "prolog" | "properties" | "protobuf" | "pug" | "puppet" | "pure" | "python" | "q" | "qore" | "r" | "reason" | "renpy" | "rest" | "rip" | "roboconf" | "ruby" | "rust" | "sas" | "sass" | "scala" | "scheme" | "scss" | "smalltalk" | "smarty" | "soy" | "sql" | "stylus" | "swift" | "tap" | "tcl" | "textile" | "tsx" | "tt2" | "twig" | "typescript" | "vbnet" | "velocity" | "verilog" | "vhdl" | "vim" | "visual-basic" | "wasm" | "url" | "wiki" | "xeora" | "xojo" | "xquery" | "yaml"
¶

Source files

  • schema.cue