Linux / Samples
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
  • 15% duplication:
    • 21,282 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,243 duplicated lines
  • 351 duplicates
system15% (3,243 lines)
Duplication per Extension
c15% (3,164 lines)
h10% (79 lines)
Duplication per Component (primary)
bpf15% (1,994 lines)
vfio-mdev20% (541 lines)
ftrace51% (220 lines)
kfifo65% (217 lines)
seccomp13% (75 lines)
qmi16% (71 lines)
livepatch20% (69 lines)
trace_events15% (32 lines)
uhid4% (12 lines)
kobject6% (12 lines)
rpmsg0% (0 lines)
vfs0% (0 lines)
nitro_enclaves0% (0 lines)
landlock0% (0 lines)
timers0% (0 lines)
kmemleak0% (0 lines)
coresight0% (0 lines)
mei0% (0 lines)
kprobes0% (0 lines)
hw_breakpoint0% (0 lines)
binderfs0% (0 lines)
kdb0% (0 lines)
watchdog0% (0 lines)
v4l0% (0 lines)
connector0% (0 lines)
fanotify0% (0 lines)
pidfd0% (0 lines)
auxdisplay0% (0 lines)
configfs0% (0 lines)
hidraw0% (0 lines)
trace_printk0% (0 lines)
acrn0% (0 lines)
Longest Duplicates
The list of 50 longest duplicates.
See data for all 351 duplicates...
Size#FoldersFilesLinesCode
55 x 2 kfifo
kfifo
75:163 (60%)
68:156 (63%)
view
52 x 2 kfifo
kfifo
105:195 (57%)
112:202 (54%)
view
47 x 2 bpf
bpf
24:90 (85%)
40:106 (67%)
view
41 x 2 vfio-mdev
vfio-mdev
645:700 (4%)
353:408 (7%)
view
41 x 2 vfio-mdev
vfio-mdev
584:641 (4%)
292:349 (7%)
view
37 x 2 kfifo
kfifo
98:156 (42%)
112:170 (38%)
view
29 x 2 bpf
bpf
95:127 (18%)
62:94 (19%)
view
28 x 2 bpf
bpf
269:302 (7%)
336:369 (7%)
view
27 x 2 bpf
bpf
117:154 (23%)
228:265 (12%)
view
26 x 2 ftrace
ftrace
35:68 (46%)
28:61 (53%)
view
20 x 2 bpf
bpf
190:215 (13%)
144:169 (17%)
view
19 x 2 bpf
bpf
351:371 (3%)
500:520 (3%)
view
17 x 2 bpf
bpf
15:38 (56%)
22:45 (48%)
view
16 x 2 bpf
bpf
37:61 (29%)
42:64 (25%)
view
15 x 2 bpf
bpf
37:56 (35%)
45:64 (23%)
view
15 x 2 vfio-mdev
vfio-mdev
527:549 (2%)
1116:1138 (1%)
view
15 x 2 bpf
bpf
329:346 (2%)
479:496 (2%)
view
15 x 2 bpf
bpf
40:61 (27%)
37:56 (35%)
view
14 x 2 vfio-mdev
vfio-mdev
552:573 (2%)
1141:1162 (1%)
view
14 x 2 kfifo
kfifo
168:195 (15%)
159:186 (16%)
view
14 x 2 ftrace
ftrace
79:95 (14%)
87:103 (12%)
view
14 x 2 bpf
bpf
30:48 (12%)
28:46 (6%)
view
14 x 2 kfifo
kfifo
159:186 (16%)
175:202 (14%)
view
14 x 2 bpf
bpf
22:38 (63%)
40:55 (28%)
view
14 x 2 bpf
bpf
15:33 (38%)
21:38 (36%)
view
13 x 2 vfio-mdev
vfio-mdev
1230:1250 (1%)
576:596 (2%)
view
13 x 2 vfio-mdev
vfio-mdev
622:641 (1%)
819:838 (1%)
view
13 x 2 vfio-mdev
vfio-mdev
330:349 (2%)
819:838 (1%)
view
13 x 2 vfio-mdev
vfio-mdev
1359:1376 (1%)
671:688 (2%)
view
13 x 2 ftrace
ftrace
46:63 (13%)
51:68 (11%)
view
13 x 2 bpf
bpf
64:81 (36%)
66:83 (33%)
view
13 x 2 ftrace
ftrace
33:50 (25%)
31:48 (26%)
view
13 x 2 ftrace
ftrace
33:50 (25%)
38:55 (23%)
view
12 x 2 bpf
bpf
104:120 (13%)
22:38 (20%)
view
12 x 2 bpf
bpf
198:214 (9%)
45:61 (22%)
view
12 x 2 bpf
bpf
61:76 (7%)
112:127 (7%)
view
12 x 2 bpf
bpf
151:167 (3%)
238:254 (3%)
view
12 x 2 bpf
bpf
661:674 (1%)
805:818 (1%)
view
12 x 2 vfio-mdev
vfio-mdev
631:645 (2%)
1248:1262 (1%)
view
12 x 2 vfio-mdev
vfio-mdev
1315:1329 (1%)
631:645 (2%)
view
12 x 2 bpf
bpf
54:70 (19%)
57:73 (22%)
view
12 x 2 vfio-mdev
vfio-mdev
1315:1329 (1%)
1248:1262 (1%)
view
11 x 2 bpf
bpf
54:68 (20%)
123:136 (8%)
view
11 x 2 bpf
bpf
659:672 (<1%)
961:974 (<1%)
view
11 x 2 seccomp
seccomp
34:45 (5%)
63:74 (5%)
view
11 x 2 bpf
bpf
51:62 (30%)
52:63 (28%)
view
11 x 2 bpf
bpf
257:267 (2%)
323:333 (2%)
view
11 x 2 bpf
bpf
60:71 (13%)
44:55 (17%)
view
11 x 2 bpf
bpf
26:37 (15%)
60:71 (13%)
view
11 x 2 bpf
bpf
70:84 (15%)
123:136 (8%)
view
Duplicated Units
The list of top 21 duplicated units.
See data for all 21 unit duplicates...
Size#FoldersFilesLinesCode
45 x 2 vfio-mdev
vfio-mdev
352:409 
644:701 
view
25 x 2 kfifo
kfifo
162:189 
155:182 
view
16 x 2 bpf
bpf
32:49 
30:47 
view
14 x 2 bpf
bpf
78:96 
98:116 
view
13 x 3 bpf
bpf
bpf
58:72 
24:38 
42:56 
view
12 x 3 kfifo
kfifo
kfifo
106:122 
120:136 
113:129 
view
12 x 3 kfifo
kfifo
kfifo
124:140 
138:154 
131:147 
view
11 x 2 bpf
bpf
523:537 
72:86 
view
10 x 3 bpf
bpf
bpf
37:48 
45:56 
40:52 
view
9 x 2 bpf
bpf
652:662 
624:634 
view
8 x 2 configfs
configfs
196:204 
274:282 
view
8 x 3 bpf
bpf
bpf
19:28 
18:27 
23:32 
view
8 x 2 bpf
bpf
101:109 
631:639 
view
7 x 2 livepatch
livepatch
107:115 
59:67 
view
7 x 3 bpf
bpf
bpf
50:57 
58:65 
54:62 
view
7 x 2 bpf
bpf
52:60 
83:91 
view
6 x 2 vfio-mdev
vfio-mdev
1085:1092 
466:472 
view
6 x 2 bpf
bpf
421:428 
1490:1497 
view
6 x 2 bpf
bpf
40:47 
24:31 
view
6 x 2 bpf
bpf
49:56 
33:40 
view
6 x 3 kfifo
kfifo
kfifo
175:181 
191:197 
184:190 
view