facebookresearch / eft
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 594 units with 19,230 lines of code in units (87.2% of code).
    • 41 very long units (8,863 lines of code)
    • 42 long units (2,916 lines of code)
    • 122 medium size units (4,133 lines of code)
    • 131 small units (1,931 lines of code)
    • 258 very small units (1,387 lines of code)
46% | 15% | 21% | 10% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py46% | 15% | 21% | 10% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
eft/datasets93% | 0% | 0% | 4% | 2%
eft/apps93% | 2% | 2% | <1% | <1%
eft/train67% | 7% | 8% | 9% | 6%
eft/db_processing39% | 33% | 24% | 2% | <1%
bodymocap/train67% | 12% | 7% | 7% | 4%
bodymocap/apps89% | 0% | 6% | 1% | 3%
bodymocap/models59% | 6% | 20% | 7% | 5%
eft/smplify27% | 25% | 5% | 34% | 7%
renderer0% | 23% | 52% | 12% | 10%
eft/utils0% | 10% | 32% | 30% | 26%
bodymocap/utils0% | 8% | 34% | 28% | 28%
eft/cores0% | 53% | 0% | 15% | 30%
bodymocap/core0% | 52% | 0% | 16% | 31%
eft/models0% | 0% | 47% | 42% | 9%
bodymocap0% | 0% | 69% | 30% | 0%
renderer/shaders0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in eft/datasets/mixed_dataset.py
1083 517 3
def run_evaluation()
in eft/apps/evalfrompkl_frankmocap.py
344 75 10
def run_evaluation()
in eft/apps/evalfrompkl.py
335 74 10
def run_evaluation()
in eft/apps/evalfrompkl_hmr.py
329 74 10
def __init__()
in eft/datasets/base_dataset.py
317 88 8
def RenderFitting()
in eft/db_processing/AMT_sample_gen.py
300 52 5
def run_evaluation()
in bodymocap/apps/evalfrompkl.py
297 73 10
def run_evaluation()
in eft/apps/eval_export.py
257 66 10
def run_evaluation()
in eft/apps/eval.py
252 75 10
def run_evaluation()
in eft/apps/eval_multicrop.py
238 68 10
def run_evaluation()
in bodymocap/apps/eval.py
234 68 10
def __init__()
in eft/datasets/video_dataset.py
233 55 8
def eftAllInDB()
in bodymocap/train/eftFitter.py
221 135 4
def eftAllInDB()
in eft/train/eftFitter.py
217 139 5
def train_step()
in bodymocap/train/trainer.py
214 30 2
def train_step()
in eft/train/ddp_trainer.py
214 30 2
def train_step()
in eft/train/trainer.py
214 30 2
def RenderFitting_allSamples()
in eft/db_processing/AMT_sample_gen.py
187 29 4
def RenderFitting_allSamples_panoptic()
in eft/db_processing/AMT_sample_gen.py
182 29 4
def run_eft_step_with_2dhand()
in eft/train/eftFitter.py
173 24 3