microsoft / opensource-management-portal
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:
    • 45,644 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 4,779 duplicated lines
  • 1,005 duplicates
system10% (4,779 lines)
Duplication per Extension
ts8% (3,193 lines)
pug18% (1,550 lines)
css4% (24 lines)
js2% (12 lines)
Duplication per Component (primary)
views18% (1,574 lines)
lib11% (904 lines)
business10% (637 lines)
api15% (519 lines)
entities12% (431 lines)
routes6% (324 lines)
jobs7% (258 lines)
features6% (58 lines)
middleware1% (42 lines)
webhooks2% (20 lines)
config3% (12 lines)
ROOT0% (0 lines)
default-assets-package0% (0 lines)
github0% (0 lines)
interfaces0% (0 lines)
scripts0% (0 lines)
user0% (0 lines)

Duplication Between Components (50+ lines)

G api api routes routes api--routes 224

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 1,005 duplicates...
Size#FoldersFilesLinesCode
66 x 2 views/repos
views/repos
pug
permissions.pug
repo.pug
1:71 (23%)
1:71 (21%)
view
38 x 2 lib/github
lib/github
composite.ts
restApi.ts
88:135 (25%)
290:337 (11%)
view
35 x 2 api/client/organization
api/client
people.ts
peopleSearch.ts
62:99 (36%)
31:68 (64%)
view
31 x 2 jobs/reports
jobs/reports
repositories.ts
teams.ts
623:663 (5%)
343:387 (8%)
view
28 x 2 views/email/membershipApprovals
views/email/membershipApprovals
pug
pleaseApprove.pug
requestSubmitted.pug
21:49 (57%)
20:48 (59%)
view
27 x 2 lib
lib/entityMetadataProvider
encryption.ts
tableEncryption.ts
125:158 (11%)
104:137 (9%)
view
24 x 2 views/repos
views/repos
pug
defaultBranch.pug
history.pug
15:40 (30%)
16:41 (28%)
view
24 x 2 views/repos
views/repos
pug
history.pug
permissions.pug
16:41 (28%)
76:101 (8%)
view
24 x 2 views/repos
views/repos
pug
defaultBranch.pug
permissions.pug
15:40 (30%)
76:101 (8%)
view
23 x 2 business
business
repositoryIssue.ts
repositoryPullRequest.ts
26:58 (21%)
29:61 (21%)
view
20 x 2 lib/linkProviders/memory
lib/linkProviders/table
memoryLink.ts
tableLink.ts
87:124 (17%)
91:128 (17%)
view
20 x 2 lib/linkProviders/memory
lib/linkProviders/table
memoryLinkProvider.ts
tableLinkProvider.ts
186:217 (11%)
373:404 (5%)
view
19 x 2 jobs/reports
jobs/reports
repositories.ts
teams.ts
768:791 (3%)
463:486 (5%)
view
19 x 2 views
views
pug
nav.pug
nav2.pug
30:49 (27%)
35:54 (13%)
view
17 x 2 jobs/cleanupKeys
jobs/cleanupTokens
task.ts
task.ts
13:35 (28%)
18:40 (20%)
view
17 x 2 lib
lib/cosmosSession
cosmosHelper.ts
index.ts
26:49 (28%)
30:53 (19%)
view
17 x 2 entities/organizationSettings
entities/organizationSettings
organizationSetting.ts
organizationSetting.ts
307:323 (6%)
330:346 (6%)
view
16 x 2 views/repos
views/repos
pug
permissions.pug
repo.pug
73:90 (5%)
74:91 (5%)
view
16 x 2 views
views
pug
index.pug
news.pug
258:273 (6%)
13:28 (61%)
view
16 x 2 views/repos
views/repos
pug
history.pug
permissions.pug
81:97 (18%)
279:295 (5%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 21 unit duplicates...
Size#FoldersFilesLinesCode
21 x 2 lib
lib/cosmosSession
cosmosHelper.ts
index.ts
29:50 
33:54 
view
19 x 2 jobs/cleanupKeys
jobs/cleanupTokens
task.ts
task.ts
13:33 
18:38 
view
17 x 2 lib
lib/entityMetadataProvider
encryption.ts
tableEncryption.ts
143:160 
122:139 
view
15 x 3 lib/linkProviders/memory
lib/linkProviders/postgres
lib/linkProviders/table
memoryLink.ts
postgresLink.ts
tableLink.ts
136:154 
144:162 
140:158 
view
17 x 2 business
business
repositoryActions.ts
repositoryActions.ts
93:110 
112:129 
view
14 x 2 entities/organizationMemberCache
entities/repositoryCollaboratorCache
organizationMemberCacheProvider.ts
repositoryCollaboratorCacheProvider.ts
40:54 
41:55 
view
10 x 2 business
business
repositoryIssue.ts
repositoryPullRequest.ts
89:99 
78:88 
view
10 x 2 business
business
repositoryProject.ts
repositoryPullRequest.ts
135:145 
163:173 
view
10 x 2 lib/github
lib/github
crossOrganization.ts
crossOrganization.ts
66:76 
78:88 
view
9 x 3 business
business
business
account.ts
repository.ts
team.ts
290:299 
264:273 
194:203 
view
9 x 2 business
business
repositoryIssue.ts
repositoryPullRequest.ts
52:62 
55:65 
view
9 x 2 business
business
repositoryIssue.ts
repositoryPullRequest.ts
78:87 
67:76 
view
15 x 2 lib
lib/entityMetadataProvider
encryption.ts
tableEncryption.ts
125:141 
104:120 
view
7 x 6 entities/organizationMemberCache
entities/repositoryCache
entities/repositoryCollaboratorCache
entities/repositoryTeamCache
entities/teamCache
entities/teamMemberCache
organizationMemberCacheProvider.ts
repositoryCacheProvider.ts
repositoryCollaboratorCacheProvider.ts
repositoryTeamCacheProvider.ts
teamCacheProvider.ts
teamMemberCacheProvider.ts
95:102 
63:70 
85:92 
85:92 
65:72 
93:100 
view
7 x 2 entities/teamJoinApproval
entities/token
teamJoinApproval.ts
token.ts
395:402 
256:263 
view
7 x 3 jobs/reports
jobs/reports
jobs/reports
organizations.ts
repositories.ts
teams.ts
568:575 
787:794 
482:489 
view
6 x 2 business
business
repositoryIssue.ts
repositoryPullRequest.ts
36:42 
39:45 
view
6 x 2 lib/config
lib/config
environmentConfigurationResolver.ts
volumeConfigurationResolver.ts
71:77 
63:69 
view
6 x 2 lib
lib/entityMetadataProvider
encryption.ts
tableEncryption.ts
62:68 
46:52 
view
6 x 3 lib/linkProviders/memory
lib/linkProviders/postgres
lib/linkProviders/table
memoryLink.ts
postgresLink.ts
tableLink.ts
159:165 
167:173 
163:169 
view