facebookresearch / TaBERT
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 293 units with 4,299 lines of code in units (75.3% of code).
    • 0 very complex units (0 lines of code)
    • 9 complex units (750 lines of code)
    • 16 medium complex units (861 lines of code)
    • 40 simple units (1,012 lines of code)
    • 228 very simple units (1,676 lines of code)
0% | 17% | 20% | 23% | 38%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 17% | 20% | 23% | 38%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
preprocess0% | 22% | 18% | 25% | 34%
ROOT0% | 64% | 0% | 0% | 35%
table_bert/vertical0% | 18% | 37% | 0% | 43%
table_bert0% | 8% | 12% | 25% | 53%
utils0% | 0% | 28% | 44% | 27%
contrib/wiki_extractor/src/main/java0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def extract()
in preprocess/extract_wiki_data.py
74 38 5
def compact()
in preprocess/WikiExtractor.py
105 36 1
def expandTemplate()
in preprocess/WikiExtractor.py
50 33 2
def findMatchingBraces()
in preprocess/WikiExtractor.py
63 33 2
def get_row_input()
in table_bert/input_formatter.py
71 32 5
def collate()
in table_bert/vertical/dataset.py
102 30 3
def process_dump()
in preprocess/WikiExtractor.py
98 29 6
def main()
in train.py
127 29 0
def pages_from()
in preprocess/WikiExtractor.py
60 26 1
def main()
in preprocess/WikiExtractor.py
147 24 0
def create_pretraining_instance()
in table_bert/vertical/input_formatter.py
113 24 4
def from_dict()
in table_bert/dataset.py
56 22 4
def load_templates()
in preprocess/WikiExtractor.py
36 18 2
def sample_context()
in utils/generate_vertical_tabert_training_data.py
46 18 3
72 17 1
def train_step()
in utils/trainer.py
38 17 2
def clean()
in preprocess/WikiExtractor.py
38 15 2
def __example_worker_process_zmq()
in table_bert/dataset.py
51 13 2
def __init__()
in preprocess/htmltable.py
25 12 5
def dropNested()
in preprocess/WikiExtractor.py
42 12 3