amazon-research / unified-ept
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 205 units with 2,308 lines of code in units (50.9% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (324 lines of code)
    • 23 medium size units (639 lines of code)
    • 42 small units (632 lines of code)
    • 135 very small units (713 lines of code)
0% | 14% | 27% | 27% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 14% | 27% | 27% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 66% | 23% | 0% | 9%
models0% | 7% | 29% | 33% | 28%
modified_mmseg/apis0% | 89% | 0% | 0% | 10%
modified_mmseg/datasets0% | 14% | 51% | 16% | 17%
modified_mmseg/datasets/pipelines0% | 0% | 13% | 33% | 52%
models/ops/modules0% | 0% | 40% | 53% | 6%
models/ops/functions0% | 0% | 0% | 55% | 44%
modified_mmseg0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in models/UN_EPT.py
70 7 12
def main()
in train.py
68 19 0
def train_segmentor()
in modified_mmseg/apis/train.py
65 11 7
def evaluate()
in modified_mmseg/datasets/custom.py
61 15 6
def main()
in test.py
60 20 0
def build_dataloader()
in modified_mmseg/datasets/builder.py
44 5 11
def __init__()
in modified_mmseg/datasets/custom.py
40 10 14
def slide_inference()
in models/base.py
38 5 4
def __call__()
in modified_mmseg/datasets/pipelines/loading.py
36 8 2
def losses()
in models/UN_EPT.py
35 1 7
def deit_base_distilled_patch16_384()
in models/vision_transformer.py
33 5 8
def _evaluate_cityscapes()
in modified_mmseg/datasets/cityscapes.py
32 6 4
def _concat_dataset()
in modified_mmseg/datasets/builder.py
31 14 2
def __init__()
in models/vision_transformer.py
27 6 18
def __call__()
in modified_mmseg/datasets/pipelines/loading.py
26 6 2
def forward()
in models/ops/modules/ms_deform_attn.py
25 4 7
def __init__()
in models/vision_transformer.py
25 4 6
25 2 0
def load_annotations()
in modified_mmseg/datasets/custom.py
24 7 7
def encode_decode()
in models/UN_EPT.py
23 3 2