Skip to content

fix: preserve jscpd reports above project threshold#654

Open
liorp wants to merge 1 commit into
peteromallet:mainfrom
liorp:fix/jscpd-threshold-report
Open

fix: preserve jscpd reports above project threshold#654
liorp wants to merge 1 commit into
peteromallet:mainfrom
liorp:fix/jscpd-threshold-report

Conversation

@liorp

@liorp liorp commented Jul 18, 2026

Copy link
Copy Markdown

Problem

The jscpd adapter inherits a repository's .jscpd.json threshold. When
duplication exceeds that threshold, jscpd writes a valid JSON report and exits

  1. Desloppify currently treats that as an execution failure and discards the
    report, so scans warn that duplication detection was skipped.

Minimal reproduction:

  1. Configure jscpd with "threshold": 0.
  2. Scan a project containing a duplicate block.
  3. Observe that jscpd writes jscpd-report.json but desloppify reports
    jscpd exited with errors and imports no clusters.

Fix

Run jscpd with --threshold 100. Desloppify consumes the report itself, so a
project-level CI threshold must not prevent the adapter from reading valid
results.

Verification

  • Added a regression test that failed before the threshold override.
  • 14 passed for the jscpd adapter tests.
  • 6823 passed, 17 skipped for the full test suite with full extras installed.
  • Verified against a real TypeScript monorepo: the warning disappeared and
    duplication clusters were imported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant