facebookincubator / electron
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
  • 6% duplication:
    • 113,071 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 7,138 duplicated lines
  • 1,281 duplicates
system6% (7,138 lines)
Duplication per Extension
ts11% (3,666 lines)
cc2% (1,170 lines)
js9% (938 lines)
h3% (547 lines)
html14% (256 lines)
mm3% (231 lines)
gni8% (170 lines)
xml60% (68 lines)
py2% (50 lines)
gn1% (30 lines)
yml2% (12 lines)
Duplication per Component (primary)
spec-main15% (3,572 lines)
shell/browser3% (1,568 lines)
spec16% (684 lines)
spec-main/fixtures14% (254 lines)
spec/fixtures10% (188 lines)
ROOT5% (175 lines)
shell/renderer5% (170 lines)
shell/common1% (170 lines)
script/codesign50% (68 lines)
script/release2% (56 lines)
build7% (51 lines)
lib/browser1% (44 lines)
lib/asar7% (44 lines)
shell/app3% (40 lines)
script1% (36 lines)
spec/ts-smoke1% (12 lines)
spec/static2% (6 lines)
buildflags0% (0 lines)
shell/utility0% (0 lines)
default_app0% (0 lines)
spec/configs0% (0 lines)
script/lib0% (0 lines)
script/zip_manifests0% (0 lines)
lib/sandboxed_renderer0% (0 lines)
lib/renderer0% (0 lines)
lib/common0% (0 lines)
lib/isolated_renderer0% (0 lines)
lib/worker0% (0 lines)
build/config0% (0 lines)
build/mac0% (0 lines)
build/args0% (0 lines)
build/fuses0% (0 lines)
chromium_src0% (0 lines)
npm0% (0 lines)

Duplication Between Components (50+ lines)

G shell/browser shell/browser shell/common shell/common shell/browser--shell/common 235 shell/renderer shell/renderer shell/browser--shell/renderer 188 spec-main spec-main spec spec spec-main--spec 182

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 50 longest duplicates.
See data for all 1,281 duplicates...
Size#FoldersFilesLinesCode
26 x 2 spec-main
spec-main
1179:1209 (1%)
1220:1250 (1%)
view
22 x 2 shell/browser
shell/browser
34:61 (9%)
181:208 (9%)
view
20 x 2 spec-main
spec-main
288:308 (5%)
338:358 (5%)
view
19 x 2 shell/browser
shell/browser
39:57 (9%)
51:69 (9%)
view
18 x 2 spec-main
spec-main
557:576 (1%)
593:612 (1%)
view
18 x 2 spec-main/fixtures/auto-update/update-json
spec-main/fixtures/auto-update/update
1:24 (54%)
1:24 (56%)
view
18 x 2 spec-main
spec-main
4476:4493 (<1%)
645:662 (2%)
view
17 x 2 spec-main
spec-main
282:300 (<1%)
375:393 (<1%)
view
16 x 2 shell/browser/api
shell/browser
136:151 (9%)
142:157 (6%)
view
16 x 2 spec-main
spec-main
745:760 (1%)
843:858 (1%)
view
16 x 2 spec-main
spec-main
1330:1346 (<1%)
1387:1403 (<1%)
view
15 x 2 spec-main
spec-main
1302:1317 (<1%)
1355:1370 (<1%)
view
15 x 2 shell/browser/api
shell/browser
788:802 (1%)
703:717 (1%)
view
15 x 2 spec-main
spec-main
697:711 (<1%)
843:857 (<1%)
view
15 x 2 spec-main
spec-main
697:711 (<1%)
745:759 (<1%)
view
14 x 2 shell/renderer/api
shell/renderer/api
236:249 (2%)
263:276 (2%)
view
14 x 2 spec-main
spec-main
50:63 (8%)
67:80 (8%)
view
14 x 2 spec-main
spec-main
50:63 (8%)
159:172 (8%)
view
14 x 2 spec-main
spec-main
67:80 (8%)
159:172 (8%)
view
13 x 2 spec-main
spec
1758:1772 (<1%)
1108:1122 (1%)
view
13 x 2 shell/browser/api
shell/browser
138:150 (7%)
704:716 (1%)
view
13 x 2 spec-main
spec-main
260:273 (<1%)
354:367 (<1%)
view
13 x 2 spec-main
spec-main
84:96 (7%)
100:112 (7%)
view
13 x 2 spec
spec
122:136 (1%)
410:424 (1%)
view
13 x 2 shell/browser/api
shell/browser
789:801 (1%)
144:156 (5%)
view
13 x 2 spec-main
spec-main
3808:3822 (<1%)
272:286 (<1%)
view
13 x 2 spec-main/fixtures/auto-update/update-json
spec-main/fixtures/auto-update/update
27:43 (39%)
26:42 (40%)
view
13 x 2 shell/browser
shell/browser
704:716 (1%)
144:156 (5%)
view
13 x 2 spec-main
spec-main
1100:1112 (<1%)
1179:1191 (<1%)
view
13 x 2 spec-main
spec-main
1370:1382 (<1%)
1399:1411 (<1%)
view
13 x 2 spec-main
spec-main
263:278 (1%)
303:318 (1%)
view
13 x 2 spec-main
spec-main
2422:2438 (<1%)
2457:2473 (<1%)
view
13 x 2 shell/browser
shell/browser
82:94 (6%)
97:109 (6%)
view
13 x 2 spec-main
spec-main
795:807 (1%)
907:919 (1%)
view
13 x 2 shell/browser/api
shell/browser/api
789:801 (1%)
138:150 (7%)
view
12 x 2 shell/browser/api
shell/browser
123:134 (6%)
129:140 (4%)
view
12 x 2 spec-main
spec-main
1528:1542 (<1%)
1553:1567 (<1%)
view
12 x 2 spec-main
spec-main
103:115 (6%)
125:137 (6%)
view
12 x 2 shell/browser/net
shell/browser/net
230:241 (3%)
99:110 (11%)
view
12 x 2 spec-main
spec-main
1921:1932 (<1%)
1938:1949 (<1%)
view
12 x 2 spec
spec
375:387 (<1%)
423:435 (<1%)
view
12 x 2 ROOT
ROOT
149:160 (3%)
279:290 (3%)
view
12 x 2 shell/browser
shell/browser
68:79 (6%)
84:95 (5%)
view
12 x 2 spec-main
spec-main
83:95 (6%)
103:115 (6%)
view
12 x 2 spec
spec
439:451 (<1%)
455:467 (<1%)
view
12 x 2 spec-main
spec-main
83:95 (6%)
125:137 (6%)
view
11 x 2 spec-main
spec-main
3066:3080 (<1%)
3087:3100 (<1%)
view
11 x 2 spec-main
spec-main
278:291 (1%)
322:335 (1%)
view
11 x 2 spec-main
spec-main
627:637 (<1%)
651:661 (<1%)
view
11 x 2 spec/fixtures/pages/service-worker
spec/fixtures/pages/service-worker
18:28 (37%)
7:17 (64%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
9 x 2 shell/browser/ui/win
shell/browser/api
122:132 
58:68 
view
6 x 2 spec-main
spec
295:302 
43:50 
view