facebookincubator / fbender
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:
    • 1,922 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 73 duplicated lines
  • 6 duplicates
system3% (73 lines)
Duplication per Extension
go3% (73 lines)
Duplication per Component (primary)
cmd/dhcpv624% (20 lines)
cmd/dhcpv419% (19 lines)
tester/dhcpv431% (13 lines)
tester/dhcpv646% (13 lines)
flags3% (8 lines)
cmd0% (0 lines)
cmd/core0% (0 lines)
cmd/udp0% (0 lines)
cmd/tftp0% (0 lines)
cmd/http0% (0 lines)
cmd/dns0% (0 lines)
utils0% (0 lines)
recorders0% (0 lines)
tester0% (0 lines)
tester/udp0% (0 lines)
tester/tftp0% (0 lines)
tester/http0% (0 lines)
tester/run0% (0 lines)
tester/dns0% (0 lines)
log0% (0 lines)
metric0% (0 lines)
protocols/udp0% (0 lines)
ROOT0% (0 lines)
Longest Duplicates
The list of 6 longest duplicates.
See data for all 6 duplicates...
Size#FoldersFilesLinesCode
11 x 2 cmd/dhcpv4
cmd/dhcpv6
30:48 (23%)
33:51 (23%)
view
8 x 2 cmd/dhcpv6
flags
32:45 (17%)
34:47 (17%)
view
8 x 2 cmd/dhcpv4
cmd/dhcpv6
25:37 (25%)
23:35 (44%)
view
7 x 2 cmd/dhcpv4
flags
30:42 (15%)
35:47 (15%)
view
7 x 2 tester/dhcpv4
tester/dhcpv6
48:64 (17%)
47:63 (25%)
view
6 x 2 tester/dhcpv4
tester/dhcpv6
24:32 (14%)
23:31 (21%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
6 x 3 cmd/dhcpv4
cmd/dhcpv6
flags
34:43 
37:46 
39:48 
view