facebookincubator / python-nubia
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 239 units with 1,784 lines of code in units (58.0% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (139 lines of code)
    • 19 medium size units (582 lines of code)
    • 24 small units (370 lines of code)
    • 194 very small units (693 lines of code)
0% | 7% | 32% | 20% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 7% | 32% | 20% | 38%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
nubia/internal/typing0% | 24% | 33% | 16% | 25%
nubia/internal0% | 0% | 26% | 25% | 47%
nubia_complete0% | 0% | 70% | 22% | 6%
example0% | 0% | 37% | 19% | 42%
nubia/internal/ui0% | 0% | 46% | 0% | 53%
nubia/internal/io0% | 0% | 0% | 31% | 68%
nubia/internal/commands0% | 0% | 0% | 0% | 100%
example/commands0% | 0% | 0% | 0% | 100%
example/commands/more0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
83 23 2
56 15 1
48 9 4
45 3 1
40 6 1
39 21 1
38 15 1
36 1 2
34 12 2
32 9 3
28 11 2
28 11 2
27 7 1
25 1 2
25 3 1
24 11 1
24 6 4
24 6 1
23 4 2
21 5 2
21 8 2
20 3 1
20 7 2
20 6 2
20 10 1
19 7 2
18 4 3
17 7 3
17 5 2
17 10 3
16 4 3
16 12 2
16 6 1
16 4 4
14 5 1
14 4 1
13 2 1
13 3 2
13 3 2
13 5 3
12 1 2
12 5 2
12 2 3
11 5 3
11 3 5
10 1 5
10 4 1
9 4 2
9 5 2
9 3 1