facebookresearch / protein-ebm
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 98 units with 2,443 lines of code in units (78.5% of code).
    • 5 very long units (806 lines of code)
    • 6 long units (415 lines of code)
    • 19 medium size units (606 lines of code)
    • 28 small units (392 lines of code)
    • 40 very small units (224 lines of code)
32% | 16% | 24% | 16% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py32% | 16% | 24% | 16% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT35% | 18% | 22% | 15% | 9%
scripts0% | 0% | 67% | 24% | 8%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
196 35 3
def rotamer_trials()
in vis_sandbox.py
175 29 3
157 25 2
def add_args()
in train.py
153 1 1
def main_single()
in vis_sandbox.py
125 36 1
def test()
in train.py
82 15 5
def new_model()
in vis_sandbox.py
79 15 3
def pair_model()
in vis_sandbox.py
76 7 3
def _preprocess_db()
in mmcif_utils.py
72 19 2
def add_args()
in vis_sandbox.py
54 1 1
def make_tsne()
in vis_sandbox.py
52 9 3
50 2 0
def create_parser()
in scripts/extract_saliency.py
46 1 0
def propagate()
in torch_geometric_utils.py
44 18 4
def parse_dense_format()
in mmcif_utils.py
43 11 1
37 5 6
34 11 1
def cif_to_embed()
in mmcif_utils.py
33 13 3
def _parse_residue()
in mmcif_utils.py
33 8 1
def rotate_dihedral()
in mmcif_utils.py
31 2 7