microsoft / krabsetw
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 368 units with 2,660 lines of code in units (38.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (60 lines of code)
    • 17 medium size units (444 lines of code)
    • 43 small units (619 lines of code)
    • 307 very small units (1,537 lines of code)
0% | 2% | 16% | 23% | 57%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
hpp0% | 2% | 16% | 23% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
krabs/krabs0% | 4% | 26% | 21% | 47%
krabs/krabs/testing0% | 0% | 21% | 24% | 54%
Microsoft.O365.Security.Native.ETW0% | 0% | 3% | 24% | 71%
krabs/krabs/filtering0% | 0% | 7% | 13% | 78%
Microsoft.O365.Security.Native.ETW/Filtering0% | 0% | 0% | 78% | 21%
Microsoft.O365.Security.Native.ETW/Testing0% | 0% | 0% | 30% | 69%
Microsoft.O365.Security.Native.ETW/Kernel0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
60 7 1
37 9 1
inline ULONG size_provider::get_heuristic_size()
in krabs/krabs/size_provider.hpp
34 8 3
33 12 2
30 11 2
inline size_t how_many_bytes_to_fill()
in krabs/krabs/testing/filler.hpp
30 23 1
28 4 0
inline ULONG size_provider::get_property_size()
in krabs/krabs/size_provider.hpp
27 8 4
virtual bool TryGetContainerId()
in Microsoft.O365.Security.Native.ETW/EventRecordMetadata.hpp
25 4 1
24 2 0
inline sid parser::parse()
in krabs/krabs/parser.hpp
24 5 1
23 8 2
23 2 1
22 8 1
inline void event_filter::on_event()
in krabs/krabs/filtering/event_filter.hpp
21 7 2
21 3 1
inline record_builder::record_builder()
in krabs/krabs/testing/record_builder.hpp
21 1 6
21 6 2
inline void RecordBuilder::AddValue()
in Microsoft.O365.Security.Native.ETW/Testing/RecordBuilder.hpp
20 7 2
20 3 1