reactjs / ca.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
  • 2% duplication:
    • 6,284 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 178 duplicated lines
  • 14 duplicates
system2% (178 lines)
Duplication per Extension
js3% (178 lines)
Duplication per Component (primary)
src/components5% (87 lines)
src/templates6% (37 lines)
src/pages3% (20 lines)
static/js66% (12 lines)
src1% (12 lines)
src/utils4% (10 lines)
plugins/gatsby-source-react-error-codes0% (0 lines)
plugins/gatsby-remark-header-custom-ids0% (0 lines)
plugins/gatsby-transformer-home-example-code0% (0 lines)
plugins/gatsby-remark-use-jsx0% (0 lines)
plugins/gatsby-transformer-versions-yaml0% (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)
static/html0% (0 lines)
scripts0% (0 lines)
src/css0% (0 lines)
Longest Duplicates
The list of 14 longest duplicates.
See data for all 14 duplicates...
Size#FoldersFilesLinesCode
11 x 2 src/components/LayoutHeader
src/components/LayoutHeader
174:186 (4%)
199:211 (4%)
view
10 x 2 src/templates
src/templates
28:41 (41%)
31:44 (37%)
view
10 x 2 src/components/LayoutFooter
src/utils
33:42 (34%)
44:53 (9%)
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 src/templates
src/templates
28:41 (41%)
33:46 (37%)
view
10 x 2 src/components/LayoutHeader
src/components/LayoutHeader
175:186 (4%)
230:241 (4%)
view
10 x 2 src/components/LayoutHeader
src/components/LayoutHeader
200:211 (4%)
230:241 (4%)
view
7 x 2 src/components/LayoutHeader
src/components/StickyResponsiveSidebar
53:59 (2%)
159:165 (4%)
view
7 x 2 src/components/ButtonLink
src/templates
54:61 (11%)
18:26 (14%)
view
6 x 2 src/components/CodeEditor
src/components/CodeEditor
162:167 (2%)
198:203 (2%)
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 src/components/LayoutFooter
src/components/LayoutFooter
23:28 (20%)
22:27 (35%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
10 x 3 src/templates
src/templates
src/templates
33:44 
31:42 
28:39 
view
8 x 2 static/js
static/js
7:16 
7:16 
view
12 x 3 src/templates
src/templates
src/templates
32:45 
30:43 
27:40 
view