microsoft / SEAL
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,606 units with 23,540 lines of code in units (67.3% of code).
    • 10 very long units (2,014 lines of code)
    • 38 long units (2,628 lines of code)
    • 286 medium size units (8,440 lines of code)
    • 324 small units (4,800 lines of code)
    • 948 very small units (5,658 lines of code)
8% | 11% | 35% | 20% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp6% | 17% | 43% | 18% | 13%
cs20% | 0% | 4% | 25% | 49%
h4% | 3% | 36% | 22% | 34%
c31% | 14% | 25% | 16% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
native/src/seal/util8% | 14% | 47% | 16% | 12%
native/src/seal9% | 19% | 34% | 12% | 23%
dotnet/src20% | 0% | 4% | 25% | 49%
native/bench0% | 9% | 5% | 73% | 11%
native/src/seal/c0% | 0% | 40% | 26% | 32%
dotnet/src/tools0% | 0% | 34% | 17% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
612 1 3
static void KeccakF1600_StatePermute()
in native/src/seal/util/fips202.c
241 2 1
202 31 1
void Evaluator::switch_key_inplace()
in native/src/seal/evaluator.cpp
180 27 5
void encode_internal()
in native/src/seal/ckks.h
146 27 6
void transform_from_rev()
in native/src/seal/util/dwthandler.h
140 14 4
bool try_invert_uint_mod()
in native/src/seal/util/uintarithmod.cpp
137 20 5
void RNSTool::initialize()
in native/src/seal/util/rns.cpp
134 18 3
void CKKSEncoder::encode_internal()
in native/src/seal/ckks.cpp
113 18 5
int zlib_deflate_array_inplace()
in native/src/seal/util/ztools.cpp
109 17 2
unsigned zstd_deflate_array_inplace()
in native/src/seal/util/ztools.cpp
96 13 2
void transform_to_rev()
in native/src/seal/util/dwthandler.h
89 10 4
bool is_prime()
in native/src/seal/util/numth.cpp
89 23 2
void Evaluator::multiply_plain_normal()
in native/src/seal/evaluator.cpp
87 8 3
streamoff Serialization::Save()
in native/src/seal/serialization.cpp
86 9 5
void divide_uint_inplace()
in native/src/seal/util/uintarith.cpp
86 21 5
void decode_internal()
in native/src/seal/ckks.h
83 18 3
streamoff Serialization::Load()
in native/src/seal/serialization.cpp
83 12 3
void Evaluator::ckks_multiply()
in native/src/seal/evaluator.cpp
82 7 3
void encrypt_zero_symmetric()
in native/src/seal/util/rlwe.cpp
82 14 6