microsoft / Intune-Resource-Access
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
  • 20% duplication:
    • 3,940 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 807 duplicated lines
  • 61 duplicates
system20% (807 lines)
Duplication per Extension
cs25% (765 lines)
java6% (42 lines)
Duplication per Component (primary)
src/CsrValidation/csharp/unittests61% (336 lines)
src/PFXImportPowershell/PFXImportPS/cmdlets29% (221 lines)
src/PFXImportPowershell/EncryptionUtilities/Source12% (92 lines)
src/CsrValidation/csharp/ScepValidation9% (58 lines)
src/CsrValidation/java/lib7% (42 lines)
src/CsrValidation/csharp/example50% (29 lines)
src/CsrValidation/csharp/revocationExample38% (29 lines)
ROOT0% (0 lines)
src/CsrValidation/java/example0% (0 lines)
src/CsrValidation/java/revocationexample0% (0 lines)
src/PFXImportPowershell/OnPremValidation/IntunePFXCertConnectorValidationPS0% (0 lines)
src/PFXImportPowershell/OnPremValidation/IntunePFXCertConnectorValidationService0% (0 lines)
src/PFXImportPowershell/PFXImportPS0% (0 lines)
src/PFXImportPowershell/PFXImportPS/Properties0% (0 lines)
src/PFXImportPowershell/PFXImportPS/Serialization0% (0 lines)

Duplication Between Components (50+ lines)

G src/CsrValidation/csharp/example src/CsrValidation/csharp/example src/CsrValidation/csharp/revocationExample src/CsrValidation/csharp/revocationExample src/CsrValidation/csharp/example--src/CsrValidation/csharp/revocationExample 58

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 61 duplicates...
Size#FoldersFilesLinesCode
43 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneScepValidatorTests.cs
208:259 (16%)
264:315 (15%)
view
24 x 2 src/CsrValidation/csharp/ScepValidation
src/CsrValidation/java/l...t/intune/scepvalidation
IntuneScepServiceException.cs
IntuneScepServiceException.java
40:63 (41%)
47:70 (41%)
view
20 x 2 src/PFXImportPowershell/EncryptionUtilities/Source
src/PFXImportPowershell/EncryptionUtilities/Source
ManagedRSAEncryption.cs
ManagedRSAEncryption.cs
150:174 (8%)
289:313 (8%)
view
19 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
GetAuthToken.cs
SetAuthToken.cs
43:73 (76%)
41:71 (86%)
view
16 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
GetUserPFXCertificate.cs
RemoveUserPFXCertificate.cs
106:132 (12%)
107:134 (13%)
view
15 x 2 src/CsrValidation/csharp/example
src/CsrValidation/csharp/revocationExample
SimpleIniParser.cs
SimpleIniParser.cs
1:62 (100%)
1:62 (100%)
view
15 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
GetUserPFXCertificate.cs
GetUserPFXCertificate.cs
210:242 (12%)
271:303 (12%)
view
14 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
GetUserPFXCertificate.cs
ImportUserPFXCertificate.cs
106:128 (11%)
107:129 (10%)
view
14 x 2 src/CsrValidation/csharp/example
src/CsrValidation/csharp/revocationExample
Program.cs
Program.cs
31:57 (53%)
34:60 (31%)
view
14 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneScepValidatorTests.cs
328:344 (5%)
393:409 (5%)
view
14 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
ImportUserPFXCertificate.cs
RemoveUserPFXCertificate.cs
107:129 (10%)
107:130 (11%)
view
14 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneScepValidatorTests.cs
292:318 (5%)
352:378 (5%)
view
13 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
GetUserId.cs
GetUserPFXCertificate.cs
72:90 (31%)
114:132 (10%)
view
13 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
GetUserId.cs
RemoveUserPFXCertificate.cs
72:90 (31%)
116:134 (10%)
view
12 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneScepValidatorTests.cs
267:280 (4%)
327:340 (4%)
view
11 x 2 src/PFXImportPowershell/EncryptionUtilities/Source
src/PFXImportPowershell/EncryptionUtilities/Source
DerUtils.cs
DerUtils.cs
150:173 (3%)
206:229 (3%)
view
11 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
GetUserId.cs
ImportUserPFXCertificate.cs
72:86 (26%)
115:129 (8%)
view
11 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneScepValidatorTests.cs
329:341 (4%)
328:340 (3%)
view
11 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneRevocationClientTests.cs
268:280 (4%)
329:341 (4%)
view
11 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneScepValidatorTests.cs
268:280 (4%)
394:406 (3%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
32 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneScepValidatorTests.cs
209:245 
265:301 
view
20 x 2 src/CsrValidation/csharp/example
src/CsrValidation/csharp/revocationExample
SimpleIniParser.cs
SimpleIniParser.cs
37:63 
37:63 
view
11 x 2 src/PFXImportPowershell/PFXImportPS/cmdlets
src/PFXImportPowershell/PFXImportPS/cmdlets
GetUserPFXCertificate.cs
RemoveUserPFXCertificate.cs
98:109 
99:110 
view
6 x 2 src/CsrValidation/csharp/unittests
src/CsrValidation/csharp/unittests
IntuneRevocationClientTests.cs
IntuneRevocationClientTests.cs
140:146 
200:206 
view