facebookresearch / SentEval
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 97 units with 1,514 lines of code in units (79.0% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (132 lines of code)
    • 23 medium size units (789 lines of code)
    • 22 small units (331 lines of code)
    • 50 very small units (262 lines of code)
0% | 8% | 52% | 21% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 52% | 21% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
senteval/tools0% | 11% | 50% | 28% | 9%
senteval0% | 6% | 53% | 17% | 22%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run()
in senteval/tools/ranking.py
73 9 1
def eval()
in senteval/engine.py
59 28 2
def run()
in senteval/sick.py
50 9 3
def run()
in senteval/tools/validation.py
46 9 1
def run()
in senteval/tools/validation.py
44 9 1
def run()
in senteval/sick.py
44 7 3
def run()
in senteval/mrpc.py
41 7 3
def run()
in senteval/tools/validation.py
40 12 1
def trainepoch()
in senteval/tools/ranking.py
39 7 6
def run()
in senteval/snli.py
39 9 3
def run()
in senteval/sts.py
38 9 3
def get_optimizer()
in senteval/utils.py
37 13 1
def run()
in senteval/probing.py
36 5 3
def run()
in senteval/trec.py
36 7 3
def run()
in senteval/rank.py
34 3 3
def run()
in senteval/sst.py
33 3 3
def i2t()
in senteval/tools/ranking.py
31 6 3
def __init__()
in senteval/snli.py
29 1 3
def __init__()
in senteval/tools/classifier.py
27 9 8
def __init__()
in senteval/tools/relatedness.py
27 2 6