reactjs / ur.reactjs.org
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • 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...
Duplication Overall
  • 4% duplication:
    • 11,639 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 521 duplicated lines
  • 43 duplicates
system4% (521 lines)
Duplication per Extension
js5% (302 lines)
tsx4% (191 lines)
html71% (28 lines)
Duplication per Component (primary)
beta/src4% (191 lines)
src/components4% (75 lines)
beta/scripts14% (58 lines)
src/templates6% (37 lines)
beta/public96% (32 lines)
scripts47% (24 lines)
src/pages3% (20 lines)
static/js100% (18 lines)
beta/plugins11% (14 lines)
plugins/gatsby-remark-header-custom-ids10% (14 lines)
static/html93% (14 lines)
plugins/gatsby-transformer-versions-yaml20% (12 lines)
src1% (12 lines)
beta0% (0 lines)
plugins/gatsby-source-react-error-codes0% (0 lines)
plugins/gatsby-transformer-home-example-code0% (0 lines)
plugins/gatsby-remark-use-jsx0% (0 lines)
plugins/gatsby-transformer-authors-yaml0% (0 lines)
content/tutorial0% (0 lines)
content0% (0 lines)
content/community0% (0 lines)
ROOT0% (0 lines)
gatsby0% (0 lines)
src/css0% (0 lines)
src/utils0% (0 lines)

Duplication Between Components (50+ lines)

G beta/scripts beta/scripts scripts scripts beta/scripts--scripts 55

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 43 longest duplicates.
See data for all 43 duplicates...
Size#FoldersFilesLinesCode
16 x 2 beta/src/pages/blog
beta/src/pages/blog
39:54 (38%)
52:67 (20%)
view
12 x 2 beta/src/components/Icon
beta/src/components/Icon
29:40 (37%)
31:42 (36%)
view
10 x 2 src/templates
src/templates
28:41 (41%)
31:44 (37%)
view
10 x 2 src/templates
src/templates
33:46 (37%)
31:44 (37%)
view
10 x 2 src/pages
src/pages
162:171 (2%)
305:314 (2%)
view
10 x 2 beta/scripts/headingIDHelpers
beta/scripts/headingIDHelpers
65:76 (13%)
32:44 (27%)
view
10 x 2 beta/scripts/headingIDHelpers
scripts
69:81 (13%)
52:64 (19%)
view
10 x 2 src/components/LayoutHeader
src/components/LayoutHeader
177:188 (4%)
211:222 (4%)
view
10 x 2 src/templates
src/templates
28:41 (41%)
33:46 (37%)
view
9 x 2 beta/src/components/Icon
beta/src/components/Icon
9:17 (69%)
9:17 (69%)
view
9 x 2 beta/public/js
static/js
7:16 (100%)
7:16 (100%)
view
9 x 2 beta/public/js
static/js
7:16 (100%)
7:16 (100%)
view
9 x 2 src/components/LayoutHeader
src/components/LayoutHeader
214:223 (3%)
242:251 (3%)
view
8 x 2 beta/plugins
plugins/gatsby-remark-header-custom-ids
12:23 (22%)
11:23 (17%)
view
8 x 2 beta/src/components/MDX
beta/src/components/MDX
33:40 (14%)
28:35 (13%)
view
8 x 2 beta/scripts/headingIDHelpers
scripts
13:23 (50%)
12:22 (15%)
view
8 x 2 src/components/LayoutHeader
src/components/LayoutHeader
180:188 (3%)
242:250 (3%)
view
7 x 2 beta/scripts/headingIDHelpers
scripts
36:44 (19%)
52:59 (13%)
view
7 x 2 beta/src/components/Icon
beta/src/components/Icon
9:15 (43%)
9:15 (35%)
view
7 x 2 src/components/LayoutHeader
src/components/StickyResponsiveSidebar
54:60 (2%)
159:165 (4%)
view
7 x 2 beta/src/components/Icon
beta/src/components/Icon
13:19 (38%)
9:15 (53%)
view
7 x 2 beta/src/components/Icon
beta/src/components/Icon
14:20 (41%)
14:20 (33%)
view
7 x 2 beta/public/html
static/html
1:7 (46%)
1:7 (46%)
view
7 x 2 beta/src/components/MDX/Challenges
beta/src/components/MDX/Challenges
194:200 (3%)
230:236 (3%)
view
7 x 2 beta/public/html
static/html
12:19 (46%)
12:19 (46%)
view
7 x 2 beta/src/components/MDX/Challenges
beta/src/components/MDX/Challenges
161:167 (3%)
171:177 (3%)
view
7 x 2 src/components/ButtonLink
src/templates
56:63 (11%)
18:26 (14%)
view
7 x 2 beta/src/components/Icon
beta/src/components/Icon
13:19 (38%)
9:15 (53%)
view
7 x 2 beta/src/pages/blog
beta/src/pages/blog
20:26 (16%)
29:35 (9%)
view
6 x 2 src/components/CodeEditor
src/components/CodeEditor
165:170 (2%)
201:206 (2%)
view
6 x 2 beta/public/js
static/js
7:12 (66%)
7:12 (66%)
view
6 x 2 beta/scripts/headingIDHelpers
beta/scripts/headingIDHelpers
96:104 (8%)
55:63 (16%)
view
6 x 2 beta/scripts
plugins/gatsby-transformer-versions-yaml
16:30 (12%)
15:29 (15%)
view
6 x 2 beta/public/js
beta/public/js
7:12 (66%)
7:12 (66%)
view
6 x 2 beta/plugins
plugins/gatsby-remark-header-custom-ids
55:61 (16%)
42:48 (13%)
view
6 x 2 beta/src/components/Icon
beta/src/components/Icon
9:14 (33%)
9:14 (35%)
view
6 x 2 beta/scripts/headingIDHelpers
scripts
100:107 (8%)
72:79 (11%)
view
6 x 2 src/components/LayoutFooter
src/components/LayoutFooter
23:28 (20%)
22:27 (35%)
view
6 x 2 static/js
static/js
7:12 (66%)
7:12 (66%)
view
6 x 2 src
src
176:181 (1%)
183:188 (1%)
view
6 x 2 beta/src/components
beta/src/components
88:93 (6%)
95:100 (6%)
view
6 x 2 beta/public/js
static/js
7:12 (66%)
7:12 (66%)
view
6 x 2 beta/scripts
plugins/gatsby-transformer-versions-yaml
33:39 (12%)
32:38 (15%)
view
Duplicated Units
The list of top 5 duplicated units.
See data for all 5 unit duplicates...
Size#FoldersFilesLinesCode
12 x 2 beta/src/components/Icon
beta/src/components/Icon
8:25 
8:22 
view
13 x 5 beta/src/components/Icon
beta/src/components/Icon
beta/src/components/Icon
beta/src/components/Icon
beta/src/components/Icon
8:23 
8:23 
8:23 
8:23 
8:23 
view
10 x 3 src/templates
src/templates
src/templates
33:44 
31:42 
28:39 
view
8 x 4 beta/public/js
beta/public/js
static/js
static/js
7:16 
7:16 
7:16 
7:16 
view
12 x 3 src/templates
src/templates
src/templates
32:45 
30:43 
27:40 
view