reactjs / pt-PT.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,916 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% (99 lines)
src/templates6% (36 lines)
src/pages5% (34 lines)
static/js66% (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)
src0% (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
157:169 (5%)
182:194 (5%)
view
10 x 2 src/components/LayoutHeader
src/components/LayoutHeader
183:194 (4%)
213:224 (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
158:169 (4%)
213:224 (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/pages
src/pages
154:163 (2%)
297:306 (2%)
view
10 x 2 src/templates
src/templates
28:41 (41%)
33:46 (37%)
view
9 x 2 src/components/LayoutFooter
src/components/LayoutHeader
34:42 (7%)
32:40 (4%)
view
7 x 2 src/components/LayoutHeader
src/components/StickyResponsiveSidebar
36:42 (3%)
159:165 (4%)
view
7 x 2 src/pages
src/pages
34:40 (25%)
78:84 (6%)
view
6 x 2 static/js
static/js
3:8 (66%)
3:8 (66%)
view
6 x 2 src/components/ButtonLink
src/templates
56:61 (9%)
7:12 (14%)
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
3:12 
3:12 
view
12 x 3 src/templates
src/templates
src/templates
32:45 
30:43 
27:40 
view