facebookresearch / Kats
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 996 units with 8,329 lines of code in units (42.2% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (375 lines of code)
    • 82 medium size units (2,457 lines of code)
    • 145 small units (2,094 lines of code)
    • 763 very small units (3,403 lines of code)
0% | 4% | 29% | 25% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 4% | 29% | 25% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
kats/models0% | 6% | 33% | 24% | 35%
kats/detectors0% | 4% | 25% | 25% | 44%
kats/utils0% | 0% | 35% | 21% | 42%
kats0% | 0% | 21% | 34% | 43%
kats/tsfeatures0% | 0% | 0% | 40% | 59%
kats/evaluation0% | 0% | 0% | 0% | 100%
kats/data0% | 0% | 0% | 0% | 100%
kats/graphics0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def fit()
in kats/models/prophet.py
77 12 2
def detector()
in kats/detectors/cusum_detection.py
75 16 2
def run_backtest()
in kats/models/globalmodel/backtester.py
61 9 1
def forward()
in kats/models/globalmodel/utils.py
58 10 2
def feature_extraction()
in kats/models/nowcasting/dynamic_nowcasting.py
53 10 1
def pred_prob()
in kats/detectors/bocpd.py
51 8 3
def get_default_prophet_parameter_search_space()
in kats/utils/parameter_tuning_utils.py
48 1 0
def fit()
in kats/models/bayesian_var.py
48 3 1
def save_model()
in kats/models/globalmodel/ensemble.py
48 11 2
def _find_posterior()
in kats/detectors/bocpd.py
47 12 3
def detector_()
in kats/detectors/cusum_detection.py
45 10 2
def aggregate()
in kats/models/ensemble/kats_ensemble.py
44 9 1
def predict()
in kats/models/lstm.py
44 4 4
def get_default_sarima_parameter_search_space()
in kats/utils/parameter_tuning_utils.py
43 2 0
def forward()
in kats/models/globalmodel/utils.py
43 6 3
def predict()
in kats/models/quadratic_model.py
42 4 4
def feature_extraction()
in kats/models/nowcasting/nowcastingplus.py
41 7 1
def _perform_op()
in kats/consts.py
41 15 3
def __init__()
in kats/detectors/bocpd.py
40 16 3
def fit()
in kats/models/ensemble/kats_ensemble.py
39 9 2