facebookresearch / OctConv
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 118 units with 1,832 lines of code in units (87.9% of code).
    • 1 very long units (265 lines of code)
    • 6 long units (433 lines of code)
    • 11 medium size units (402 lines of code)
    • 20 small units (296 lines of code)
    • 80 very small units (436 lines of code)
14% | 23% | 21% | 16% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py14% | 23% | 21% | 16% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
gluon51% | 35% | 7% | 3% | 1%
gluon/utils0% | 20% | 28% | 22% | 28%
symbol0% | 16% | 24% | 17% | 41%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in utils/gluon/train_imagenet.py
265 57 0
def main()
in utils/gluon/score.py
97 15 0
def parse_args()
in utils/gluon/train_imagenet.py
86 1 0
def __init__()
in utils/gluon/utils/resnetv1.py
69 14 9
def get_before_pool()
in utils/symbol/symbol_resnetv2.py
63 20 6
def __init__()
in utils/gluon/utils/octconv.py
61 43 5
def __init__()
in utils/gluon/utils/resnetv2.py
57 10 9
def __init__()
in utils/gluon/utils/densenet.py
47 8 10
def __init__()
in utils/gluon/utils/resnetv1.py
46 16 14
def __init__()
in utils/gluon/utils/mobilenetv2.py
45 11 9
def score()
in utils/symbol/score.py
42 9 10
def parse_args()
in utils/gluon/score.py
40 1 0
def __init__()
in utils/gluon/utils/resnetv2.py
37 11 12
def __init__()
in utils/gluon/utils/mobilenetv1.py
35 8 8
def __init__()
in utils/gluon/utils/resnetv1.py
33 8 11
def get_before_pool()
in utils/symbol/symbol_densenet.py
29 9 3
def __init__()
in utils/gluon/utils/mobilenetv2.py
24 9 9
def Convolution()
in utils/symbol/symbol_octconv.py
24 25 5
def main()
in utils/gluon/plot_network.py
19 3 0
def __init__()
in utils/gluon/utils/densenet.py
18 5 6