amazon-research / sentence-representations
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 162 units with 2,151 lines of code in units (84.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (138 lines of code)
    • 31 medium size units (1,002 lines of code)
    • 36 small units (531 lines of code)
    • 93 very small units (480 lines of code)
0% | 6% | 46% | 24% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 6% | 46% | 24% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
DownstreamEval/SentEval/senteval0% | 8% | 50% | 22% | 17%
PairSupCon0% | 0% | 67% | 18% | 14%
DownstreamEval/stseval0% | 0% | 100% | 0% | 0%
PairSupCon/utils0% | 0% | 31% | 40% | 28%
PairSupCon/models0% | 0% | 47% | 26% | 26%
DownstreamEval/clustering0% | 0% | 11% | 30% | 58%
DownstreamEval/configs0% | 0% | 0% | 66% | 33%
DownstreamEval0% | 0% | 0% | 100% | 0%
PairSupCon/dataloader0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run()
in DownstreamEval/SentEval/senteval/tools/ranking.py
73 9 1
def eval()
in DownstreamEval/SentEval/senteval/engine.py
65 31 2
def run()
in DownstreamEval/SentEval/senteval/sick.py
50 9 3
def run()
in DownstreamEval/SentEval/senteval/sts.py
48 9 3
def run()
in DownstreamEval/SentEval/senteval/tools/validation.py
46 9 1
def run()
in DownstreamEval/SentEval/senteval/sick.py
44 7 3
def run()
in DownstreamEval/SentEval/senteval/tools/validation.py
44 9 1
def run()
in DownstreamEval/SentEval/senteval/mrpc.py
41 7 3
def run()
in DownstreamEval/SentEval/senteval/tools/validation.py
40 12 1
def trainepoch()
in DownstreamEval/SentEval/senteval/tools/ranking.py
39 7 6
def run()
in DownstreamEval/SentEval/senteval/snli.py
39 9 3
def get_optimizer()
in DownstreamEval/SentEval/senteval/utils.py
37 13 1
def run()
in DownstreamEval/SentEval/senteval/probing.py
36 5 3
def run()
in DownstreamEval/SentEval/senteval/trec.py
36 7 3
def run()
in DownstreamEval/SentEval/senteval/rank.py
34 3 3
def run()
in DownstreamEval/SentEval/senteval/sst.py
33 3 3
def get_args()
in PairSupCon/main.py
32 1 1
def i2t()
in DownstreamEval/SentEval/senteval/tools/ranking.py
31 6 3
def __init__()
in DownstreamEval/SentEval/senteval/snli.py
29 1 3
def eval_stsdev()
in PairSupCon/training.py
29 2 1