awslabs / gap-text2sql
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 860 units with 11,601 lines of code in units (75.0% of code).
    • 13 very long units (1,760 lines of code)
    • 25 long units (1,649 lines of code)
    • 104 medium size units (3,044 lines of code)
    • 156 small units (2,310 lines of code)
    • 562 very small units (2,838 lines of code)
15% | 14% | 26% | 19% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py15% | 14% | 26% | 19% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
rat-sql-gap/seq2struct/models20% | 16% | 25% | 19% | 17%
relogic/pretrainkit/models20% | 2% | 26% | 20% | 29%
relogic/pretrainkit34% | 0% | 8% | 29% | 27%
relogic/pretrainkit/datasets14% | 22% | 45% | 6% | 10%
relogic34% | 55% | 0% | 0% | 10%
rat-sql-gap/seq2struct/grammars0% | 40% | 30% | 7% | 21%
rat-sql-gap/seq2struct/datasets0% | 13% | 33% | 29% | 23%
rat-sql-gap/seq2struct/commands0% | 19% | 26% | 38% | 15%
rat-sql-gap/seq2struct0% | 17% | 33% | 14% | 34%
rat-sql-gap0% | 85% | 0% | 0% | 15%
rat-sql-gap/seq2struct/utils0% | 0% | 18% | 27% | 53%
relogic/pretrainkit/scorers0% | 0% | 61% | 0% | 38%
relogic/logickit/utils0% | 0% | 15% | 18% | 65%
relogic/logickit/modules0% | 0% | 92% | 0% | 7%
rat-sql-gap/seq2struct/resources0% | 0% | 0% | 12% | 87%
relogic/logickit/base0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def forward()
in relogic/pretrainkit/models/semparse/logical_tabart.py
189 18 3
def train()
in relogic/pretrainkit/multitask_trainer.py
151 63 2
def train()
in relogic/pretrainkit/trainer.py
150 55 2
def __init__()
in rat-sql-gap/seq2struct/models/spider/spider_enc_modules.py
143 16 25
def __init__()
in relogic/pretrainkit/models/relationalsemparse/relational_transformer.py
142 20 24
def beam_search_with_heuristics()
in rat-sql-gap/seq2struct/models/spider/spider_beam_search.py
137 41 6
def forward()
in rat-sql-gap/seq2struct/models/spider/spider_enc.py
133 37 2
def __init__()
in rat-sql-gap/seq2struct/models/nl2code/decoder.py
131 16 16
def forward()
in rat-sql-gap/seq2struct/models/spider/spider_enc.py
128 36 2
def __init__()
in relogic/pretrainkit/datasets/semparse/rat_text2sql.py
118 26 5
def compute_relations()
in rat-sql-gap/seq2struct/models/spider/spider_enc_modules.py
114 51 7
def compute_relations()
in relogic/pretrainkit/models/relationalsemparse/relational_transformer.py
114 51 7
def main()
in relogic/logical-tabart-pretraining.py
110 33 0
def beam_search_with_oracle_sketch()
in rat-sql-gap/seq2struct/models/spider/spider_beam_search.py
98 16 6
def main()
in relogic/entity-to-text-train.py
89 33 0
def main()
in relogic/sql-to-text-train.py
89 33 0
def compute_mle_loss()
in rat-sql-gap/seq2struct/models/nl2code/decoder.py
86 21 5
def parse_sql()
in rat-sql-gap/seq2struct/grammars/spider.py
81 15 3
def train()
in rat-sql-gap/seq2struct/commands/train.py
76 4 3
def beam_search_with_oracle_column()
in rat-sql-gap/seq2struct/models/spider/spider_beam_search.py
71 23 6