microsoft / FishStore
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 421 units with 5,623 lines of code in units (59.9% of code).
    • 7 very long units (1,107 lines of code)
    • 12 long units (790 lines of code)
    • 40 medium size units (1,230 lines of code)
    • 87 small units (1,235 lines of code)
    • 275 very small units (1,261 lines of code)
19% | 14% | 21% | 21% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h21% | 15% | 21% | 20% | 21%
cc0% | 0% | 30% | 41% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/core23% | 15% | 21% | 20% | 18%
src/device0% | 16% | 14% | 15% | 53%
src/environment0% | 0% | 29% | 39% | 30%
src/adapters0% | 0% | 0% | 15% | 84%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
211 39 3
189 56 0
Status FishStore::Recover()
in src/core/fishstore.h
160 23 4
153 35 1
HMODULE GetLibHandle()
in src/core/fishstore.h
148 1 1
130 19 4
116 21 1
inline SystemState GetNextState()
in src/core/state_transitions.h
97 32 0
75 10 0
75 15 0
73 12 3
66 14 3
66 17 4
Status PersistentMemoryMalloc::AsyncFlushPages()
in src/core/persistent_memory_malloc.h
63 7 3
61 11 2
58 9 0
void TruncateSegments()
in src/device/file_system_disk.h
54 5 2
51 10 1
51 10 3
Status OpenSegment()
in src/device/file_system_disk.h
48 5 1