Skip to content

Commit e3ddcbd

Browse files
committed
Don't let JSCPD get overwhelmed
1 parent 085716b commit e3ddcbd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools.d/jscpd

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ set -euo pipefail
44
which -s jscpd || exit 1
55
npm ls -g | grep -q jscpd-sarif-reporter || exit 1
66

7+
MIN_LINES=15
8+
MIN_TOKENS=150
9+
SCAN_MODE=strict
710
# runtime params
811
source=$1
912
tmpdir=$(mktemp -d)
1013

1114
# run command and send output to stderr, sarif to file, send sarif to stdout
12-
jscpd --reporters sarif -o "${tmpdir}" "${source}" 1>&2
15+
jscpd -l "${MIN_LINES}" -k "${MIN_TOKENS}" -m ${SCAN_MODE} -i "*/packages/*" --reporters sarif -o "${tmpdir}" "${source}" 1>&2
1316
sed -E 's/(Clone detected in [a-z0-9]+),[^"]+/\1/g' "${tmpdir}/jscpd-sarif.json"
1417

1518
# clean up

0 commit comments

Comments
 (0)