Linux / Kernel
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:
    • 212,288 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 7,193 duplicated lines
  • 724 duplicates
system3% (7,193 lines)
Duplication per Extension
c3% (7,161 lines)
h<1% (32 lines)
Duplication per Component (primary)
trace5% (2,128 lines)
ROOT3% (1,574 lines)
bpf4% (1,429 lines)
sched2% (413 lines)
time3% (308 lines)
power5% (291 lines)
irq3% (212 lines)
locking2% (195 lines)
rcu1% (134 lines)
debug2% (114 lines)
cgroup1% (108 lines)
dma3% (103 lines)
events1% (96 lines)
futex2% (50 lines)
kcsan1% (14 lines)
printk<1% (12 lines)
gcov1% (12 lines)
livepatch0% (0 lines)
entry0% (0 lines)

Duplication Between Components (50+ lines)

G bpf bpf trace trace bpf--trace 137

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 724 duplicates...
Size#FoldersFilesLinesCode
51 x 2 trace
trace
375:474 (8%)
1219:1318 (4%)
view
23 x 2 bpf
bpf
2439:2474 (<1%)
2485:2524 (<1%)
view
20 x 2 dma
dma
1514:1539 (2%)
1546:1570 (2%)
view
18 x 2 ROOT
ROOT
3391:3408 (<1%)
3468:3485 (<1%)
view
18 x 2 rcu
rcu
801:823 (3%)
795:816 (3%)
view
18 x 2 irq
irq
696:724 (2%)
1256:1284 (2%)
view
17 x 2 trace
trace
71:93 (1%)
135:157 (1%)
view
17 x 2 bpf
bpf
1326:1347 (1%)
1362:1383 (1%)
view
17 x 2 bpf
bpf
1189:1212 (1%)
1244:1267 (1%)
view
16 x 2 ROOT
ROOT
1635:1653 (1%)
1776:1796 (1%)
view
16 x 2 bpf
bpf
2898:2919 (<1%)
3257:3278 (<1%)
view
16 x 2 trace
trace
1022:1048 (1%)
1808:1834 (1%)
view
15 x 2 power
power
741:764 (1%)
1233:1256 (1%)
view
15 x 2 cgroup
cgroup
279:299 (6%)
326:346 (6%)
view
15 x 2 trace
trace
564:585 (1%)
1891:1912 (1%)
view
15 x 2 ROOT
ROOT
307:322 (6%)
345:360 (6%)
view
14 x 2 bpf
bpf
1082:1102 (<1%)
1561:1581 (<1%)
view
14 x 2 bpf
bpf
2273:2290 (<1%)
2298:2315 (<1%)
view
14 x 2 trace
trace
856:873 (2%)
887:905 (2%)
view
14 x 2 trace
trace
990:1009 (1%)
1041:1060 (1%)
view
14 x 2 power
power
708:725 (1%)
1198:1215 (1%)
view
14 x 2 trace
trace
692:709 (2%)
352:369 (1%)
view
14 x 2 ROOT
ROOT
783:798 (2%)
852:871 (2%)
view
14 x 2 time
time
200:220 (3%)
244:264 (3%)
view
14 x 2 bpf
bpf
155:175 (6%)
201:221 (6%)
view
14 x 2 trace
trace
1682:1699 (1%)
1775:1792 (1%)
view
13 x 2 bpf
bpf
1126:1144 (<1%)
1249:1267 (<1%)
view
13 x 2 sched
sched
10641:10658 (<1%)
10839:10856 (<1%)
view
13 x 2 trace
trace
220:239 (2%)
331:350 (2%)
view
13 x 2 trace
trace
743:757 (2%)
763:777 (2%)
view
13 x 2 trace
trace
743:757 (2%)
783:797 (2%)
view
13 x 2 bpf
trace
1357:1369 (1%)
1144:1156 (<1%)
view
13 x 2 bpf
bpf
1126:1144 (<1%)
1194:1212 (<1%)
view
13 x 2 trace
trace
1187:1205 (1%)
824:842 (1%)
view
13 x 2 trace
trace
763:777 (2%)
783:797 (2%)
view
13 x 2 futex
futex
54:70 (6%)
323:339 (6%)
view
13 x 2 trace
trace
941:963 (1%)
1003:1025 (1%)
view
13 x 2 ROOT
ROOT
833:848 (2%)
901:916 (2%)
view
12 x 2 ROOT
ROOT
117:129 (4%)
151:163 (4%)
view
12 x 2 ROOT
ROOT
1285:1306 (1%)
1430:1451 (1%)
view
12 x 2 ROOT
ROOT
240:252 (<1%)
308:320 (<1%)
view
12 x 2 sched
sched
874:891 (1%)
189:206 (9%)
view
12 x 2 bpf
bpf
2098:2109 (<1%)
3145:3156 (<1%)
view
12 x 2 time
time
1305:1316 (1%)
1354:1365 (1%)
view
12 x 2 trace
trace
1129:1144 (<1%)
772:787 (1%)
view
12 x 2 time
time
1322:1333 (1%)
1371:1382 (1%)
view
12 x 2 irq
irq
692:713 (1%)
1200:1221 (1%)
view
11 x 2 ROOT
ROOT
371:387 (2%)
444:459 (2%)
view
11 x 2 bpf
bpf
134:145 (7%)
168:180 (7%)
view
11 x 2 time
time
1355:1365 (1%)
1372:1382 (1%)
view
Duplicated Units
The list of top 11 duplicated units.
See data for all 11 unit duplicates...
Size#FoldersFilesLinesCode
23 x 2 locking
locking
5056:5081 
5746:5771 
view
20 x 2 bpf
bpf
2897:2920 
3256:3279 
view
12 x 2 locking
locking
155:171 
508:525 
view
11 x 2 time
time
72:87 
90:105 
view
10 x 2 trace
trace
308:318 
350:360 
view
9 x 2 trace
trace
236:245 
396:405 
view
9 x 2 locking
locking
118:130 
590:602 
view
8 x 2 bpf
bpf
1857:1865 
1867:1875 
view
7 x 2 trace
trace
1197:1206 
834:843 
view
6 x 2 locking
locking
2673:2681 
2690:2699 
view
6 x 2 sched
sched
2023:2029 
1811:1818 
view