fbsamples / workplace-platform-samples
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
  • 21% duplication:
    • 5,580 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,185 duplicated lines
  • 239 duplicates
system21% (1,185 lines)
Duplication per Extension
ps126% (642 lines)
py26% (328 lines)
js13% (215 lines)
Duplication per Component (primary)
SampleIntegrations/SampleBots/NodeJS14% (187 lines)
SupportScripts/Python/ManageGroupMembers90% (120 lines)
SupportScripts/Powershell/ChangeBulkEmail74% (77 lines)
SupportScripts/Powershell/ChangeBulkObjectId71% (77 lines)
SupportScripts/Powershell/MigrateUsersToPeopleSets42% (48 lines)
SupportScripts/Powershell/DownloadGroupFeed35% (46 lines)
SupportScripts/Powershell/ChangeBulkLocale46% (39 lines)
SupportScripts/Powershell/ExportGroupLastActivityDate42% (35 lines)
SupportScripts/Python/RemoveInactiveMembersFromGroup72% (35 lines)
SupportScripts/Python/RemoveMembersFromGroupUsingClaimDate67% (35 lines)
SupportScripts/Powershell/MigrateGroupContentToNewTenant8% (35 lines)
SupportScripts/Powershell/ExportPostActivity21% (33 lines)
SupportScripts/Python/GetGroupListWithDetails61% (33 lines)
SupportScripts/Python/GetKLCategoryInfo55% (33 lines)
SupportScripts/Powershell/ActivateInBulk41% (30 lines)
SupportScripts/Powershell/ExportGroupMembers46% (28 lines)
SupportScripts/Powershell/UpdateExternalIdFromAzureAd24% (26 lines)
SupportScripts/Powershell/ExportCampaignActivity14% (26 lines)
SupportScripts/Python/GetGroupFeedWithDetails30% (25 lines)
SupportScripts/Powershell/BackupAllUsersGroups23% (20 lines)
SupportScripts/Powershell/ArchiveGroupsInBulk20% (18 lines)
SupportScripts/Powershell/DeleteUserMessages16% (18 lines)
SupportScripts/Python/DownloadMessagesFromMember46% (18 lines)
SupportScripts/Powershell/CleanGroupMembers11% (17 lines)
SupportScripts/Powershell/AnonymiseUserProfileData16% (17 lines)
SupportScripts/Python/RemoveGroupMembers61% (16 lines)
SampleIntegrations/SampleWebhooks/NodeJS16% (16 lines)
SupportScripts/Powershell/MessageUsersWithoutProfilePicture32% (14 lines)
SupportScripts/Powershell/ExportUserDataWithInsights20% (14 lines)
SupportScripts/Python/GetPostViewers37% (13 lines)
SupportScripts/Powershell/RetrieveMessageInfo16% (12 lines)
SupportScripts/Powershell/ExportUsersSCIM10% (12 lines)
SampleIntegrations/SamplePlatforms/NodeJS2% (12 lines)
SampleIntegrations/SampleWebhooks/PHP0% (0 lines)
SupportScripts/Python/BulkReactivateUsers0% (0 lines)
SupportScripts/Python/UpdateUserEmails0% (0 lines)
SupportScripts/Python/AddUsersToGroup0% (0 lines)
SupportScripts/Python/ConnectivityTest0% (0 lines)
SupportScripts/Python/ExportUserDataWithInsights0% (0 lines)
SupportScripts/Python/DeleteUsers0% (0 lines)
SupportScripts/Python/PromoteGroupMemberToAdmin0% (0 lines)
SupportScripts/Python/UpdateUserFrontlineStatus0% (0 lines)
SupportScripts/Python/DownloadGroupFeed0% (0 lines)
SupportScripts/Python/UpdateGroupDescription0% (0 lines)
SupportScripts/Python/AccountManagement0% (0 lines)
SupportScripts/Python/AccessQRCodes0% (0 lines)

Duplication Between Components (50+ lines)

G SupportScripts/Powershell/ChangeBulkEmail SupportScripts/Powershell/ChangeBulkEmail SupportScripts/Powershell/ChangeBulkObjectId SupportScripts/Powershell/ChangeBulkObjectId SupportScripts/Powershell/ChangeBulkEmail--SupportScripts/Powershell/ChangeBulkObjectId 154 SupportScripts/Powershell/ChangeBulkLocale SupportScripts/Powershell/ChangeBulkLocale SupportScripts/Powershell/ChangeBulkEmail--SupportScripts/Powershell/ChangeBulkLocale 70 SupportScripts/Powershell/UpdateExternalIdFromAzureAd SupportScripts/Powershell/UpdateExternalIdFromAzureAd SupportScripts/Powershell/ChangeBulkEmail--SupportScripts/Powershell/UpdateExternalIdFromAzureAd 50 SupportScripts/Powershell/ChangeBulkObjectId--SupportScripts/Powershell/UpdateExternalIdFromAzureAd 50 SupportScripts/Powershell/MigrateGroupContentToNewTenant SupportScripts/Powershell/MigrateGroupContentToNewTenant SupportScripts/Powershell/MigrateUsersToPeopleSets SupportScripts/Powershell/MigrateUsersToPeopleSets SupportScripts/Powershell/MigrateGroupContentToNewTenant--SupportScripts/Powershell/MigrateUsersToPeopleSets 76 SupportScripts/Python/RemoveInactiveMembersFromGroup SupportScripts/Python/RemoveInactiveMembersFromGroup SupportScripts/Python/RemoveMembersFromGroupUsingClaimDate SupportScripts/Python/RemoveMembersFromGroupUsingClaimDate SupportScripts/Python/RemoveInactiveMembersFromGroup--SupportScripts/Python/RemoveMembersFromGroupUsingClaimDate 70 SupportScripts/Powershell/ChangeBulkLocale--SupportScripts/Powershell/ChangeBulkObjectId 70 SupportScripts/Powershell/DownloadGroupFeed SupportScripts/Powershell/DownloadGroupFeed SupportScripts/Powershell/ExportGroupLastActivityDate SupportScripts/Powershell/ExportGroupLastActivityDate SupportScripts/Powershell/DownloadGroupFeed--SupportScripts/Powershell/ExportGroupLastActivityDate 70 SupportScripts/Powershell/ExportPostActivity SupportScripts/Powershell/ExportPostActivity SupportScripts/Powershell/DownloadGroupFeed--SupportScripts/Powershell/ExportPostActivity 62 SupportScripts/Powershell/ExportGroupMembers SupportScripts/Powershell/ExportGroupMembers SupportScripts/Powershell/DownloadGroupFeed--SupportScripts/Powershell/ExportGroupMembers 52 SupportScripts/Powershell/ExportCampaignActivity SupportScripts/Powershell/ExportCampaignActivity SupportScripts/Powershell/DownloadGroupFeed--SupportScripts/Powershell/ExportCampaignActivity 50 SupportScripts/Powershell/ExportGroupLastActivityDate--SupportScripts/Powershell/ExportPostActivity 54 SupportScripts/Powershell/ExportGroupLastActivityDate--SupportScripts/Powershell/ExportGroupMembers 52 SupportScripts/Python/GetGroupListWithDetails SupportScripts/Python/GetGroupListWithDetails SupportScripts/Python/GetKLCategoryInfo SupportScripts/Python/GetKLCategoryInfo SupportScripts/Python/GetGroupListWithDetails--SupportScripts/Python/GetKLCategoryInfo 66 SampleIntegrations/SampleBots/NodeJS SampleIntegrations/SampleBots/NodeJS SampleIntegrations/SampleWebhooks/NodeJS SampleIntegrations/SampleWebhooks/NodeJS SampleIntegrations/SampleBots/NodeJS--SampleIntegrations/SampleWebhooks/NodeJS 62 SupportScripts/Powershell/ActivateInBulk SupportScripts/Powershell/ActivateInBulk SupportScripts/Powershell/ActivateInBulk--SupportScripts/Powershell/ChangeBulkLocale 60 SupportScripts/Powershell/ExportGroupMembers--SupportScripts/Powershell/ExportPostActivity 56

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 239 duplicates...
Size#FoldersFilesLinesCode
60 x 2 SupportScripts/Python/ManageGroupMembers
SupportScripts/Python/ManageGroupMembers
manage_groups.py
remove_members_from_group.py
11:80 (92%)
11:80 (89%)
view
39 x 2 SupportScripts/Powershell/ChangeBulkEmail
SupportScripts/Powershell/ChangeBulkObjectId
ps1
changeBulkEmail.ps1
ChangeBulkObjectId.ps1
1:44 (37%)
1:44 (36%)
view
33 x 2 SupportScripts/Python/GetGroupListWithDetails
SupportScripts/Python/GetKLCategoryInfo
export_groups.py
export_kl_category.py
24:60 (61%)
31:67 (55%)
view
30 x 2 SupportScripts/Powershell/ActivateInBulk
SupportScripts/Powershell/ChangeBulkLocale
ps1
activateInBulk.ps1
changeBulkLocale.ps1
3:36 (41%)
3:36 (35%)
view
23 x 2 SupportScripts/Powershell/ChangeBulkEmail
SupportScripts/Powershell/ChangeBulkObjectId
ps1
changeBulkEmail.ps1
ChangeBulkObjectId.ps1
99:122 (22%)
101:124 (21%)
view
22 x 2 SupportScripts/Python/Re...nactiveMembersFromGroup
SupportScripts/Python/Re...FromGroupUsingClaimDate
remove_inactive_members_from_group.py
remove_members_from_group_claim_date.py
31:55 (45%)
34:58 (42%)
view
21 x 2 SupportScripts/Powershell/ActivateInBulk
SupportScripts/Powershell/ChangeBulkObjectId
ps1
activateInBulk.ps1
ChangeBulkObjectId.ps1
7:29 (29%)
7:28 (19%)
view
21 x 2 SupportScripts/Powershell/ChangeBulkLocale
SupportScripts/Powershell/ChangeBulkObjectId
ps1
changeBulkLocale.ps1
ChangeBulkObjectId.ps1
7:29 (25%)
7:28 (19%)
view
21 x 2 SupportScripts/Powershell/ChangeBulkEmail
SupportScripts/Powershell/ChangeBulkLocale
ps1
changeBulkEmail.ps1
changeBulkLocale.ps1
7:28 (20%)
7:29 (25%)
view
21 x 2 SupportScripts/Powershell/ActivateInBulk
SupportScripts/Powershell/ChangeBulkEmail
ps1
activateInBulk.ps1
changeBulkEmail.ps1
7:29 (29%)
7:28 (20%)
view
18 x 2 SupportScripts/Powershell/ArchiveGroupsInBulk
SupportScripts/Powershell/ChangeBulkLocale
ps1
archiveGroupsInBulk.ps1
changeBulkLocale.ps1
3:23 (20%)
3:23 (21%)
view
18 x 2 SupportScripts/Powershell/ActivateInBulk
SupportScripts/Powershell/ArchiveGroupsInBulk
ps1
activateInBulk.ps1
archiveGroupsInBulk.ps1
3:23 (25%)
3:23 (20%)
view
18 x 2 SupportScripts/Powershell/DownloadGroupFeed
SupportScripts/Powershell/ExportPostActivity
ps1
DownloadGroupFeed.ps1
exportPostActivity.ps1
6:26 (13%)
5:25 (11%)
view
18 x 2 SupportScripts/Python/DownloadMessagesFromMember
SupportScripts/Python/GetGroupFeedWithDetails
messages_member.py
group_posts_detail.py
25:45 (46%)
68:88 (21%)
view
18 x 2 SupportScripts/Powershell/DeleteUserMessages
SupportScripts/Powershell/MigrateUsersToPeopleSets
ps1
DeleteUserMessages.ps1
groupMembersToPeopleSets.ps1
6:24 (16%)
4:24 (15%)
view
17 x 2 SupportScripts/Python/GetGroupFeedWithDetails
SupportScripts/Python/GetGroupListWithDetails
group_posts_detail.py
export_groups.py
68:86 (20%)
24:42 (31%)
view
17 x 2 SupportScripts/Powershel...GroupContentToNewTenant
SupportScripts/Powershell/MigrateUsersToPeopleSets
ps1
groupContentCloner.ps1
groupMembersToPeopleSets.ps1
45:63 (3%)
6:24 (14%)
view
17 x 2 SupportScripts/Python/DownloadMessagesFromMember
SupportScripts/Python/GetKLCategoryInfo
messages_member.py
export_kl_category.py
25:43 (43%)
31:49 (28%)
view
17 x 2 SupportScripts/Python/GetGroupFeedWithDetails
SupportScripts/Python/GetKLCategoryInfo
group_posts_detail.py
export_kl_category.py
68:86 (20%)
31:49 (28%)
view
17 x 2 SupportScripts/Python/DownloadMessagesFromMember
SupportScripts/Python/GetGroupListWithDetails
messages_member.py
export_groups.py
25:43 (43%)
24:42 (31%)
view
Duplicated Units
The list of top 6 duplicated units.
See data for all 6 unit duplicates...
Size#FoldersFilesLinesCode
14 x 3 SampleIntegrations/SampleBots/NodeJS/FileAnIssue
SampleIntegrations/SampleBots/NodeJS/ExpenseBot
SampleIntegrations/SampleBots/NodeJS/ThanksBot
app.js
app.js
app.js
63:82 
91:110 
41:59 
view
14 x 2 SupportScripts/Python/GetKLCategoryInfo
SupportScripts/Python/GetGroupListWithDetails
export_kl_category.py
export_groups.py
0:0 
0:0 
view
11 x 7 SupportScripts/Python/GetPostViewers
SupportScripts/Python/GetGroupFeedWithDetails
SupportScripts/Python/DownloadMessagesFromMember
SupportScripts/Python/GetKLCategoryInfo
SupportScripts/Python/Re...nactiveMembersFromGroup
SupportScripts/Python/GetGroupListWithDetails
SupportScripts/Python/Re...FromGroupUsingClaimDate
get_post_viewers.py
group_posts_detail.py
messages_member.py
export_kl_category.py
remove_inactive_members_from_group.py
export_groups.py
remove_members_from_group_claim_date.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
11 x 2 SupportScripts/Python/ManageGroupMembers
SupportScripts/Python/ManageGroupMembers
manage_groups.py
remove_members_from_group.py
0:0 
0:0 
view
9 x 2 SupportScripts/Python/ManageGroupMembers
SupportScripts/Python/ManageGroupMembers
manage_groups.py
remove_members_from_group.py
0:0 
0:0 
view
7 x 2 SampleIntegrations/Sampl...JS/BasicWebhooksExample
SampleIntegrations/Sampl...JS/BasicWebhooksExample
app.js
app.js
129:136 
138:145 
view