microsoft / WhatTheHack
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
  • 54% duplication:
    • 84,098 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 45,520 duplicated lines
  • 32,858 duplicates
system54% (45,520 lines)
Duplication per Extension
css81% (17,463 lines)
html58% (13,484 lines)
cs40% (5,301 lines)
js38% (3,669 lines)
yaml54% (1,554 lines)
scala47% (844 lines)
cshtml17% (634 lines)
bash84% (585 lines)
tf83% (493 lines)
ps122% (471 lines)
scss12% (190 lines)
yml28% (180 lines)
py25% (162 lines)
tfvars84% (142 lines)
php54% (106 lines)
htm78% (90 lines)
psm128% (89 lines)
tpl42% (63 lines)
Duplication per Component (primary)
001-IntroToKubernetes96% (20,446 lines)
002-IntroToAzureAI64% (16,695 lines)
006-AppModernization15% (1,298 lines)
027-FHIRPoweredHealthcare52% (1,083 lines)
003-DrivingMissData33% (844 lines)
012-InfraAsCode-Terraform87% (635 lines)
033-OSSDatabaseMigration71% (525 lines)
039-AKSEnterpriseGrade36% (505 lines)
009-MicroservicesInAzure8% (499 lines)
044-DevOpswithGithubActions22% (431 lines)
014-OSSDevOps80% (365 lines)
016-AppMigration15% (346 lines)
005-RockPaperScissorsBoom21% (324 lines)
023-AdvancedKubernetes45% (313 lines)
021-IdentityForApps12% (282 lines)
017-FrontDoor30% (278 lines)
047-TrafficControlWithDapr25% (216 lines)
011-InfraAsCode-ARM-DSC22% (134 lines)
007-AzureMonitoring33% (96 lines)
030-ConversationalAI5% (56 lines)
013-InfraAsCode-Ansible33% (50 lines)
031-DevOpsWithGitHub13% (28 lines)
045-InfraAsCode-Bicep15% (19 lines)
040-JavaOnAppService2% (16 lines)
015-Serverless4% (14 lines)
038-MDWCovid1911% (12 lines)
010-AzureDevOps4% (10 lines)
008-DatabricksIntroML0% (0 lines)
019-ThisOldDataWarehouse0% (0 lines)
034-MicrosoftTeams-MakeItReal0% (0 lines)
037-AzureVirtualDesktop0% (0 lines)
ROOT0% (0 lines)
_layouts0% (0 lines)
assets0% (0 lines)

Duplication Between Components (50+ lines)

G 001-IntroToKubernetes 001-IntroToKubernetes 044-DevOpswithGithubActions 044-DevOpswithGithubActions 001-IntroToKubernetes--044-DevOpswithGithubActions 464 005-RockPaperScissorsBoom 005-RockPaperScissorsBoom 021-IdentityForApps 021-IdentityForApps 005-RockPaperScissorsBoom--021-IdentityForApps 190 009-MicroservicesInAzure 009-MicroservicesInAzure 005-RockPaperScissorsBoom--009-MicroservicesInAzure 104 005-RockPaperScissorsBoom--044-DevOpswithGithubActions 62 021-IdentityForApps--044-DevOpswithGithubActions 84 031-DevOpsWithGitHub 031-DevOpsWithGitHub 021-IdentityForApps--031-DevOpsWithGitHub 50 017-FrontDoor 017-FrontDoor 017-FrontDoor--044-DevOpswithGithubActions 159 017-FrontDoor--021-IdentityForApps 54 009-MicroservicesInAzure--021-IdentityForApps 116 009-MicroservicesInAzure--031-DevOpsWithGitHub 50

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 32,858 duplicates...
Size#FoldersFilesLinesCode
8524 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
1:11219 (100%)
1:11219 (100%)
view
812 x 2 001-IntroToKubernetes/St...1/content-web/public/js
001-IntroToKubernetes/St...ontent-web-v2/public/js
knockout.validation.js
knockout.validation.js
10:1346 (100%)
10:1346 (100%)
view
182 x 2 027-FHIRPoweredHealthcar...itectures/HL7Conversion
027-FHIRPoweredHealthcar...itectures/HL7Conversion
deployhl72fhir-hl7converter.bash
deployhl72fhir.bash
47:250 (74%)
46:249 (68%)
view
166 x 2 006-AppModernization/Stu...nlimitedWebsite/Scripts
006-AppModernization/Stu...nlimitedWebsite/Scripts
respond.js
respond.matchmedia.addListener.js
22:224 (89%)
71:273 (74%)
view
162 x 2 002-IntroToAzureAI/Stude...pleFilesCognitiveSearch
002-IntroToAzureAI/Stude...pleFilesCognitiveSearch
10-K-FY16.html
10-K-FY16.html
4167:4330 (<1%)
8466:8629 (<1%)
view
158 x 2 006-AppModernization/Stu...mitedWebsite/Migrations
006-AppModernization/Stu...mitedWebsite/Migrations
201503130633247_InitialMigration.Desi...
PartsUnlimitedContextModelSnapshot.cs
31:230 (94%)
15:214 (98%)
view
154 x 2 001-IntroToKubernetes/St...b-v2/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
7694:7925 (1%)
7924:8155 (1%)
view
154 x 2 001-IntroToKubernetes/St...b-v2/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
7924:8155 (1%)
8607:8838 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
7924:8155 (1%)
8607:8838 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
7694:7925 (1%)
7924:8155 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
7694:7925 (1%)
8607:8838 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
7924:8155 (1%)
7694:7925 (1%)
view
154 x 2 001-IntroToKubernetes/St...b-v2/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
7694:7925 (1%)
8607:8838 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
8607:8838 (1%)
7694:7925 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
8607:8838 (1%)
7924:8155 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...-web/public/stylesheets
app.css
app.css
7694:7925 (1%)
7924:8155 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...-web/public/stylesheets
app.css
app.css
7694:7925 (1%)
8607:8838 (1%)
view
154 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...-web/public/stylesheets
app.css
app.css
7924:8155 (1%)
8607:8838 (1%)
view
127 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
1407:1581 (1%)
899:1073 (1%)
view
127 x 2 001-IntroToKubernetes/St...-web/public/stylesheets
001-IntroToKubernetes/St...b-v2/public/stylesheets
app.css
app.css
899:1073 (1%)
1407:1581 (1%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 167 unit duplicates...
Size#FoldersFilesLinesCode
922 x 2 001-IntroToKubernetes/St...1/content-web/public/js
001-IntroToKubernetes/St...ontent-web-v2/public/js
knockout.validation.js
knockout.validation.js
10:1346 
10:1346 
view
140 x 2 006-AppModernization/Stu...nlimitedWebsite/Scripts
006-AppModernization/Stu...nlimitedWebsite/Scripts
respond.js
respond.matchmedia.addListener.js
72:212 
121:261 
view
73 x 2 001-IntroToKubernetes/St...1/content-web/public/js
001-IntroToKubernetes/St...ontent-web-v2/public/js
knockout.validation.js
knockout.validation.js
679:771 
679:771 
view
70 x 2 002-IntroToAzureAI/Coach...reBot/PictureBot/Topics
002-IntroToAzureAI/Coach...reBot/PictureBot/Topics
RootTopic.cs
RootTopic.cs
64:145 
64:145 
view
56 x 2 002-IntroToAzureAI/Coach...de/EchoBot/EchoBotTests
002-IntroToAzureAI/Stude...de/EchoBot/EchoBotTests
DialogTestBase.cs
DialogTestBase.cs
53:119 
53:119 
view
52 x 5 002-IntroToAzureAI/Coach...t/PictureBot/Middleware
002-IntroToAzureAI/Coach...t/PictureBot/Middleware
002-IntroToAzureAI/Coach...t/PictureBot/Middleware
002-IntroToAzureAI/Coach...t/PictureBot/Middleware
002-IntroToAzureAI/Coach...ng-Bots/Code/Middleware
RegExpRecognizerMiddleware.cs
RegExpRecognizerMiddleware.cs
RegExpRecognizerMiddleware.cs
RegExpRecognizerMiddleware.cs
RegExpRecognizerMiddleware.cs
146:211 
146:211 
146:211 
146:211 
146:211 
view
46 x 2 002-IntroToAzureAI/Coach...ImageProcessing/TestCLI
002-IntroToAzureAI/Coach...ImageProcessing/TestCLI
Program.cs
Program.cs
84:131 
84:131 
view
41 x 5 002-IntroToAzureAI/Coach...t/PictureBot/Middleware
002-IntroToAzureAI/Coach...t/PictureBot/Middleware
002-IntroToAzureAI/Coach...t/PictureBot/Middleware
002-IntroToAzureAI/Coach...t/PictureBot/Middleware
002-IntroToAzureAI/Coach...ng-Bots/Code/Middleware
RegExpRecognizerMiddleware.cs
RegExpRecognizerMiddleware.cs
RegExpRecognizerMiddleware.cs
RegExpRecognizerMiddleware.cs
RegExpRecognizerMiddleware.cs
61:105 
61:105 
61:105 
61:105 
61:105 
view
36 x 2 002-IntroToAzureAI/Coach...ImageProcessing/TestCLI
002-IntroToAzureAI/Coach...ImageProcessing/TestCLI
Program.cs
Program.cs
17:54 
17:54 
view
34 x 2 002-IntroToAzureAI/Coach...de/EchoBot/EchoBotTests
002-IntroToAzureAI/Stude...de/EchoBot/EchoBotTests
DialogTestBase.cs
DialogTestBase.cs
152:195 
152:195 
view
34 x 2 002-IntroToAzureAI/Coach...de/EchoBot/EchoBotTests
002-IntroToAzureAI/Stude...de/EchoBot/EchoBotTests
MockConnectorFactory.cs
MockConnectorFactory.cs
97:139 
97:139 
view
34 x 2 016-AppMigration/Student...yService.Api/Migrations
016-AppMigration/Student...yService.Api/Migrations
20181127231359_AddPayroll.Designer.cs
InventoryContextModelSnapshot.cs
16:64 
14:62 
view
33 x 2 002-IntroToAzureAI/Coach...ctLine/DirectLineClient
002-IntroToAzureAI/Stude...ctLine/DirectLineClient
Program.cs
Program.cs
58:99 
58:99 
view
32 x 2 001-IntroToKubernetes/St...1/content-web/public/js
001-IntroToKubernetes/St...ontent-web-v2/public/js
knockout.validation.js
knockout.validation.js
226:274 
226:274 
view
31 x 2 002-IntroToAzureAI/Coach...irectLine/DirectLineBot
002-IntroToAzureAI/Stude...irectLine/DirectLineBot
DirectLineBotDialog.cs
DirectLineBotDialog.cs
17:56 
17:56 
view
29 x 2 001-IntroToKubernetes/St...1/content-web/public/js
001-IntroToKubernetes/St...ontent-web-v2/public/js
knockout.validation.js
knockout.validation.js
587:626 
587:626 
view
28 x 2 001-IntroToKubernetes/St...1/content-web/public/js
001-IntroToKubernetes/St...ontent-web-v2/public/js
knockout.validation.js
knockout.validation.js
968:1002 
968:1002 
view
28 x 2 002-IntroToAzureAI/Coach...ctLine/DirectLineClient
002-IntroToAzureAI/Stude...ctLine/DirectLineClient
Program.cs
Program.cs
23:56 
23:56 
view
199 x 2 006-AppModernization/Stu...nlimitedWebsite/Scripts
006-AppModernization/Stu...nlimitedWebsite/Scripts
respond.js
respond.matchmedia.addListener.js
25:224 
74:273 
view
27 x 2 002-IntroToAzureAI/Coach...reBot/PictureBot/Topics
002-IntroToAzureAI/Coach...reBot/PictureBot/Topics
RootTopic.cs
RootTopic.cs
61:95 
61:95 
view