fbsamples / workplace-platform-samples
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 197 units with 1,954 lines of code in units (33.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (55 lines of code)
    • 18 medium size units (574 lines of code)
    • 51 small units (705 lines of code)
    • 127 very small units (620 lines of code)
0% | 2% | 29% | 36% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 4% | 44% | 32% | 17%
py0% | 0% | 9% | 39% | 51%
php0% | 0% | 0% | 76% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
SampleIntegrations/SampleBots/NodeJS0% | 5% | 48% | 30% | 15%
SupportScripts/Python/AccountManagement0% | 0% | 25% | 40% | 33%
SupportScripts/Python/DownloadGroupFeed0% | 0% | 0% | 78% | 21%
SampleIntegrations/SampleWebhooks/NodeJS0% | 0% | 0% | 53% | 46%
SupportScripts/Python/GetKLCategoryInfo0% | 0% | 0% | 56% | 43%
SupportScripts/Python/GetGroupListWithDetails0% | 0% | 0% | 64% | 35%
SupportScripts/Python/ManageGroupMembers0% | 0% | 0% | 23% | 76%
SampleIntegrations/SampleWebhooks/PHP0% | 0% | 0% | 76% | 23%
SampleIntegrations/SamplePlatforms/NodeJS0% | 0% | 0% | 55% | 44%
SupportScripts/Python/GetGroupFeedWithDetails0% | 0% | 0% | 21% | 78%
SupportScripts/Python/ExportUserDataWithInsights0% | 0% | 0% | 38% | 61%
SupportScripts/Python/RemoveMembersFromGroupUsingClaimDate0% | 0% | 0% | 38% | 61%
SupportScripts/Python/RemoveInactiveMembersFromGroup0% | 0% | 0% | 42% | 57%
SupportScripts/Python/DownloadMessagesFromMember0% | 0% | 0% | 48% | 52%
SupportScripts/Python/GetPostViewers0% | 0% | 0% | 52% | 47%
SupportScripts/Python/UpdateUserFrontlineStatus0% | 0% | 0% | 70% | 29%
SupportScripts/Python/UpdateUserEmails0% | 0% | 0% | 0% | 100%
SupportScripts/Python/AddUsersToGroup0% | 0% | 0% | 0% | 100%
SupportScripts/Python/DeleteUsers0% | 0% | 0% | 0% | 100%
SupportScripts/Python/UpdateGroupDescription0% | 0% | 0% | 0% | 100%
SupportScripts/Python/PromoteGroupMemberToAdmin0% | 0% | 0% | 0% | 100%
SupportScripts/Python/BulkReactivateUsers0% | 0% | 0% | 0% | 100%
SupportScripts/Python/RemoveGroupMembers0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
module._handleMessage = function()
in SampleIntegrations/SampleBots/NodeJS/FAQBot/utilities/messages.js
55 9 1
def buildUserJSONObj()
in SupportScripts/Python/AccountManagement/scim_sdk.py
48 2 1
function fbWebhookPost()
in SampleIntegrations/SampleBots/NodeJS/FileAnIssue/app.js
45 15 2
function claimToElement()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
45 8 2
function receivedMessage()
in SampleIntegrations/SampleBots/NodeJS/EmployeeSurvey/app.js
43 7 1
function receivedMessage()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
39 8 1
function receivedPostback()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
34 8 1
function sendFirstQuestion()
in SampleIntegrations/SampleBots/NodeJS/EmployeeSurvey/app.js
32 1 1
function setupPersistentMenu()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
32 2 0
function sendGetStarted()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
31 1 1
function sendStartSurvey()
in SampleIntegrations/SampleBots/NodeJS/EmployeeSurvey/app.js
30 1 1
function sendSecondQuestion()
in SampleIntegrations/SampleBots/NodeJS/EmployeeSurvey/app.js
28 1 1
feed()
in SampleIntegrations/SampleBots/NodeJS/FeedPoster/clock.js
27 6 3
function sendOpenClaims()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
27 3 1
def validateCSV()
in SupportScripts/Python/AccountManagement/scim_agent.py
27 3 3
function setupGreetingText()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
23 2 0
function callSendAPI()
in SampleIntegrations/SampleBots/NodeJS/EmployeeSurvey/app.js
21 4 1
function callSendAPI()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
21 4 1
function setupGetStartedButton()
in SampleIntegrations/SampleBots/NodeJS/ExpenseBot/app.js
21 2 0
function modify_user_email_address()
in SampleIntegrations/SampleWebhooks/PHP/WebhookModifyEmailAfterUserDeactivation/webhook_deactivation_mod_user.php
20 1 3