jscpd is a tool for detect copy/paste "design pattern" in programming source code.
Patterns to include in execution and reports.
Patterns to exclude from execution and reports.
Amount of CPU. The default machine has
0.25 CPU with
960 MiB RAM.
Below is the list of options that are supported:
-l, --min-lines NUMBER min size of duplication in code lines -t, --min-tokens NUMBERmim size of duplication in code tokens -c, --config FILE path to config file -f, --files STRING glob pattern for find code -e, --exclude STRING directory to ignore --skip-comments skip comments in code -b, --blame BOOLEAN blame authors of duplications (get information about authors from git) --verbose show full info about copies -p, --path PATH path to code
Note: The incremental analysis cannot be supported for jscpd. This is because unchanged files also need to be compared with changed ones.
With default options:
inspecode: jscpd: default
With custom machine:
inspecode: jscpd: machine: cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
With custom options:
inspecode: jscpd: options: --path: my_project/
With a configuration file:
inspecode: jscpd: config-file: test/.cpd.yaml
The above configuration is equivalent to:
inspecode: jscpd: options: --config: test/.cpd.yaml
If no configuration files are specified via
options field, Inspecode first lets jscpd to find configuration files in your repository.
In addition, if jscpd cannot find any configuration files, Inspecode also walks the file tree in lexical order in your repository to find a configuration file named
.cpd.yml and specifies the file first found to jscpd automatically via
Note: Inspecode ignores specific configuration files while searching. See Configuration > Tool Configuration > Field:
If the configuration file detected by Inspecode is not the one you want to use or you do not want to use any configuration files, you can disable Inspecode from detecting configuration files by explicitly setting an empty string to
config-file field like below:
inspecode: jscpd: config-file: ""