awslabs / aws-lambda-cpp
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 151 units with 2,276 lines of code in units (56.2% of code).
    • 0 very long units (0 lines of code)
    • 12 long units (863 lines of code)
    • 19 medium size units (636 lines of code)
    • 26 small units (405 lines of code)
    • 94 very small units (372 lines of code)
0% | 37% | 27% | 17% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h0% | 42% | 25% | 15% | 17%
cpp0% | 18% | 40% | 29% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 38% | 28% | 18% | 14%
include/aws/http0% | 0% | 0% | 0% | 100%
include/aws/lambda-runtime0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
92 28 3
ResolvedTrace resolve()
in src/backward.h
86 19 1
ResolvedTrace resolve()
in src/backward.h
85 20 1
80 18 4
77 19 5
75 9 0
ResolvedTrace resolve()
in src/backward.h
70 21 1
void operator()
in src/backward.h
68 16 0
Dwarf_Die find_die()
in src/backward.h
64 22 2
void find_in_section()
in src/backward.h
59 12 5
static bool die_has_pc()
in src/backward.h
56 20 3
51 13 4
50 12 2
void run_handler()
in src/runtime.cpp
49 9 1
48 4 3
size_t load_here()
in src/backward.h
48 9 1
44 12 1
ResolvedTrace resolve()
in src/backward.h
41 22 1
41 8 3
ResolvedTrace resolve()
in src/backward.h
34 3 1