facebookresearch / KILT
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 163 units with 2,775 lines of code in units (70.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 14 medium complex units (876 lines of code)
    • 22 simple units (679 lines of code)
    • 127 very simple units (1,220 lines of code)
0% | 0% | 31% | 24% | 43%
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% | 0% | 31% | 24% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
kilt/datasets0% | 0% | 63% | 3% | 33%
kilt0% | 0% | 28% | 34% | 37%
scripts0% | 0% | 47% | 0% | 52%
kilt/readers/t50% | 0% | 6% | 39% | 53%
kilt/retrievers0% | 0% | <1% | 31% | 67%
kilt/readers/fid0% | 0% | 0% | 100% | 0%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_rank()
in kilt/eval_retrieval.py
57 24 5
def process_chunk()
in kilt/datasets/natural_questions.py
140 21 4
def get_chunks()
in kilt/datasets/fact_verification.py
64 21 2
def run_thread()
in scripts/create_kilt_data_paragraphs.py
52 21 1
def validate_datapoint()
in kilt/kilt_utils.py
45 19 2
def process_chunk()
in kilt/datasets/hotpotqa.py
105 18 4
def get_ranking_metrics()
in kilt/eval_retrieval.py
37 14 4
def compute()
in kilt/eval_retrieval.py
52 14 4
def encode_seq()
in kilt/readers/t5/data.py
44 14 9
def run()
in kilt/retrievers/base_retriever.py
2 13 1
def process_chunk()
in kilt/datasets/fact_verification.py
79 13 4
def process_chunk()
in kilt/datasets/entity_linking.py
66 13 4
def process_chunk()
in kilt/datasets/triviaqa.py
76 12 4
def main()
in scripts/execute_retrieval.py
57 12 1
def load_ks()
in kilt/datasets/hotpotqa_ks.py
31 10 2
def run()
in kilt/retrievers/BLINK_connector.py
47 9 1
def _answer_and_ent_in_context_at_k()
in kilt/eval_retrieval.py
20 9 3
def _get_ids_list()
in kilt/eval_retrieval.py
25 8 3
def _calculate_metrics()
in kilt/eval_downstream.py
75 8 2
def generic_train()
in kilt/readers/t5/base_transformer.py
41 8 2