facebookresearch / Radlibrary
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 48 units with 497 lines of code in units (84.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (74 lines of code)
    • 5 medium size units (156 lines of code)
    • 6 small units (89 lines of code)
    • 36 very small units (178 lines of code)
0% | 14% | 31% | 17% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
R0% | 14% | 31% | 17% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
R0% | 14% | 31% | 17% | 35%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
74 17 4
45 7 1
31 4 3
30 7 0
27 5 3
ad_row <- function()
in R/ad_data.R
23 3 1
20 2 1
17 4 0
graph_get <- function()
in R/graph_api.R
16 3 3
13 1 3
12 3 1
11 1 1
9 2 1
8 1 1
8 2 1
8 1 1
8 2 1
8 2 1
8 2 0
7 1 2