apple / ml-qrecc
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 30 units with 447 lines of code in units (64.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 7 simple units (206 lines of code)
    • 23 very simple units (241 lines of code)
0% | 0% | 0% | 46% | 53%
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% | 0% | 46% | 53%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
collection0% | 0% | 0% | 60% | 39%
utils0% | 0% | 0% | 18% | 81%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def process_wet_file()
in collection/download_commoncrawl_passages.py
33 9 4
def download_link()
in collection/download_wayback_passages.py
74 9 1
def process_cc_index()
in collection/download_commoncrawl_passages.py
23 7 1
def main()
in collection/download_commoncrawl_passages.py
27 7 2
def download_with_retry()
in collection/download_wayback_passages.py
21 7 2
def _normalize_tokens()
in utils/span_heuristic.py
9 6 2
def find_closest_span_match()
in utils/span_heuristic.py
19 6 2
def get_docs_from_wet_files()
in collection/download_commoncrawl_passages.py
25 5 2
def chunk_doc()
in collection/paragraph_chunker.py
17 5 1
def compute_f1_from_tokens()
in utils/evaluate_qa.py
11 5 2
def main()
in utils/evaluate_retrieval.py
51 5 3
18 5 2
def sort_and_sample_filter_list()
in collection/download_commoncrawl_passages.py
10 4 1
def chunk_documents()
in collection/paragraph_chunker.py
13 4 3
def compute_f1_for_retrieved_passage()
in utils/evaluate_retrieval.py
11 4 1
def get_cc_index_paths()
in collection/download_commoncrawl_passages.py
13 3 0
def extract_text()
in collection/download_wayback_passages.py
8 3 1
def process_file()
in collection/paragraph_chunker.py
12 3 3
def normalize_answer()
in utils/evaluate_qa.py
12 3 1
def get_cc_wet_paths()
in collection/download_commoncrawl_passages.py
13 2 0