facebookincubator / ktfmt
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 240 units with 2,263 lines of code in units (20.8% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (138 lines of code)
    • 19 medium size units (587 lines of code)
    • 49 small units (743 lines of code)
    • 170 very small units (795 lines of code)
0% | 6% | 25% | 32% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 17% | 0% | 10% | 71%
kt0% | 3% | 29% | 40% | 25%
js0% | 0% | 47% | 15% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ktfmt_idea_plugin/src/main/java/com/facebook/ktfmt/intellij0% | 17% | 0% | 10% | 71%
core/src/main/java/com/facebook/ktfmt/format0% | 4% | 28% | 43% | 23%
website/index0% | 0% | 63% | 0% | 36%
core/src/main/java/com/facebook/ktfmt/debughelpers0% | 0% | 76% | 0% | 23%
core/src/main/java/com/facebook/ktfmt/cli0% | 0% | 45% | 42% | 11%
website0% | 0% | 28% | 32% | 38%
core/src/main/java/com/facebook/ktfmt/kdoc0% | 0% | 14% | 22% | 63%
online_formatter/src/main/kotlin0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
74 1 0
64 3 1
47 10 1
47 4 1
44 1 2
43 7 1
41 7 1
40 7 1
38 12 0
29 4 1
27 4 1
27 1 0
25 2 0
24 7 1
24 4 1
23 3 1
23 7 1
22 5 1
21 2 1
21 5 1
21 6 3
20 5 1
20 1 1
20 4 3
20 3 1
19 3 2
19 3 1
19 4 1
19 3 1
19 1 1
19 6 2
18 1 1
18 1 1
18 2 1
18 1 1
18 3 2
17 7 1
17 2 1
17 2 1
17 1 1
17 7 1
17 3 2
16 4 1
16 2 2
15 2 1
14 3 1
14 2 1
14 4 1
14 3 2
14 1 2