firebase / abseil-cpp-SwiftPM
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 4,383 units with 32,724 lines of code in units (44.7% of code).
    • 13 very long units (1,942 lines of code)
    • 34 long units (2,196 lines of code)
    • 248 medium size units (7,715 lines of code)
    • 477 small units (6,908 lines of code)
    • 3,611 very small units (13,963 lines of code)
5% | 6% | 23% | 21% | 42%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc10% | 9% | 32% | 21% | 25%
h<1% | 2% | 9% | 20% | 66%
inc0% | 13% | 41% | 15% | 28%
py0% | 0% | 12% | 37% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
absl/strings7% | 7% | 25% | 22% | 37%
absl/time16% | 9% | 26% | 15% | 32%
absl/synchronization13% | 2% | 31% | 19% | 32%
absl/random6% | 14% | 22% | 18% | 37%
absl/flags7% | 9% | 23% | 20% | 39%
absl/debugging3% | 9% | 45% | 24% | 17%
absl/container0% | 3% | 16% | 22% | 57%
absl/hash0% | 17% | 15% | 19% | 48%
absl/types0% | 4% | 4% | 28% | 61%
absl/base0% | 0% | 20% | 27% | 52%
absl/status0% | 0% | 22% | 14% | 62%
absl/numeric0% | 0% | 13% | 5% | 81%
ROOT0% | 0% | 38% | 34% | 27%
absl0% | 0% | 0% | 55% | 44%
absl/profiling0% | 0% | 0% | 40% | 59%
absl/algorithm0% | 0% | 0% | 4% | 95%
absl/memory0% | 0% | 0% | 25% | 74%
absl/meta0% | 0% | 0% | 68% | 32%
absl/functional0% | 0% | 0% | 0% | 100%
absl/copts0% | 0% | 0% | 0% | 100%
absl/cleanup0% | 0% | 0% | 0% | 100%
absl/utility0% | 0% | 0% | 0% | 100%
ci/CMake0% | 0% | 0% | 0% | 100%
CMake/install_test_project0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
bool parse()
in absl/time/internal/cctz/src/time_zone_format.cc
281 115 6
std::string format()
in absl/time/internal/cctz/src/time_zone_format.cc
202 82 4
ABSL_ATTRIBUTE_NOINLINE void Mutex::UnlockSlow()
in absl/synchronization/mutex.cc
198 53 1
bool CUnescapeInternal()
in absl/strings/escaping.cc
176 68 5
bool Base64UnescapeInternal()
in absl/strings/escaping.cc
151 44 6
class alignas()
in absl/random/internal/randen_engine.h
136 13 1
bool TimeZoneInfo::Load()
in absl/time/internal/cctz/src/time_zone_info.cc
127 52 1
126 27 5
120 30 2
void Mutex::LockSlowLoop()
in absl/synchronization/mutex.cc
110 26 2
strings_internal::ParsedFloat ParseFloat()
in absl/strings/internal/charconv_parse.cc
106 33 3
105 23 1
void ElfMemImage::Init()
in absl/debugging/internal/elf_mem_image.cc
104 30 1
double BetaIncompleteInvImpl()
in absl/random/internal/distribution_test_util.cc
94 20 4
size_t Base64EscapeInternal()
in absl/strings/internal/escaping.cc
83 15 6
time_zone local_time_zone()
in absl/time/internal/cctz/src/time_zone_lookup.cc
78 12 0
bool FloatToSink()
in absl/strings/internal/str_format/float_conversion.cc
76 30 3
double erfinv()
in absl/random/internal/distribution_test_util.cc
75 3 1
void btree::rebalance_or_split()
in absl/container/internal/btree.h
73 17 1
static VisitIndicesResultT Run()
in absl/types/internal/variant.h
73 35 2