facebook / TextLayoutBuilder
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 86 units with 950 lines of code in units (75.2% of code).
    • 2 very long units (230 lines of code)
    • 1 long units (55 lines of code)
    • 6 medium size units (200 lines of code)
    • 6 small units (96 lines of code)
    • 71 very small units (369 lines of code)
24% | 5% | 21% | 10% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java24% | 5% | 21% | 10% | 38%
kt0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
library/src/main/java/com/facebook/fbui/textlayoutbuilder29% | 6% | 19% | 2% | 42%
library/libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy0% | 0% | 73% | 26% | 0%
library/src/main/java/com/facebook/fbui/textlayoutbuilder/util0% | 0% | 0% | 75% | 24%
library/libs/android-text/src/main/java/android/text0% | 0% | 0% | 100% | 0%
library/src/main/java/com/facebook/fbui/textlayoutbuilder/glyphwarmer0% | 0% | 0% | 42% | 57%
sample/src/main/kotlin/com/facebook/fbui/textlayoutbuilder/sample0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
121 28 0
109 12 19
55 7 5
49 3 13
44 2 13
31 9 0
27 5 3
25 1 11
24 5 1
20 5 1
20 7 1
18 7 1
16 1 13
11 3 1
11 2 1
10 4 1
10 1 4
10 3 1
9 2 1
9 3 1
9 3 1
9 3 1
8 2 0
8 2 0
8 3 2
8 2 1
8 2 1
8 2 1
8 2 1
8 2 1
7 1 1
7 2 1
7 3 1
7 3 1
7 2 1
7 2 1
7 2 1
7 2 1
7 2 1
7 2 1
7 2 1
7 2 1
6 1 2
6 1 1
5 1 3
5 1 1
5 1 1
5 1 1
5 1 1
4 1 3