microsoft / EmbeddedSocial-Service
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 1,434 units with 25,542 lines of code in units (53.1% of code).
    • 19 very long units (3,737 lines of code)
    • 67 long units (4,607 lines of code)
    • 243 medium size units (7,340 lines of code)
    • 397 small units (5,792 lines of code)
    • 708 very small units (4,066 lines of code)
14% | 18% | 28% | 22% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs14% | 18% | 28% | 22% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Server/Common19% | 17% | 24% | 22% | 16%
Tools/Ops19% | 28% | 30% | 15% | 5%
Server/CTStore21% | 8% | 25% | 29% | 14%
UtilsInternal/Config92% | 0% | 0% | 7% | 0%
Server/DataFactory14% | 63% | 15% | 6% | 0%
Tools/Developer47% | 0% | 27% | 23% | 1%
Server/WebRole0% | 20% | 39% | 25% | 14%
Server/WorkerRole0% | 28% | 37% | 17% | 16%
External/LoggingEventSource0% | 27% | 20% | 30% | 22%
Server/WebRoleMicrosoftInternal0% | 24% | 27% | 16% | 32%
UtilsInternal0% | 12% | 25% | 33% | 28%
Server/Email0% | 91% | 0% | 0% | 8%
Server/OAuthLibrary0% | 0% | 70% | 22% | 7%
Server/WebRoleCommon0% | 0% | 39% | 26% | 33%
Server/KVLibrary0% | 0% | 78% | 10% | 10%
Server/Search0% | 0% | 38% | 26% | 35%
Server/PushNotificationsHub0% | 0% | 28% | 44% | 26%
Server/Messaging0% | 0% | 30% | 24% | 44%
Utils0% | 0% | 18% | 50% | 30%
Logging0% | 0% | 34% | 24% | 41%
Server/AVERT0% | 0% | 64% | 0% | 35%
Server/Metrics0% | 0% | 29% | 26% | 44%
Server/CVS0% | 0% | 0% | 48% | 51%
Server/CBStore0% | 0% | 0% | 10% | 89%
Server/EventSources0% | 0% | 0% | 0% | 100%
Utils/Handles0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private static void Initalize()
in code/Server/Common/Tables/ContainerTableDescriptorProvider.cs
1096 1 0
private RedisLuaScript BuildLuaScript()
in code/Server/CTStore/RedisCache.cs
468 68 1
static TestConstants()
in code/UtilsInternal/Config/TestConstants.cs
183 1 0
private string ActivityViewToString()
in code/Server/Common/Managers/PushNotificationsManager.cs
164 53 2
private async Task GetTopicView()
in code/Server/Common/Managers/ViewsManager.cs
146 29 6
private static void ParseArgs()
in code/Tools/Ops/ManageRedis/Program.cs
144 34 1
public async Task SubmitContentForModeration()
in code/Server/Common/Managers/CVSModerationManager.cs
143 27 6
private static void ParseArgs()
in code/Tools/Ops/ManageServerState/Program.cs
142 37 1
public async Task GetActivityView()
in code/Server/Common/Managers/ViewsManager.cs
137 34 10
private static Action ParseAction()
in code/Tools/Ops/ManageApps/Program.cs
132 29 1
public static async Task AsyncMain()
in code/Tools/Ops/ManageServerState/Program.cs
127 30 1
public async Task UpdateRelationshipToUser()
in code/Server/Common/Managers/RelationshipsManager.cs
117 14 9
private void ParseValidationArgs()
in code/Tools/Ops/ManageApps/AppContentValidation.cs
115 21 1
public IDictionary Execute()
in code/Server/DataFactory/TransformColumn.cs
113 17 4
private async Task TagContentAsMature()
in code/Server/Common/Managers/ReportsManager.cs
103 15 1
private static void AddXMsEnumToSwaggerJson()
in code/Tools/Developer/AddXMsEnumToSwaggerJson/Program.cs
103 28 2
private T GetEntityFromBytes()
in code/Server/CTStore/RedisCache.cs
102 22 1
private Operation GetPostOperation()
in code/Server/CTStore/ExecutionManager.cs
101 30 3
private static Action ParseArgs()
in code/Tools/Ops/ManageQueues/Program.cs
101 20 1
public IDictionary Execute()
in code/Server/DataFactory/UpdateAppsTable.cs
99 14 4