microsoft / mu_oem_sample
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
  • 11% duplication:
    • 5,128 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 601 duplicated lines
  • 40 duplicates
system11% (601 lines)
Duplication per Extension
c9% (372 lines)
h26% (229 lines)
Duplication per Component (primary)
OemPkg/Library/MsSecureBootLib21% (206 lines)
OemPkg/BootMenu14% (119 lines)
OemPkg/FrontPage7% (98 lines)
OemPkg/Library/MuUefiVersionLib30% (51 lines)
OemPkg/Library/PasswordPolicyLib14% (39 lines)
OemPkg/Library/DfciDeviceIdSupportLib30% (36 lines)
OemPkg/Library/PasswordPolicyLibNull72% (27 lines)
OemPkg/Include/Library21% (13 lines)
OemPkg/Library/MsSecureBootModeSettingDxeLib8% (12 lines)
ROOT0% (0 lines)
OemPkg/DeviceStatePei0% (0 lines)
OemPkg/FrontpageButtonsVolumeUp0% (0 lines)
OemPkg/Include/Guid0% (0 lines)
OemPkg/Include/Protocol0% (0 lines)
OemPkg/Include/Settings0% (0 lines)
OemPkg/Library/BootGraphicsProviderLib0% (0 lines)
OemPkg/Library/DfciGroupLib0% (0 lines)
OemPkg/Library/DfciUiSupportLib0% (0 lines)
OemPkg/Library/MsAltBootLib0% (0 lines)
OemPkg/Library/MsBootPolicyLib0% (0 lines)
OemPkg/Library/MsNVBootReasonLib0% (0 lines)
OemPkg/Library/PasswordStoreLib0% (0 lines)
OemPkg/Library/PlatformKeyLibNull0% (0 lines)
OemPkg0% (0 lines)
OemPkg/Override/MdeModulePkg0% (0 lines)

Duplication Between Components (50+ lines)

G OemPkg/BootMenu OemPkg/BootMenu OemPkg/FrontPage OemPkg/FrontPage OemPkg/BootMenu--OemPkg/FrontPage 56 OemPkg/Library/PasswordPolicyLib OemPkg/Library/PasswordPolicyLib OemPkg/Library/PasswordPolicyLibNull OemPkg/Library/PasswordPolicyLibNull OemPkg/Library/PasswordPolicyLib--OemPkg/Library/PasswordPolicyLibNull 54

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 40 duplicates...
Size#FoldersFilesLinesCode
96 x 2 OemPkg/Library/MsSecureBootLib
OemPkg/Library/MsSecureBootLib
MsSecureBootDefaultVars.h
MsSecureBootDefaultVars.h
119:214 (15%)
220:315 (15%)
view
15 x 2 OemPkg/BootMenu
OemPkg/FrontPage
BootMenu.c
FrontPageConfigAccess.h
112:127 (1%)
37:68 (100%)
view
12 x 2 OemPkg/FrontPage
OemPkg/Library/DfciDeviceIdSupportLib
FrontPage.c
DfciDeviceIdSupportLib.c
198:214 (1%)
47:63 (10%)
view
10 x 2 OemPkg/BootMenu
OemPkg/BootMenu
BootMenu.c
BootMenu.c
888:898 (1%)
992:1002 (1%)
view
9 x 2 OemPkg/BootMenu
OemPkg/BootMenu
BootMenu.c
BootMenu.c
129:137 (1%)
553:561 (1%)
view
9 x 2 OemPkg/FrontPage
OemPkg/FrontPage
FrontPageUi.c
FrontPageUi.h
159:167 (2%)
30:38 (50%)
view
8 x 2 OemPkg/BootMenu
OemPkg/BootMenu
BootMenu.c
BootMenu.c
679:688 (<1%)
720:729 (<1%)
view
8 x 2 OemPkg/BootMenu
OemPkg/BootMenu
BootMenu.c
BootMenu.c
900:910 (<1%)
1022:1032 (<1%)
view
8 x 2 OemPkg/Library/PasswordPolicyLib
OemPkg/Library/PasswordPolicyLibNull
PasswordPolicyLib.c
PasswordPolicyLibNull.c
541:548 (3%)
136:143 (21%)
view
7 x 2 OemPkg/FrontPage
OemPkg/FrontPage
FrontPageUi.c
FrontPageUi.c
296:312 (2%)
343:359 (2%)
view
7 x 2 OemPkg/Library/MsSecureBootLib
OemPkg/Library/MsSecureBootLib
MsSecureBootLib.c
MsSecureBootLib.c
81:87 (2%)
721:727 (2%)
view
7 x 2 OemPkg/Library/MuUefiVersionLib
OemPkg/Library/MuUefiVersionLib
MuUefiVersionLib.c
MuUefiVersionLib.c
147:174 (4%)
220:247 (4%)
view
7 x 2 OemPkg/Include/Library
OemPkg/Library/PasswordPolicyLib
PasswordPolicyLib.h
PasswordPolicyLib.c
146:152 (20%)
541:547 (2%)
view
7 x 2 OemPkg/FrontPage
OemPkg/FrontPage
FrontPageConfigAccess.c
FrontPageConfigAccess.h
38:44 (41%)
37:43 (46%)
view
7 x 2 OemPkg/BootMenu
OemPkg/FrontPage
BootMenu.c
FrontPageConfigAccess.h
1155:1161 (<1%)
37:43 (46%)
view
7 x 2 OemPkg/BootMenu
OemPkg/BootMenu
BootMenu.c
BootMenu.c
112:118 (<1%)
1155:1161 (<1%)
view
7 x 2 OemPkg/BootMenu
OemPkg/FrontPage
BootMenu.c
FrontPageConfigAccess.c
1155:1161 (<1%)
38:44 (41%)
view
7 x 2 OemPkg/BootMenu
OemPkg/FrontPage
BootMenu.c
FrontPageConfigAccess.c
112:118 (<1%)
38:44 (41%)
view
7 x 2 OemPkg/BootMenu
OemPkg/BootMenu
BootMenu.c
BootMenu.c
690:696 (<1%)
731:737 (<1%)
view
7 x 2 OemPkg/FrontPage
OemPkg/FrontPage
FrontPage.c
FrontPage.c
574:581 (<1%)
650:656 (<1%)
view