facebookresearch / quip
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 41 units with 1,037 lines of code in units (81.4% of code).
    • 1 very complex units (244 lines of code)
    • 1 complex units (115 lines of code)
    • 3 medium complex units (116 lines of code)
    • 10 simple units (243 lines of code)
    • 26 very simple units (319 lines of code)
23% | 11% | 11% | 23% | 30%
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
py23% | 11% | 11% | 23% | 30%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/hf82% | 0% | 0% | 12% | 4%
src0% | 16% | 16% | 25% | 42%
scripts0% | 0% | 0% | 100% | 0%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in src/hf/run_ner.py
244 82 0
def main()
in src/run_sentiment.py
115 34 1
def run_prediction()
in src/biencoder_predict_qa.py
73 16 4
11 15 2
def read_data()
in src/run_paraphrase.py
32 13 4
def main()
in scripts/regenerate_paws_kshot.py
28 9 0
def read_data()
in src/run_sentiment.py
29 9 3
25 8 2
def load_few_shot_file()
in src/hf/run_ner.py
25 8 3
def read_mrqa_all()
in src/biencoder_predict_qa.py
34 8 2
def __post_init__()
in src/hf/run_ner.py
11 6 1
def compute_similarity()
in src/run_paraphrase.py
17 6 3
def featurize_dataset()
in src/run_paraphrase.py
21 6 3
def collater()
in src/run_paraphrase.py
8 6 1
def main()
in src/run_paraphrase.py
45 6 1
def forward()
in src/run_paraphrase.py
23 5 5
def read_squad()
in src/biencoder_predict_qa.py
16 5 3
def main()
in src/biencoder_predict_qa.py
34 5 0
def make_batches()
in src/util.py
9 4 2
def prune_features()
in src/run_paraphrase.py
3 4 1