Linux / Documentation
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
  • 10% duplication:
    • 770,855 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 83,597 duplicated lines
  • 194,718 duplicates
system10% (83,597 lines)
Duplication per Extension
yaml22% (38,131 lines)
rst7% (32,878 lines)
txt9% (12,122 lines)
pl24% (294 lines)
py7% (132 lines)
asc4% (40 lines)
Duplication per Component (primary)
devicetree17% (47,367 lines)
userspace-api22% (11,505 lines)
translations15% (6,762 lines)
networking4% (2,130 lines)
admin-guide2% (1,589 lines)
trace10% (1,474 lines)
driver-api3% (1,394 lines)
scsi12% (1,248 lines)
features78% (1,080 lines)
process9% (916 lines)
core-api8% (797 lines)
filesystems2% (793 lines)
hwmon5% (788 lines)
sound5% (618 lines)
ROOT15% (525 lines)
virt4% (497 lines)
kernel-hacking27% (486 lines)
dev-tools6% (377 lines)
RCU3% (363 lines)
input4% (334 lines)
doc-guide21% (239 lines)
usb4% (179 lines)
x862% (144 lines)
sphinx8% (132 lines)
PCI4% (126 lines)
arm2% (113 lines)
i2c3% (112 lines)
bpf2% (106 lines)
fb2% (104 lines)
security2% (98 lines)
power1% (96 lines)
infiniband15% (92 lines)
sparc4% (86 lines)
scheduler3% (81 lines)
hid4% (77 lines)
xtensa30% (75 lines)
powerpc1% (70 lines)
gpu1% (60 lines)
arm641% (50 lines)
riscv14% (49 lines)
watchdog3% (48 lines)
s3901% (42 lines)
crypto1% (42 lines)
maintainer8% (41 lines)
locking1% (40 lines)
cpu-freq8% (36 lines)
iio24% (28 lines)
accounting4% (27 lines)
tools5% (26 lines)
kbuild<1% (24 lines)
staging1% (24 lines)
misc-devices1% (22 lines)
leds1% (18 lines)
openrisc10% (12 lines)
vm<1% (12 lines)
fault-injection1% (12 lines)
mips12% (11 lines)
m68k0% (0 lines)
ide0% (0 lines)
parisc0% (0 lines)
cdrom0% (0 lines)
mhi0% (0 lines)
ia640% (0 lines)
tty0% (0 lines)
livepatch0% (0 lines)
timers0% (0 lines)
sphinx-static0% (0 lines)
netlabel0% (0 lines)
firmware-guide0% (0 lines)
sh0% (0 lines)
isdn0% (0 lines)
spi0% (0 lines)
nvdimm0% (0 lines)
fpga0% (0 lines)
pcmcia0% (0 lines)
arc0% (0 lines)
w10% (0 lines)
block0% (0 lines)
nios20% (0 lines)

Duplication Between Components (50+ lines)

G process process translations translations process--translations 3118 core-api core-api core-api--translations 1298 kernel-hacking kernel-hacking kernel-hacking--translations 1017 ROOT ROOT ROOT--translations 920 admin-guide admin-guide admin-guide--translations 863 driver-api driver-api admin-guide--driver-api 110 userspace-api userspace-api admin-guide--userspace-api 60 doc-guide doc-guide doc-guide--translations 535 PCI PCI PCI--translations 224 dev-tools dev-tools dev-tools--translations 202 infiniband infiniband infiniband--translations 184 scheduler scheduler scheduler--translations 162 driver-api--userspace-api 138 cpu-freq cpu-freq cpu-freq--translations 108 trace trace x86 x86 trace--x86 88 riscv riscv riscv--translations 86 maintainer maintainer maintainer--translations 82 iio iio iio--translations 56 accounting accounting accounting--translations 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 194,718 duplicates...
Size#FoldersFilesLinesCode
177 x 2 process
translations/zh_TW/process
26:202 (90%)
26:202 (91%)
view
177 x 2 process
translations/it_IT/process
26:202 (90%)
34:210 (87%)
view
177 x 2 translations/it_IT/process
translations/zh_TW/process
34:210 (87%)
26:202 (91%)
view
177 x 2 translations/it_IT/process
translations/zh_CN/process
34:210 (87%)
23:199 (92%)
view
177 x 2 translations/zh_CN/process
translations/zh_TW/process
23:199 (92%)
26:202 (91%)
view
177 x 2 process
translations/zh_CN/process
26:202 (90%)
23:199 (92%)
view
109 x 2 process
translations/it_IT/process
55:163 (71%)
67:175 (67%)
view
109 x 2 translations/zh_CN/process
translations/zh_TW/process
43:151 (78%)
46:154 (77%)
view
109 x 2 process
translations/zh_TW/process
55:163 (71%)
46:154 (77%)
view
109 x 2 translations/it_IT/process
translations/zh_TW/process
67:175 (67%)
46:154 (77%)
view
109 x 2 process
translations/zh_CN/process
55:163 (71%)
43:151 (78%)
view
109 x 2 translations/it_IT/process
translations/zh_CN/process
67:175 (67%)
43:151 (78%)
view
99 x 2 scsi
scsi
2027:2142 (5%)
1094:1209 (10%)
view
82 x 2 translations/zh_CN/arm64
translations/zh_TW/arm64
100:238 (55%)
103:241 (55%)
view
81 x 2 kernel-hacking
translations/it_IT/kernel-hacking
385:478 (6%)
410:503 (6%)
view
80 x 2 kernel-hacking
translations/it_IT/kernel-hacking
602:686 (6%)
628:712 (6%)
view
79 x 2 translations/zh_CN/process
translations/zh_TW/process
59:137 (65%)
62:140 (64%)
view
77 x 2 process
translations/it_IT/process
70:146 (57%)
76:152 (55%)
view
71 x 2 kernel-hacking
translations/it_IT/kernel-hacking
711:787 (6%)
737:813 (5%)
view
70 x 2 virt/kvm
virt/kvm
3938:4029 (1%)
5032:5123 (1%)
view
69 x 2 kernel-hacking
translations/it_IT/kernel-hacking
1141:1217 (5%)
1177:1253 (5%)
view
68 x 2 scsi
scsi
512:593 (14%)
376:458 (18%)
view
67 x 2 devicetree/bindings/media
devicetree/bindings/media
120:204 (20%)
119:203 (19%)
view
65 x 2 dev-tools
translations/zh_CN/dev-tools
65:134 (17%)
67:136 (21%)
view
63 x 2 devicetree/bindings/power
devicetree/bindings/power
67:147 (28%)
118:198 (28%)
view
60 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:88 (34%)
11:88 (35%)
view
60 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:88 (40%)
13:90 (39%)
view
59 x 2 devicetree/bindings/media/i2c
devicetree/bindings/media/i2c
58:117 (35%)
100:159 (35%)
view
58 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
13:88 (37%)
11:86 (34%)
view
58 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
13:88 (37%)
11:86 (33%)
view
58 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:86 (38%)
11:86 (34%)
view
58 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:86 (38%)
11:86 (33%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (36%)
11:84 (38%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (44%)
11:84 (36%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (36%)
11:84 (36%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (36%)
11:84 (44%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (38%)
11:84 (36%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (34%)
11:84 (36%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (38%)
11:84 (44%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (36%)
11:84 (34%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (38%)
11:84 (34%)
view
57 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:84 (44%)
11:84 (34%)
view
56 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:83 (36%)
11:83 (37%)
view
56 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:83 (35%)
13:85 (36%)
view
56 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:83 (43%)
11:83 (37%)
view
56 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:83 (37%)
11:83 (37%)
view
56 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
23:95 (36%)
23:95 (35%)
view
56 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:83 (35%)
11:83 (37%)
view
56 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:83 (36%)
11:83 (33%)
view
56 x 2 devicetree/bindings/pinctrl
devicetree/bindings/pinctrl
11:83 (37%)
13:85 (36%)
view
Duplicated Units
The list of top 5 duplicated units.
See data for all 5 unit duplicates...
Size#FoldersFilesLinesCode
20 x 2 trace/postprocess
trace/postprocess
391:415 
731:755 
view
16 x 2 trace/postprocess
trace/postprocess
50:69 
81:100 
view
10 x 2 trace/postprocess
trace/postprocess
136:150 
229:243 
view
9 x 2 trace/postprocess
trace/postprocess
152:164 
245:257 
view
6 x 2 trace/postprocess
trace/postprocess
381:388 
721:728 
view