pytorch / cpuinfo
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 389 units with 11,783 lines of code in units (73.6% of code).
    • 24 very long units (6,067 lines of code)
    • 27 long units (1,893 lines of code)
    • 52 medium size units (1,632 lines of code)
    • 64 small units (937 lines of code)
    • 222 very small units (1,254 lines of code)
51% | 16% | 13% | 7% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c59% | 16% | 14% | 6% | 3%
py0% | 46% | 8% | 41% | 4%
h0% | 4% | 10% | 15% | 69%
cc0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/arm59% | 14% | 17% | 4% | 3%
src/x8670% | 15% | 6% | 3% | 3%
tools49% | 25% | 16% | 4% | 3%
src/emscripten100% | 0% | 0% | 0% | 0%
src/linux0% | 32% | 28% | 36% | 2%
ROOT0% | 100% | 0% | 0% | 0%
scripts0% | 28% | 10% | 54% | 5%
src/mach0% | 100% | 0% | 0% | 0%
src0% | 0% | 30% | 4% | 65%
include0% | 0% | 0% | 18% | 81%
src/cpuinfo0% | 0% | 0% | 100% | 0%
bench0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
845 91 10
void cpuinfo_arm_linux_init()
in src/arm/linux/init.c
538 85 1
438 57 3
void cpuinfo_x86_linux_init()
in src/x86/linux/init.c
423 49 1
void cpuinfo_arm_mach_init()
in src/arm/mach/init.c
320 49 1
306 85 4
void cpuinfo_x86_mach_init()
in src/x86/mach/init.c
301 38 1
230 133 2
void cpuinfo_emscripten_init()
in src/emscripten/init.c
223 24 1
215 76 3
static bool parse_line()
in src/arm/linux/cpuinfo.c
206 50 4
void cpuinfo_arm_fixup_chipset()
in src/arm/linux/chipset.c
204 46 3
static void parse_features()
in src/arm/linux/cpuinfo.c
198 52 3
192 47 6
187 37 3
179 71 7
167 30 4
int main()
in tools/isa-info.c
149 120 2
145 30 1
139 28 3