facebook / create-react-app
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 41 units with 1,267 lines of code in units (48.4% of code).
    • 3 very long units (419 lines of code)
    • 6 long units (378 lines of code)
    • 9 medium size units (266 lines of code)
    • 8 small units (125 lines of code)
    • 15 very small units (79 lines of code)
33% | 29% | 20% | 9% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js33% | 29% | 20% | 9% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/create-react-app32% | 34% | 20% | 11% | <1%
packages/babel-preset-react-app55% | 28% | 0% | 0% | 16%
packages/babel-plugin-named-asset-import0% | 0% | 62% | 20% | 17%
packages/react-scripts0% | 0% | 58% | 0% | 41%
Alternative Visuals
Longest Units
Top 41 longest units
Unit# linesMcCabe index# params
167 6 0
128 12 8
124 18 3
84 15 6
65 11 2
63 6 2
60 6 0
54 6 1
52 8 6
45 10 2
34 5 1
32 12 2
30 3 2
27 4 0
27 5 1
25 3 2
25 2 2
21 4 1
19 3 0
18 2 4
17 3 2
16 4 3
16 3 1
13 2 2
13 2 0
13 4 0
10 2 2
9 2 1
7 1 1
7 2 3
6 1 0
6 2 1
5 1 1
5 1 1
4 1 0
4 2 2
4 1 1
3 1 2
3 1 2
3 1 2
3 2 0