awslabs / aws-c-common
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 1,158 units with 15,158 lines of code in units (65.2% of code).
    • 8 very long units (959 lines of code)
    • 21 long units (1,405 lines of code)
    • 165 medium size units (4,719 lines of code)
    • 299 small units (4,403 lines of code)
    • 665 very small units (3,672 lines of code)
6% | 9% | 31% | 29% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c4% | 9% | 35% | 29% | 21%
inl15% | 5% | 9% | 29% | 39%
h0% | 37% | 15% | 19% | 27%
py0% | 0% | 70% | 29% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
include/aws/common15% | 5% | 9% | 29% | 39%
source5% | 14% | 35% | 21% | 22%
source/windows12% | 16% | 16% | 21% | 32%
source/posix11% | 8% | 18% | 31% | 29%
include/aws/testing0% | 51% | 0% | 26% | 21%
verification/cbmc/proofs0% | 0% | 50% | 41% | 7%
source/arch/intel0% | 0% | 48% | 34% | 16%
verification/cbmc/stubs0% | 0% | 20% | 54% | 25%
source/android0% | 0% | 71% | 0% | 28%
verification/cbmc/include0% | 0% | 57% | 0% | 42%
verification/cbmc/sources0% | 0% | 0% | 46% | 53%
source/arch/arm0% | 0% | 0% | 0% | 100%
source/arch/generic0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
inl
static void hashlittle2()
in include/aws/common/private/lookup3.inl
148 60 4
inl
static uint32_t hashlittle()
in include/aws/common/private/lookup3.inl
142 60 3
static int s_parse_rfc_822()
in source/date_time.c
123 43 3
int aws_directory_traverse()
in source/windows/file.c
117 16 5
int aws_thread_launch()
in source/posix/thread.c
111 25 2
void aws_mem_tracer_dump()
in source/memtrace.c
110 9 1
static int s_parse_iso_8601()
in source/date_time.c
107 37 2
inl
static uint32_t hashbig()
in include/aws/common/private/lookup3.inl
101 44 3
int aws_format_standard_log_line()
in source/log_formatter.c
94 17 2
92 30 2
int aws_thread_launch()
in source/windows/thread.c
91 14 2
80 18 4
inl
void driver3()
in include/aws/common/private/lookup3.inl
80 8 0
int aws_directory_traverse()
in source/posix/file.c
75 20 5
75 9 2
int aws_xml_node_traverse()
in source/xml_parser.c
73 16 4
static inline int s_aws_run_test_case()
in include/aws/testing/aws_test_harness.h
64 13 1
int s_advance_to_closing_tag()
in source/xml_parser.c
63 9 3
typedef BOOL __stdcall SymFromAddr_fn()
in source/windows/system_info.c
63 8 4
inl
void driver2()
in include/aws/common/private/lookup3.inl
62 15 0