Linux / Include
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:
    • 402,409 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 13,324 duplicated lines
  • 1,593 duplicates
system3% (13,324 lines)
Duplication per Extension
h3% (13,324 lines)
Duplication per Component (primary)
trace14% (4,462 lines)
linux1% (3,682 lines)
uapi3% (1,973 lines)
asm-generic13% (631 lines)
net<1% (439 lines)
math-emu17% (361 lines)
scsi4% (299 lines)
kunit29% (260 lines)
sound2% (252 lines)
acpi4% (236 lines)
media2% (205 lines)
crypto3% (108 lines)
drm1% (108 lines)
video3% (91 lines)
soc1% (86 lines)
rdma1% (83 lines)
dt-bindings4% (42 lines)
memory8% (6 lines)
misc0% (0 lines)
xen0% (0 lines)
clocksource0% (0 lines)
vdso0% (0 lines)
ras0% (0 lines)
kvm0% (0 lines)
pcmcia0% (0 lines)
keys0% (0 lines)

Duplication Between Components (50+ lines)

G linux linux uapi uapi linux--uapi 107 dt-bindings dt-bindings dt-bindings--linux 84 net net net--uapi 72 sound sound sound--uapi 55 media media media--uapi 54

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,593 duplicates...
Size#FoldersFilesLinesCode
83 x 2 trace/events
trace/events
15:97 (31%)
17:99 (45%)
view
54 x 2 asm-generic
asm-generic
240:293 (8%)
614:667 (8%)
view
45 x 2 asm-generic
asm-generic
185:229 (7%)
544:588 (7%)
view
36 x 2 asm-generic
asm-generic
139:174 (5%)
485:520 (5%)
view
35 x 2 asm-generic
asm-generic
181:216 (5%)
236:271 (5%)
view
33 x 2 asm-generic
asm-generic
543:575 (5%)
613:645 (5%)
view
32 x 2 asm-generic
asm-generic
240:271 (5%)
544:575 (5%)
view
32 x 2 asm-generic
asm-generic
185:216 (5%)
614:645 (5%)
view
30 x 2 dt-bindings/usb
linux/usb
133:466 (71%)
144:491 (88%)
view
30 x 2 asm-generic
asm-generic
18:62 (93%)
23:67 (60%)
view
28 x 2 trace/events
trace/events
26:53 (26%)
90:117 (26%)
view
28 x 2 trace/events
trace/events
98:133 (14%)
175:211 (14%)
view
27 x 2 asm-generic
asm-generic
135:162 (4%)
181:208 (4%)
view
27 x 2 asm-generic
asm-generic
135:162 (4%)
236:263 (4%)
view
27 x 2 asm-generic
asm-generic
102:128 (4%)
437:463 (4%)
view
25 x 2 asm-generic
asm-generic
484:508 (4%)
543:567 (4%)
view
25 x 2 asm-generic
asm-generic
484:508 (4%)
613:637 (4%)
view
25 x 2 uapi/linux
uapi/linux
39:63 (20%)
76:100 (20%)
view
24 x 2 acpi
acpi
1785:1808 (1%)
1813:1836 (1%)
view
24 x 2 trace/events
trace/events
2126:2153 (1%)
2215:2242 (1%)
view
24 x 2 asm-generic
asm-generic
240:263 (3%)
485:508 (3%)
view
24 x 2 asm-generic
asm-generic
139:162 (3%)
614:637 (3%)
view
24 x 2 asm-generic
asm-generic
185:208 (3%)
485:508 (3%)
view
24 x 2 asm-generic
asm-generic
139:162 (3%)
544:567 (3%)
view
23 x 2 trace/events
trace/events
448:474 (4%)
477:503 (4%)
view
23 x 2 trace/events
trace/events
97:123 (1%)
253:279 (1%)
view
22 x 2 linux/surface_aggregator
linux/surface_aggregator
448:469 (7%)
592:613 (7%)
view
22 x 2 trace/events
trace/events
64:86 (10%)
172:194 (10%)
view
22 x 2 uapi/rdma
uapi/rdma
791:812 (2%)
76:97 (14%)
view
21 x 2 scsi
scsi
350:375 (4%)
583:608 (4%)
view
21 x 2 trace/events
trace/events
578:602 (4%)
605:629 (4%)
view
21 x 2 trace/events
trace/events
132:156 (12%)
159:183 (12%)
view
21 x 2 trace/events
trace/events
858:882 (1%)
885:909 (1%)
view
20 x 2 uapi/linux
uapi/linux
565:586 (1%)
721:742 (1%)
view
20 x 2 uapi/linux
uapi/linux
464:485 (1%)
620:641 (1%)
view
20 x 2 trace/events
trace/events
26:48 (1%)
134:156 (1%)
view
19 x 2 trace/events
trace/events
2357:2379 (<1%)
2382:2404 (<1%)
view
19 x 2 trace/events
trace/events
167:192 (10%)
228:253 (10%)
view
19 x 2 asm-generic
asm-generic
98:117 (3%)
181:200 (3%)
view
19 x 2 asm-generic
asm-generic
98:117 (3%)
236:255 (3%)
view
19 x 2 asm-generic
asm-generic
98:117 (3%)
135:154 (3%)
view
18 x 2 trace/events
trace/events
79:100 (17%)
104:125 (17%)
view
18 x 2 uapi/linux
uapi/linux
5513:5538 (1%)
5856:5873 (1%)
view
18 x 2 trace/events
trace/events
1318:1339 (1%)
1228:1249 (<1%)
view
18 x 2 scsi
scsi
452:475 (3%)
685:708 (3%)
view
18 x 2 linux
linux
341:358 (5%)
405:422 (5%)
view
17 x 2 uapi/linux
uapi/linux
28:44 (30%)
49:65 (30%)
view
17 x 2 asm-generic
asm-generic
436:452 (2%)
484:500 (2%)
view
17 x 2 asm-generic
asm-generic
436:452 (2%)
543:559 (2%)
view
17 x 2 asm-generic
asm-generic
436:452 (2%)
613:629 (2%)
view
Duplicated Units
The list of top 23 duplicated units.
See data for all 23 unit duplicates...
Size#FoldersFilesLinesCode
22 x 2 uapi/linux
uapi/linux
463:486 
619:642 
view
22 x 2 uapi/linux
uapi/linux
564:587 
720:743 
view
18 x 2 uapi/linux
uapi/linux
513:532 
669:688 
view
14 x 2 uapi/linux/usb
uapi/linux/usb
498:512 
554:568 
view
11 x 2 asm-generic
asm-generic
56:68 
51:63 
view
11 x 2 uapi/linux/usb
uapi/linux/usb
272:283 
369:380 
view
9 x 2 linux
linux
53:62 
76:85 
view
8 x 3 crypto
crypto
crypto
552:560 
465:473 
659:667 
view
8 x 3 crypto
crypto
crypto
214:222 
226:234 
206:214 
view
7 x 2 linux/rpmsg
linux
10:17 
7:14 
view
7 x 2 linux
linux
2258:2265 
2304:2311 
view
7 x 2 linux
linux
190:197 
209:216 
view
7 x 2 linux/gpio
linux/gpio
364:372 
378:386 
view
6 x 2 uapi/linux/usb
uapi/linux/usb
285:291 
382:388 
view
6 x 2 linux/rpmsg
linux
19:25 
16:22 
view
6 x 2 linux/rpmsg
linux
35:41 
32:38 
view
6 x 2 linux/rpmsg
linux
51:57 
48:54 
view
6 x 2 linux
linux
1641:1647 
1670:1676 
view
6 x 2 linux
linux
79:85 
90:96 
view
6 x 2 linux
linux
1444:1450 
1451:1457 
view
6 x 2 linux/regulator
linux/regulator
370:376 
398:404 
view
6 x 2 linux/phy
linux/phy
392:399 
401:408 
view
6 x 2 linux/mtd
linux/mtd
54:60 
79:85 
view