microsoft / human-pose-estimation.pytorch
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 91 units with 1,788 lines of code in units (52.7% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (421 lines of code)
    • 25 medium size units (783 lines of code)
    • 27 small units (415 lines of code)
    • 33 very small units (169 lines of code)
0% | 23% | 43% | 23% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 24% | 42% | 23% | 9%
pyx0% | 0% | 72% | 27% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/dataset0% | 33% | 49% | 9% | 8%
pose_estimation0% | 43% | 36% | 16% | 3%
lib/core0% | 25% | 34% | 31% | 8%
lib/utils0% | 19% | 55% | 10% | 14%
lib/models0% | 0% | 41% | 48% | 10%
lib/nms0% | 0% | 39% | 47% | 12%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in pose_estimation/train.py
100 6 0
def validate()
in lib/core/function.py
87 13 8
def evaluate()
in lib/dataset/mpii.py
70 4 6
def __getitem__()
in lib/dataset/JointsDataset.py
58 13 2
def evaluate()
in lib/dataset/coco.py
53 14 8
def save_batch_heatmaps()
in lib/utils/vis.py
53 4 4
47 10 2
def main()
in pose_estimation/valid.py
47 4 0
pyx
def cpu_nms()
in lib/nms/cpu_nms.pyx
43 8 3
def train()
in lib/core/function.py
42 5 9
def init_weights()
in lib/models/pose_resnet.py
42 13 2
def generate_target()
in lib/dataset/JointsDataset.py
40 8 3
def _get_db()
in lib/dataset/mpii.py
38 5 1
def parse_args()
in pose_estimation/valid.py
38 1 0
35 5 1
def __init__()
in lib/dataset/coco.py
34 5 6
30 6 6
def get_affine_transform()
in lib/utils/transforms.py
29 4 7
def accuracy()
in lib/core/evaluate.py
28 6 4
def create_logger()
in lib/utils/utils.py
28 3 3