feat: Add code duplication detection with jscpd#1289
Open
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1286
Add jscpd (JavaScript Copy Paste Detector) to detect code duplications in the codebase: - Add .jscpd.json configuration file with sensible defaults: - 11% threshold (current baseline) - JavaScript format focus - Excludes experiments, data, and case study directories - Generates HTML reports in ./reports/jscpd - Add jscpd as devDependency (^4.0.5) - Add npm script: npm run check:duplication - Integrate into CI/CD workflow (lint job in release.yml) - Add reports/ to .gitignore for generated HTML reports This addresses #1286 request for code duplication detection from js-ai-driven-development-pipeline-template best practices. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 37251e8.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements code duplication detection using jscpd (JavaScript Copy Paste Detector) as requested in #1286 (specifically item 3: Code Duplication Detection).
Per @konard's comment, only the code duplication detection feature is needed for now, not the multi-runtime testing support.
Changes
1. Add
.jscpd.jsonconfiguration file./reports/jscpd/2. Add jscpd dependency
jscpd@^4.0.5as devDependency3. Add npm script
npm run check:duplication- runs jscpd on the codebase4. CI/CD Integration
lintjob ofrelease.yml5. Add reports/ to .gitignore
Current Status
The codebase currently has 10.65% code duplication (4,445 duplicated lines out of 41,754 total). The threshold is set to 11% to allow the check to pass while preventing significant new duplications.
Reference
Based on best practices from js-ai-driven-development-pipeline-template.
Test Plan
npm run check:duplicationpasses (10.65% < 11% threshold)npm run lintpassesnpm run format:checkpassesnpm testpasses (all tests)Fixes
Fixes #1286 (Code Duplication Detection item only)
🤖 Generated with Claude Code