microsoft / checkedc-llvm-test-suite
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 23,233 units with 538,882 lines of code in units (42.7% of code).
    • 913 very long units (185,043 lines of code)
    • 1,421 long units (98,488 lines of code)
    • 3,961 medium size units (124,289 lines of code)
    • 4,656 small units (68,913 lines of code)
    • 12,282 very small units (62,149 lines of code)
34% | 18% | 23% | 12% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c46% | 18% | 20% | 9% | 5%
cpp26% | 19% | 26% | 14% | 13%
cc17% | 26% | 28% | 15% | 12%
cxx34% | 23% | 25% | 13% | 1%
inc14% | 8% | 41% | 34% | <1%
h<1% | 7% | 19% | 21% | 50%
hpp0% | 14% | 57% | 14% | 13%
py0% | 8% | 45% | 23% | 22%
perl0% | 0% | 63% | 27% | 8%
pl0% | 0% | 60% | 0% | 39%
hxx0% | 0% | 16% | 9% | 74%
hh0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
MultiSource35% | 18% | 22% | 12% | 10%
CTMark33% | 17% | 21% | 12% | 13%
SingleSource14% | 14% | 35% | 23% | 12%
MicroBenchmarks19% | 22% | 29% | 17% | 10%
cmake96% | 0% | 0% | 0% | 3%
tools19% | 48% | 15% | 7% | 8%
LNTBased0% | 50% | 26% | 6% | 16%
litsupport0% | 0% | 46% | 27% | 26%
utils0% | 0% | 70% | 10% | 19%
ROOT0% | 0% | 32% | 39% | 28%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void Mesh::calc_neighbors_local()
in MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/mesh.cpp
1702 567 1
void Mesh::gpu_calc_neighbors_local()
in MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/mesh.cpp
1255 265 1
OBJECT Manifest()
in CTMark/consumer-typeset/z08.c
882 228 11
OBJECT FixAndPrintObject()
in CTMark/consumer-typeset/z23.c
882 180 10
OBJECT Manifest()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z08.c
882 228 11
OBJECT FixAndPrintObject()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z23.c
882 180 10
OBJECT MinSize()
in CTMark/consumer-typeset/z12.c
814 211 3
OBJECT MinSize()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z12.c
814 211 3
void constants()
in CTMark/mafft/constants.c
813 297 2
void constants()
in MultiSource/Benchmarks/mafft/constants.c
813 297 2
void Mesh::rezone_all()
in MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/mesh.cpp
786 119 5
Static void zgettok()
in MultiSource/Benchmarks/MallocBench/p2c/lex.c
773 307 0
void readcells()
in MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/readcells.c
709 105 1
float Falign()
in CTMark/mafft/Falign.c
697 135 8
float Falign()
in MultiSource/Benchmarks/mafft/Falign.c
697 135 8
void FlushGalley()
in CTMark/consumer-typeset/z20.c
693 196 1
void FlushGalley()
in MultiSource/Benchmarks/MiBench/consumer-typeset/z20.c
693 196 1
float Falign_udpari_long()
in CTMark/mafft/Falign.c
685 125 8
float Falign_udpari_long()
in MultiSource/Benchmarks/mafft/Falign.c
685 125 8
void L3para_read()
in MultiSource/Benchmarks/MiBench/consumer-lame/psymodel.c
662 122 18