facebookresearch / alma
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 317 units with 3,531 lines of code in units (77.8% of code).
    • 4 very long units (446 lines of code)
    • 11 long units (800 lines of code)
    • 19 medium size units (595 lines of code)
    • 53 small units (743 lines of code)
    • 230 very small units (947 lines of code)
12% | 22% | 16% | 21% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 22% | 16% | 21% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
crlapi/sl/clmodels28% | 34% | 7% | 11% | 17%
crlapi/sl/architectures/firefly_vgg/sp0% | 34% | 32% | 16% | 16%
crlapi/sl/architectures0% | 0% | 23% | 42% | 34%
crlapi0% | 0% | 15% | 41% | 42%
crlapi/sl/architectures/firefly_vgg0% | 0% | 77% | 0% | 22%
crlapi/sl/streams0% | 0% | 0% | 20% | 79%
configs/mnist0% | 0% | 0% | 0% | 100%
configs/cifar100% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def update()
in crlapi/sl/clmodels/boosting.py
140 30 3
def update()
in crlapi/sl/clmodels/adaboost.py
103 16 3
def update()
in crlapi/sl/clmodels/k_ensemble.py
102 28 3
def update()
in crlapi/sl/clmodels/bagging.py
101 27 3
def split()
in crlapi/sl/architectures/firefly_vgg/sp/net.py
86 33 4
def split()
in crlapi/sl/clmodels/firefly.py
82 40 6
def update()
in crlapi/sl/clmodels/debug_ensemble.py
82 17 3
def update()
in crlapi/sl/clmodels/ensemble.py
81 16 3
def update()
in crlapi/sl/clmodels/finetune.py
75 14 3
def update()
in crlapi/sl/clmodels/agg_ensemble.py
74 21 3
def update()
in crlapi/sl/clmodels/finetune_grow.py
71 14 3
def update()
in crlapi/sl/clmodels/firefly.py
69 15 3
def spffn_forward()
in crlapi/sl/architectures/firefly_vgg/sp/conv.py
62 19 3
def spffn_active_grow()
in crlapi/sl/architectures/firefly_vgg/sp/conv.py
59 11 2
def spffn_passive_grow()
in crlapi/sl/architectures/firefly_vgg/sp/conv.py
59 16 3
def __init__()
in crlapi/sl/architectures/firefly_vgg/sp/conv.py
43 5 12
def spffn()
in crlapi/sl/clmodels/firefly.py
38 13 4
def read_log()
in crlapi/logger.py
38 13 3
def random_split()
in crlapi/sl/architectures/firefly_vgg/sp/conv.py
37 6 2
def grow()
in crlapi/sl/architectures/sp_vgg.py
36 6 3