facebookresearch / TaBERT
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 293 units with 4,299 lines of code in units (75.3% of code).
    • 5 very long units (594 lines of code)
    • 14 long units (892 lines of code)
    • 40 medium size units (1,246 lines of code)
    • 48 small units (684 lines of code)
    • 186 very small units (883 lines of code)
13% | 20% | 28% | 15% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py13% | 20% | 28% | 16% | 20%
java0% | 0% | 91% | 0% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
preprocess12% | 17% | 33% | 16% | 20%
table_bert/vertical39% | 0% | 21% | 21% | 17%
ROOT64% | 35% | 0% | 0% | 0%
utils0% | 46% | 24% | 13% | 15%
table_bert0% | 21% | 29% | 18% | 31%
contrib/wiki_extractor/src/main/java0% | 0% | 91% | 0% | 8%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in preprocess/WikiExtractor.py
147 24 0
def main()
in train.py
127 29 0
def create_pretraining_instance()
in table_bert/vertical/input_formatter.py
113 24 4
def compact()
in preprocess/WikiExtractor.py
105 36 1
def collate()
in table_bert/vertical/dataset.py
102 30 3
def process_dump()
in preprocess/WikiExtractor.py
98 29 6
def extract()
in preprocess/extract_wiki_data.py
74 38 5
72 17 1
def get_row_input()
in table_bert/input_formatter.py
71 32 5
69 2 0
def generate_for_epoch()
in utils/generate_vertical_tabert_training_data.py
65 9 5
def findMatchingBraces()
in preprocess/WikiExtractor.py
63 33 2
def pages_from()
in preprocess/WikiExtractor.py
60 26 1
def generate_for_epoch()
in utils/generate_vanilla_tabert_training_data.py
58 8 5
def from_dict()
in table_bert/dataset.py
56 22 4
def main()
in utils/generate_vanilla_tabert_training_data.py
52 9 0
def main()
in utils/generate_vertical_tabert_training_data.py
52 9 0
def main()
in preprocess/htmltable.py
51 8 0
def __example_worker_process_zmq()
in table_bert/dataset.py
51 13 2
def extract()
in preprocess/WikiExtractor.py
50 8 2