microsoft / WAFBench
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 166 units with 4,136 lines of code in units (1.6% of code).
    • 8 very long units (1,825 lines of code)
    • 10 long units (598 lines of code)
    • 22 medium size units (680 lines of code)
    • 44 small units (657 lines of code)
    • 82 very small units (376 lines of code)
44% | 14% | 16% | 15% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c69% | 12% | 8% | 7% | 2%
py0% | 18% | 30% | 31% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
wb69% | 12% | 8% | 7% | 2%
ftw_compatible_tool0% | 18% | 33% | 26% | 20%
pywb0% | 12% | 26% | 39% | 21%
tools0% | 36% | 16% | 34% | 11%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int main()
in wb/wb.c
541 142 2
315 57 1
269 69 1
219 57 1
134 23 1
124 10 1
122 28 1
101 1 1
84 17 1
67 19 1
def execute()
in ftw_compatible_tool/web_interface.py
64 9 0
61 24 2
def _report_experiment()
in ftw_compatible_tool/base.py
57 13 1
def _tutorial()
in ftw_compatible_tool/user_interface.py
55 4 1
def _convert()
in pywb/ftwhelper.py
55 17 2
53 11 1
def test()
in tools/waf_perf.py
51 9 5
51 12 2
43 12 1
def interact()
in ftw_compatible_tool/user_interface.py
40 10 1