facebookresearch / em-pose
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 172 units with 2,303 lines of code in units (90.6% of code).
    • 2 very long units (260 lines of code)
    • 5 long units (297 lines of code)
    • 22 medium size units (617 lines of code)
    • 42 small units (625 lines of code)
    • 101 very small units (504 lines of code)
11% | 12% | 26% | 27% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 12% | 26% | 27% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts41% | 44% | 0% | 4% | 9%
empose/nn17% | 0% | 28% | 33% | 20%
empose/helpers0% | 41% | 7% | 31% | 19%
empose/data0% | 0% | 39% | 27% | 33%
empose/eval0% | 0% | 50% | 33% | 15%
empose/bodymodels0% | 0% | 26% | 37% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in scripts/train.py
149 27 1
def forward()
in empose/nn/models.py
111 17 4
def __init__()
in empose/helpers/configuration.py
82 8 1
def main()
in scripts/evaluate_real.py
56 18 1
def convert_3dpw_to_lmdb()
in scripts/preprocess_amass_3dpw.py
54 13 2
def parse_cmd()
in empose/helpers/configuration.py
53 1 0
def convert_amass_to_lmdb()
in scripts/preprocess_amass_3dpw.py
52 9 2
def __call__()
in empose/data/transforms.py
47 11 2
def backward()
in empose/nn/models.py
43 7 5
def compute()
in empose/eval/metrics.py
34 5 9
def evaluate()
in empose/eval/helpers.py
33 10 5
def backward()
in empose/nn/models.py
32 6 5
def get_metrics()
in empose/eval/metrics.py
32 8 3
def backward()
in empose/nn/models.py
31 6 5
def __call__()
in empose/data/noise_functions.py
31 4 3
def _procrustes()
in empose/eval/metrics.py
30 2 3
def load_model_and_eval_data()
in empose/eval/helpers.py
29 4 3
def from_sample_list()
in empose/data/data.py
27 2 1
def __init__()
in empose/data/data.py
25 2 9
def create_model()
in empose/nn/models.py
24 4 1