guardian/2026-maplibre-knowledge-session
Duplication Places in code with 6 or more lines that are exactly the same. |
Duplication Overall
- 22% duplication:
- 5,896 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
- 1,315 duplicated lines
- 91 duplicates
Duplication per Extension
Duplication per Component (primary)
Longest Duplicates
The list of 50 longest duplicates.
| Size | # | Folders | Files | Lines | Code |
|---|---|---|---|---|---|
| 187 | x 2 | harnessharness | 8:196 (94%)4:192 (94%) | view | |
| 108 | x 2 | harness/templatesharness/templates | 91:198 (2%)341:448 (2%) | view | |
| 28 | x 2 | src/lib/stylessrc/lib/styles | 22:53 (53%)1:32 (35%) | view | |
| 19 | x 2 | harness/templatesharness/templates | 1376:1394 (<1%)1873:1891 (<1%) | view | |
| 17 | x 2 | harness/templatesharness/templates | 2108:2124 (<1%)2897:2913 (<1%) | view | |
| 16 | x 2 | harness/templatesharness/templates | 2109:2124 (<1%)2868:2883 (<1%) | view | |
| 16 | x 2 | harness/templatesharness/templates | 2868:2883 (<1%)2898:2913 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 562:573 (<1%)575:586 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 588:599 (<1%)601:612 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 614:625 (<1%)627:638 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 640:651 (<1%)653:664 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 666:677 (<1%)679:690 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 692:703 (<1%)705:716 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 718:729 (<1%)731:742 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 744:755 (<1%)757:768 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 770:781 (<1%)783:794 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 796:807 (<1%)809:820 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 822:833 (<1%)835:846 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 848:859 (<1%)861:872 (<1%) | view | |
| 12 | x 2 | harness/templatesharness/templates | 874:885 (<1%)887:898 (<1%) | view | |
| 11 | x 2 | harness/templatesharness/templates | 900:910 (<1%)913:923 (<1%) | view | |
| 9 | x 2 | harness/templatesharness/templates | 2231:2239 (<1%)2655:2663 (<1%) | view | |
| 9 | x 2 | harness/templatesharness/templates | 2941:2949 (<1%)2955:2963 (<1%) | view | |
| 8 | x 2 | harness/templatesharness/templates | 2231:2238 (<1%)3168:3175 (<1%) | view | |
| 8 | x 2 | harness/templatesharness/templates | 2431:2438 (<1%)2562:2569 (<1%) | view | |
| 8 | x 2 | harness/templatesharness/templates | 2655:2662 (<1%)3168:3175 (<1%) | view | |
| 8 | x 2 | harness/templatesharness/templates | 2686:2693 (<1%)2981:2988 (<1%) | view | |
| 8 | x 2 | harness/templatesharness/templates | 3482:3489 (<1%)3529:3536 (<1%) | view | |
| 8 | x 2 | harness/templatesharness/templates | 3651:3658 (<1%)3660:3667 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 1405:1411 (<1%)1902:1908 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2109:2115 (<1%)2126:2132 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2109:2115 (<1%)2593:2599 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2126:2132 (<1%)2593:2599 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2126:2132 (<1%)2868:2874 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2126:2132 (<1%)2898:2904 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2333:2339 (<1%)2716:2722 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2333:2339 (<1%)2915:2921 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2593:2599 (<1%)2868:2874 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2593:2599 (<1%)2898:2904 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 2716:2722 (<1%)2915:2921 (<1%) | view | |
| 7 | x 2 | harness/templatesharness/templates | 3278:3284 (<1%)3311:3317 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 570:575 (<1%)622:627 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 570:575 (<1%)674:679 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 583:588 (<1%)635:640 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 583:588 (<1%)687:692 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 596:601 (<1%)648:653 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 596:601 (<1%)700:705 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 609:614 (<1%)661:666 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 622:627 (<1%)674:679 (<1%) | view | |
| 6 | x 2 | harness/templatesharness/templates | 635:640 (<1%)687:692 (<1%) | view |
Most Frequent Duplicates
The list of 23 most frequently found duplicates.
| Size | # | Folders | Files | Lines | Code |
|---|---|---|---|---|---|
| 6 | x 6 | harness/templatesharness/templatesharness/templatesharness/templatesharness/templatesharness/templates | 672:677 (<1%)685:690 (<1%)776:781 (<1%)789:794 (<1%)880:885 (<1%)893:898 (<1%) | view | |
| 6 | x 5 | harness/templatesharness/templatesharness/templatesharness/templatesharness/templates | 2110:2115 (<1%)2127:2132 (<1%)2594:2599 (<1%)2869:2874 (<1%)2899:2904 (<1%) | view | |
| 6 | x 5 | harness/templatesharness/templatesharness/templatesharness/templatesharness/templates | 2109:2114 (<1%)2126:2131 (<1%)2593:2598 (<1%)2868:2873 (<1%)2898:2903 (<1%) | view | |
| 6 | x 5 | harness/templatesharness/templatesharness/templatesharness/templatesharness/templates | 698:703 (<1%)711:716 (<1%)802:807 (<1%)815:820 (<1%)906:911 (<1%) | view | |
| 6 | x 4 | harness/templatesharness/templatesharness/templatesharness/templates | 724:729 (<1%)737:742 (<1%)828:833 (<1%)841:846 (<1%) | view | |
| 6 | x 4 | harness/templatesharness/templatesharness/templatesharness/templates | 750:755 (<1%)763:768 (<1%)854:859 (<1%)867:872 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 570:575 (<1%)622:627 (<1%)674:679 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2113:2118 (<1%)2872:2877 (<1%)2902:2907 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 583:588 (<1%)635:640 (<1%)687:692 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2115:2120 (<1%)2874:2879 (<1%)2904:2909 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2334:2339 (<1%)2717:2722 (<1%)2916:2921 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2118:2123 (<1%)2877:2882 (<1%)2907:2912 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2232:2237 (<1%)2656:2661 (<1%)3169:3174 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2333:2338 (<1%)2716:2721 (<1%)2915:2920 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2112:2117 (<1%)2871:2876 (<1%)2901:2906 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2117:2122 (<1%)2876:2881 (<1%)2906:2911 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 596:601 (<1%)648:653 (<1%)700:705 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2119:2124 (<1%)2878:2883 (<1%)2908:2913 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2231:2236 (<1%)2655:2660 (<1%)3168:3173 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2233:2238 (<1%)2657:2662 (<1%)3170:3175 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2116:2121 (<1%)2875:2880 (<1%)2905:2910 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2114:2119 (<1%)2873:2878 (<1%)2903:2908 (<1%) | view | |
| 6 | x 3 | harness/templatesharness/templatesharness/templates | 2111:2116 (<1%)2870:2875 (<1%)2900:2905 (<1%) | view |
About This Analysis
- For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
- Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
- You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
- To learn more about duplications and techniques for eliminating duplication, Sokrates recommends the following resources:
- Avoid Repetition, MartinFlower.com (IEEE Software article)
- Refactoring duplicated code, sourcemaking.com
- Beck Design Rules, MartinFowler.com
- DRY (Don't Repeat Yourself) Principle, Wikipedia
- The Cut-and-Paste Programming Software Development Anti-Pattern, sourcemaking.com
- Code Smells / Duplicated Code, Jeff Atwood, codinghorror.com:
- "Duplicated code is the bane of software development. Stamp out duplication whenever possible. You should always be on the lookout for more subtle cases of near-duplication, too. Don't Repeat Yourself!"
- Reducing Coupling, MartinFlower.com (IEEE Software article):
- "There are several ways to describe coupling, but it boils down to this: If changing one module in a program requires changing another module, then coupling exists. ... Duplication always implies coupling, because changing one piece of duplicate code implies changing the other."