Commit 7dabb7c
ci(lint): run jscpd in CI, compare to static threshold. (#5833)
## Problem
New contributors often copy-paste logic and test cases, which creates a
maintenance cost for little gain.
Examples
-
#3837 (comment)
-
#3805 (comment)
We call these repeated segments of code "clones".
## Solution
implement a static threshold.
Run `jscpd` in CI and compare the % duplicated to a fixed threshold of
1.34%, which is the current duplication rate in the repo.
The main issue with this solution is that it fails to provide easy
debugging options when new duplicates are found. Currently exploring
adding this functionality in a follow-up.
#### Notes
- this is a summary of the problem/solution. For full information, see
full doc (VSCode: Detecting and Reducing Duplicate Code) describing
changes.
---
<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->
License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
---------
Co-authored-by: Justin M. Keyes <[email protected]>1 parent 800f536 commit 7dabb7c
2 files changed
+25
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
58 | 76 | | |
59 | 77 | | |
60 | 78 | | |
| |||
0 commit comments