facebook / IT-CPE
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 518 units with 5,343 lines of code in units (40.6% of code).
    • 2 very long units (290 lines of code)
    • 6 long units (394 lines of code)
    • 49 medium size units (1,323 lines of code)
    • 120 small units (1,765 lines of code)
    • 341 very small units (1,571 lines of code)
5% | 7% | 24% | 33% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 0% | 22% | 43% | 21%
rb0% | 12% | 26% | 25% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
legacy/autodmg_cache_builder33% | 0% | 30% | 23% | 12%
pantri/scripts73% | 0% | 0% | 17% | 8%
itchef/cookbooks/cpe_applocker0% | 46% | 25% | 19% | 8%
itchef/cookbooks/cpe_chrome0% | 29% | 31% | 24% | 14%
itchef/cookbooks/cpe_nomad0% | 52% | 0% | 37% | 9%
itchef/cookbooks/fb_helpers0% | 4% | 21% | 19% | 54%
pantri/scripts/lib0% | 0% | 26% | 50% | 22%
itchef/cookbooks/cpe_helpers0% | 0% | 45% | 27% | 26%
legacy/adobe_tools0% | 0% | 20% | 47% | 31%
itchef/cookbooks/cpe_logger0% | 0% | 94% | 0% | 5%
legacy/autopkg_tools0% | 0% | 10% | 64% | 25%
itchef/cookbooks/cpe_launchd0% | 0% | 28% | 45% | 25%
itchef/cookbooks/cpe_munki0% | 0% | 19% | 71% | 8%
itchef/cookbooks/fb_launchd0% | 0% | 77% | 0% | 22%
itchef/cookbooks/cpe_remote0% | 0% | 0% | 36% | 63%
itchef/cookbooks/cpe_windows_update_for_business0% | 0% | 0% | 43% | 56%
itchef/cookbooks/cpe_profiles_local0% | 0% | 0% | 34% | 65%
itchef/cookbooks/cpe_profiles0% | 0% | 0% | 48% | 51%
itchef/cookbooks/cpe_gnome_software0% | 0% | 0% | 60% | 39%
itchef/cookbooks/cpe_hosts0% | 0% | 0% | 100% | 0%
itchef/cookbooks/cpe_flatpak0% | 0% | 0% | 0% | 100%
itchef/cookbooks/cpe_deprecation_notifier0% | 0% | 0% | 0% | 100%
itchef/cookbooks/cpe_symlinks0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
175 15 0
115 12 1
76 4 2
73 1 1
70 6 0
64 10 1
57 3 1
54 9 2
44 15 2
43 13 1
39 2 2
38 6 0
36 5 1
35 6 1
35 7 0
32 4 5
32 7 2
32 10 3
32 8 3
30 8 2
29 8 3
29 6 3
29 3 2
28 3 0
28 4 0
28 2 1
27 6 2
27 8 0
27 9 0
27 5 1
26 4 2
26 7 1
25 6 1
25 8 0
24 1 0
24 6 0
24 6 0
24 11 2
23 7 1
23 7 3
23 1 2
23 6 0
23 7 0
23 1 0
23 8 4
22 2 1
22 4 1
22 7 0
22 4 0
22 5 2