microsoft / tracelogging
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 20 units with 1,290 lines of code in units (61.1% of code).
    • 3 very long units (749 lines of code)
    • 4 long units (265 lines of code)
    • 6 medium size units (213 lines of code)
    • 3 small units (37 lines of code)
    • 4 very small units (26 lines of code)
58% | 20% | 16% | 2% | 2%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c58% | 20% | 16% | 2% | 2%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src58% | 20% | 16% | 2% | 2%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static int EventProbeFilter()
in src/LttngHelpers.c
395 62 4
int lttngh_EventProbe()
in src/LttngHelpers.c
191 40 4
163 27 3
static unsigned Utf32ToUtf8()
in src/LttngHelpers.c
85 15 4
void lttngh_FormatSockaddr()
in src/LttngNetHelpers.c
67 12 3
static unsigned Utf16ToUtf8()
in src/LttngHelpers.c
57 13 4
int lttngh_RegisterProvider()
in src/LttngHelpers.c
56 5 6
46 8 2
void lttngh_ActivityIdCreate()
in src/LttngActivityHelpers.c
40 6 1
38 9 2
34 3 2
32 3 2
int lttngh_UnregisterProvider()
in src/LttngHelpers.c
23 2 3
static void ProviderError()
in src/LttngHelpers.c
15 1 3
static void ActivityRootCreate()
in src/LttngActivityHelpers.c
11 1 1
void lttngh_ActivityIdSet()
in src/LttngActivityHelpers.c
11 2 1
static int FixArrayCompare()
in src/LttngHelpers.c
10 3 2
void lttngh_FormatIPv4()
in src/LttngNetHelpers.c
6 1 2
void lttngh_FormatIPv6()
in src/LttngNetHelpers.c
6 1 2
void lttngh_ActivityIdGet()
in src/LttngActivityHelpers.c
4 1 1