facebookresearch / decodable_information_bottleneck
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 469 units with 4,541 lines of code in units (52.4% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (250 lines of code)
    • 50 medium size units (1,466 lines of code)
    • 90 small units (1,269 lines of code)
    • 325 very small units (1,556 lines of code)
0% | 5% | 32% | 27% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 5% | 32% | 27% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 18% | 36% | 24% | 19%
utils0% | 7% | 25% | 26% | 40%
dib/utils0% | 0% | 30% | 28% | 41%
dib/transformers0% | 0% | 44% | 25% | 30%
dib/predefined0% | 0% | 35% | 39% | 25%
utils/visualize0% | 0% | 73% | 9% | 16%
utils/data0% | 0% | 16% | 34% | 48%
dib/training0% | 0% | 13% | 30% | 55%
dib/classifiers0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
85 31 1
58 6 3
def eval_corr_gen()
in utils/evaluate.py
54 1 3
53 8 2
def apply()
in dib/utils/pruning.py
50 14 5
48 18 2
def tensorboard()
in dib/predefined/mlp.py
46 6 4
def forward()
in dib/transformers/ib/dib.py
44 14 3
43 5 2
def compute_mask()
in dib/utils/pruning.py
41 11 3
41 6 3
def get_img_encoder()
in dib/transformers/img.py
40 10 1
def get_sequential_colors()
in utils/visualize/visualize_clf.py
39 2 1
39 5 6
def main()
in main.py
37 4 1
def apply_convs()
in dib/predefined/cnn.py
36 7 2
def get_callbakcs()
in utils/train.py
36 15 12
def get_rows_cols_agg()
in utils/evaluate.py
35 11 2
32 6 3
def add_hyperparam()
in add_hyperparam.py
31 5 1