apple / swift-cmark
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 267 units with 19,167 lines of code in units (66.8% of code).
    • 27 very long units (15,160 lines of code)
    • 11 long units (746 lines of code)
    • 48 medium size units (1,620 lines of code)
    • 67 small units (984 lines of code)
    • 114 very small units (657 lines of code)
79% | 3% | 8% | 5% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c80% | 3% | 8% | 4% | 2%
py0% | 0% | 20% | 38% | 41%
re0% | 0% | 0% | 13% | 86%
h0% | 0% | 0% | 0% | 100%
rb0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src83% | 3% | 6% | 4% | 3%
api_test14% | 12% | 53% | 15% | 4%
bench0% | 0% | 21% | 41% | 37%
wrappers0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
3392 1144 1
1690 359 1
1689 556 1
bufsize_t _scan_entity()
in src/scanners.c
895 323 1
876 286 1
838 312 1
bufsize_t _scan_scheme()
in src/scanners.c
721 286 1
615 182 1
591 173 1
360 106 1
360 106 1
325 94 1
323 85 1
311 89 1
271 73 1
static int S_render_node()
in src/commonmark.c
267 85 4
248 61 4
202 56 4
150 41 4
143 38 1