chore: update jscpd settings to min 14 lines and ignore txt files

- Increase minimum clone detection from 5 to 14 lines
- Ignore .txt files (package lists are intentional documentation overlap)
- Results in 0% detected duplication
This commit is contained in:
Krzysztof kuhy Rudnicki 2025-12-11 18:46:05 +01:00
parent a0105ddc3f
commit 6a26422737

View File

@ -72,16 +72,16 @@ if [[ ! -x $JSCPD_BIN ]]; then
fi
# Run jscpd and capture output
# --min-lines 5: minimum 5 lines to consider a clone
# --min-lines 14: minimum 14 lines to consider a clone (ignores small boilerplate)
# --min-tokens 25: minimum 25 tokens to consider a clone
# --threshold 2: fail if more than 2% duplication
jscpd_output=$("$JSCPD_BIN" \
--pattern "**/*.sh" \
--min-lines 5 \
--min-lines 14 \
--min-tokens 25 \
--threshold 2 \
--reporters "console" \
--ignore "**/node_modules/**,**/.git/**,**/misc/testsAndMisc-bash/**" \
--ignore "**/node_modules/**,**/.git/**,**/misc/testsAndMisc-bash/**,**/*.txt" \
. 2>&1) || jscpd_exit=$?
if [[ ${jscpd_exit:-0} -ne 0 ]]; then