facebookresearch / multiset-compression
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 36 units with 500 lines of code in units (69.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (64 lines of code)
    • 5 medium size units (128 lines of code)
    • 14 small units (212 lines of code)
    • 16 very small units (96 lines of code)
0% | 12% | 25% | 42% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 12% | 25% | 42% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
experiments0% | 38% | 38% | 22% | 0%
multiset_codec0% | 0% | 21% | 57% | 20%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run_single_experiment()
in experiments/jsonmaps.py
64 29 2
def run_single_experiment()
in experiments/toy_multisets.py
35 4 3
def run_single_experiment()
in experiments/mnist_lossy.py
29 7 2
def SamplingWithoutReplacement()
in multiset_codec/codecs.py
22 1 0
def Multiset()
in multiset_codec/codecs.py
21 3 1
def ByteArray()
in multiset_codec/codecs.py
21 1 1
def substack()
in multiset_codec/codecs.py
20 1 2
def VariableLengthSequence()
in multiset_codec/codecs.py
18 1 2
def reverse_lookup()
in multiset_codec/msbst.py
18 6 2
def Sequence()
in multiset_codec/codecs.py
16 3 1
def forward_lookup()
in multiset_codec/msbst.py
16 6 2
def reverse_lookup_then_remove()
in multiset_codec/msbst.py
16 6 2
def stack_slice()
in multiset_codec/rans.py
16 4 2
def decode()
in multiset_codec/rans.py
16 2 2
def run_all_experiments()
in experiments/toy_multisets.py
14 4 1
def Uniform()
in multiset_codec/codecs.py
13 1 1
def insert_then_forward_lookup()
in multiset_codec/msbst.py
13 6 2
def run_all_experiments()
in experiments/jsonmaps.py
13 2 1
def to_sequence()
in multiset_codec/msbst.py
12 4 1
def run_all_experiments()
in experiments/mnist_lossy.py
11 2 1