reactjs / gu.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
  • 3% duplication:
    • 5,962 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 191 duplicated lines
  • 15 duplicates
system3% (191 lines)
Duplication per Extension
js4% (191 lines)
Duplication per Component (primary)
src/components6% (100 lines)
src/templates6% (37 lines)
src/pages3% (20 lines)
static/js66% (12 lines)
src2% (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 15 longest duplicates.
See data for all 15 duplicates...
Size#FoldersFilesLinesCode
11 x 2 src/components/LayoutHeader
src/components/LayoutHeader
158:170 (4%)
183:195 (4%)
view
10 x 2 src/components/LayoutHeader
src/components/LayoutHeader
184:195 (4%)
214:225 (4%)
view
10 x 2 src/templates
src/templates
28:41 (41%)
31:44 (37%)
view
10 x 2 src/components/LayoutHeader
src/components/LayoutHeader
159:170 (4%)
214:225 (4%)
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/templates
src/templates
28:41 (41%)
33:46 (37%)
view
10 x 2 src/pages
src/pages
162:171 (2%)
305:314 (2%)
view
9 x 2 src/components/LayoutFooter
src/components/LayoutHeader
34:42 (7%)
33:41 (4%)
view
7 x 2 src/components/LayoutHeader
src/components/StickyResponsiveSidebar
37:43 (3%)
163:169 (4%)
view
7 x 2 src/components/ButtonLink
src/templates
54:61 (11%)
18:26 (14%)
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/CodeEditor
src/components/CodeEditor
164:169 (2%)
200:205 (2%)
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