microsoft / cpp_client_telemetry
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 11,793 units with 315,028 lines of code in units (70.4% of code).
    • 358 very long units (129,461 lines of code)
    • 738 long units (49,726 lines of code)
    • 2,215 medium size units (69,435 lines of code)
    • 2,387 small units (35,478 lines of code)
    • 6,095 very small units (30,928 lines of code)
41% | 15% | 22% | 11% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c46% | 16% | 21% | 9% | 6%
hpp26% | 16% | 13% | 15% | 28%
cpp12% | 18% | 29% | 18% | 20%
py8% | 15% | 34% | 19% | 22%
java0% | 18% | 23% | 12% | 45%
cs0% | 22% | 19% | 26% | 31%
cc0% | 4% | 35% | 31% | 28%
mm0% | 31% | 18% | 32% | 16%
h0% | <1% | 17% | 23% | 57%
pas0% | 0% | 57% | 21% | 21%
js0% | 0% | 47% | 0% | 52%
go0% | 0% | 56% | 28% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sqlite46% | 16% | 21% | 9% | 6%
zlib37% | 16% | 25% | 13% | 7%
lib17% | 17% | 21% | 17% | 26%
googletest2% | 5% | 28% | 24% | 39%
tools0% | 38% | 27% | 21% | 12%
wrappers0% | 18% | 15% | 27% | 39%
Solutions0% | 47% | 16% | 26% | 8%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static void decodeIntArray()
in sqlite/sqlite3_debug.c
27235 5943 5
static void decodeIntArray()
in sqlite/sqlite3_retail.c
27207 5943 5
SQLITE_PRIVATE int sqlite3VdbeExec()
in sqlite/sqlite3_debug.c
4321 1122 1
SQLITE_PRIVATE int sqlite3VdbeExec()
in sqlite/sqlite3_retail.c
4321 1122 1
2706 805 2
static YYACTIONTYPE yy_reduce()
in sqlite/sqlite3_debug.c
1991 523 4
static YYACTIONTYPE yy_reduce()
in sqlite/sqlite3_retail.c
1483 523 4
void inflate_fast()
in zlib/contrib/inflate86/inffas86.c
894 15 2
SQLITE_PRIVATE int sqlite3ParseUri()
in sqlite/sqlite3_debug.c
658 11 6
SQLITE_PRIVATE int sqlite3ParseUri()
in sqlite/sqlite3_retail.c
658 11 6
int ZEXPORT inflate()
in zlib/inflate.c
637 202 2
628 202 3
628 202 3
603 180 3
603 180 3
static int balance_nonroot()
in sqlite/sqlite3_debug.c
498 142 5
static int balance_nonroot()
in sqlite/sqlite3_retail.c
498 142 5
token_type scan_string()
in lib/include/mat/json.hpp
488 212 0
475 1 6
475 1 6