facebookresearch / covid19_spread
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 160 units with 2,213 lines of code in units (68.7% of code).
    • 2 very long units (233 lines of code)
    • 10 long units (677 lines of code)
    • 13 medium size units (408 lines of code)
    • 29 small units (410 lines of code)
    • 106 very small units (485 lines of code)
10% | 30% | 18% | 18% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py10% | 30% | 18% | 18% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
covid19_spread/data/usa/google69% | 28% | 0% | 0% | 1%
ROOT23% | 29% | 9% | 22% | 15%
covid19_spread0% | 29% | 17% | 21% | 30%
covid19_spread/data/usa0% | 31% | 29% | 17% | 21%
covid19_spread/data/usa/fb0% | 97% | 0% | 0% | 2%
covid19_spread/lib0% | 19% | 15% | 28% | 35%
covid19_spread/data/usa/testing0% | 97% | 0% | 0% | 2%
covid19_spread/data/usa/symptom_survey0% | 0% | 89% | 10% | 0%
covid19_spread/data0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in covid19_spread/data/usa/google/process_open_data.py
130 12 0
103 15 6
def main()
in covid19_spread/data/usa/convert.py
81 14 4
def initialize()
in covid19_spread/bar.py
80 8 2
def main()
in covid19_spread/data/usa/fb/process_mobility.py
74 8 0
def train()
in covid19_spread/bar.py
71 6 6
def __call__()
in covid19_spread/lib/slurm_pool_executor.py
68 10 1
def main()
in covid19_spread/data/usa/testing/process_testing.py
67 6 0
64 13 6
61 7 5
def _compute_metrics()
in covid19_spread/metrics.py
58 5 4
def main()
in covid19_spread/data/usa/google/process_mobility.py
53 10 0
def main()
in covid19_spread/data/usa/symptom_survey/fetch.py
43 4 3
41 7 5
def model_selection()
in covid19_spread/cross_val.py
40 11 4
def process_time_features()
in covid19_spread/data/usa/convert.py
40 10 5
def score()
in covid19_spread/bar.py
38 7 3
def get_nyt()
in covid19_spread/data/usa/process_cases.py
35 6 1
def __init__()
in covid19_spread/lib/slurm_pool_executor.py
30 3 3
def add_to_parser()
in covid19_spread/lib/click_lib.py
25 10 3