facebookresearch / Listen-to-Look
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 138 units with 2,223 lines of code in units (87.6% of code).
    • 3 very long units (514 lines of code)
    • 6 long units (513 lines of code)
    • 13 medium size units (417 lines of code)
    • 14 small units (214 lines of code)
    • 102 very small units (565 lines of code)
23% | 23% | 18% | 9% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py23% | 23% | 18% | 9% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
listen_to_look_single_modality53% | 31% | 7% | 0% | 7%
ROOT35% | 47% | 8% | 2% | 5%
models0% | 21% | 24% | 6% | 48%
utils0% | 0% | 33% | 24% | 42%
listen_to_look_single_modality/utils0% | 0% | 26% | 30% | 43%
listen_to_look_single_modality/models0% | 0% | 42% | 8% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_parameters()
in listen_to_look_single_modality/opts.py
208 2 1
202 1 1
def validate()
in listen_to_look_single_modality/validate.py
104 12 8
def train_epoch()
in listen_to_look_single_modality/train.py
98 14 11
93 14 11
def validate()
in validate.py
90 12 8
def main()
in main.py
90 13 1
def main()
in listen_to_look_single_modality/main.py
86 13 1
def forward()
in models/audioPreview_model.py
56 9 6
def forward()
in listen_to_look_single_modality/models/audioPreview_model.py
48 11 7
def main()
in validate.py
47 6 1
def main()
in listen_to_look_single_modality/validate.py
42 6 1
def __init__()
in models/audioPreview_model.py
38 1 4
def __init__()
in listen_to_look_single_modality/models/audioPreview_model.py
33 1 3
def align_and_update_state_dicts()
in listen_to_look_single_modality/utils/model_serialization.py
30 12 2
def process_list_tensors()
in listen_to_look_single_modality/utils/utils.py
30 12 4
def align_and_update_state_dicts()
in utils/model_serialization.py
30 12 2
29 12 4
def forwardOne()
in models/audioPreview_model.py
24 3 8
def load()
in listen_to_look_single_modality/utils/checkpointer.py
22 9 2