microsoft / FASTER
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 2,182 units with 29,754 lines of code in units (70.7% of code).
    • 20 very long units (2,965 lines of code)
    • 75 long units (5,198 lines of code)
    • 256 medium size units (7,886 lines of code)
    • 432 small units (6,399 lines of code)
    • 1,399 very small units (7,306 lines of code)
9% | 17% | 26% | 21% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs10% | 17% | 27% | 21% | 24%
h11% | 16% | 23% | 22% | 25%
cc0% | 18% | 35% | 25% | 21%
js0% | 30% | 12% | 14% | 42%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cs/src/core9% | 13% | 27% | 23% | 25%
cs/remote/src17% | 18% | 18% | 18% | 26%
cc/src/core13% | 17% | 22% | 23% | 22%
cs/playground/AsyncStress26% | 9% | 29% | 14% | 19%
cs/benchmark8% | 36% | 39% | 4% | 11%
cs/remote/benchmark0% | 45% | 26% | 16% | 10%
cs/playground/ClassRecoveryDurability0% | 52% | 11% | 10% | 26%
cc/src/device0% | 15% | 26% | 22% | 35%
cc/benchmark-dir0% | 33% | 36% | 12% | 17%
cs/playground/SumStore0% | 29% | 23% | 26% | 20%
cs/src/devices0% | 16% | 38% | 20% | 25%
cs/playground/FasterLogMLSDTest0% | 86% | 0% | 13% | 0%
cc/playground/sum_store-dir0% | 58% | 0% | 0% | 41%
cc/src/environment0% | 0% | 34% | 37% | 27%
cs/playground/CacheStoreConcurrent0% | 0% | 58% | 22% | 18%
cc/src/common0% | 0% | 100% | 0% | 0%
cs/playground/TstRunner0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private unsafe bool ProcessBatch()
in cs/remote/src/FASTER.server/WebsocketServerSession.cs
279 49 2
internal void ProcessReplies()
in cs/remote/src/FASTER.client/ClientSession.cs
230 38 2
internal OperationStatus InternalDelete()
in cs/src/core/Index/FASTER/FASTERImpl.cs
206 30 6
168 52 0
internal OperationStatus InternalRead()
in cs/src/core/Index/FASTER/FASTERImpl.cs
168 36 9
161 43 2
internal OperationStatus InternalRMW()
in cs/src/core/Index/FASTER/FASTERImpl.cs
160 32 8
private static async Task ProfileStore()
in cs/playground/AsyncStress/Program.cs
142 25 3
private void WriteAsync()
in cs/src/core/Allocator/GenericAllocator.cs
142 25 9
private static bool GlobMatching()
in cs/remote/src/FASTER.server/PubSub/SpanByteKeySerializer.cs
141 39 5
130 32 1
public override void WriteAsync()
in cs/src/core/Device/ManagedLocalStorageDevice.cs
128 16 6
private unsafe void LoadDataFromFile()
in cs/benchmark/TestLoader.cs
124 24 5
public FasterKV()
in cs/src/core/Index/FASTER/FASTER.cs
122 19 6
public override void ReadAsync()
in cs/src/core/Device/ManagedLocalStorageDevice.cs
119 17 6
private void SplitChunk()
in cs/src/core/Index/FASTER/FASTERImpl.cs
116 21 4
internal OperationStatus InternalUpsert()
in cs/src/core/Index/FASTER/FASTERImpl.cs
115 22 7
internal OperationStatus InternalContinuePendingRMW()
in cs/src/core/Index/FASTER/FASTERImpl.cs
110 17 5
private void ThreadStateMachineStep()
in cs/src/core/Index/Synchronization/FasterStateMachine.cs
103 24 4
101 24 1