apple / ml-cread
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 169 units with 2,599 lines of code in units (88.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (97 lines of code)
    • 17 medium complex units (588 lines of code)
    • 21 simple units (438 lines of code)
    • 130 very simple units (1,476 lines of code)
0% | 3% | 22% | 16% | 56%
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% | 3% | 22% | 16% | 56%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
modeling/coval/conll0% | 15% | 48% | 26% | 9%
modeling/coval/arrau0% | 0% | 46% | 39% | 13%
modeling0% | 0% | 10% | 1% | 87%
modeling/utils0% | 0% | 9% | 19% | 70%
modeling/qr_eval/qr/rouge0% | 0% | 15% | 23% | 60%
modeling/coval/eval0% | 0% | 13% | 11% | 75%
modeling/qr_eval/qr/training0% | 0% | 0% | 25% | 74%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def extract_annotated_parse()
in modeling/coval/conll/reader.py
97 36 5
def get_doc_markables()
in modeling/coval/arrau/reader.py
76 23 7
def get_doc_mentions()
in modeling/coval/conll/reader.py
55 22 5
def set_annotated_parse_trees()
in modeling/coval/conll/reader.py
39 22 6
def collate_fn()
in modeling/dataset.py
43 20 2
def get_min_span_no_valid_tag()
in modeling/coval/conll/mention.py
22 18 2
def parse_key_file()
in modeling/coval/conll/util.py
60 16 1
def __eq__()
in modeling/coval/arrau/markable.py
19 15 2
def is_a_valid_terminal_node()
in modeling/coval/conll/mention.py
13 15 3
def get_valid_node_min_span()
in modeling/coval/conll/mention.py
16 15 4
def extract_coref_annotation()
in modeling/coval/conll/reader.py
37 15 1
def get_top_level_phrases()
in modeling/coval/conll/mention.py
16 14 3
def remove_nested_coref_mentions()
in modeling/coval/conll/reader.py
34 14 3
def mask_unseen_mentions()
in modeling/coval/conll/reader.py
15 13 3
def lea()
in modeling/coval/eval/evaluator.py
22 12 3
def forward()
in modeling/model.py
51 11 19
def _summary_level_lcs()
in modeling/qr_eval/qr/rouge/rouge_scorer.py
25 11 2
def filter_links()
in modeling/utils/process_data.py
45 11 4
def are_nested()
in modeling/coval/conll/mention.py
14 10 2
def get_valid_tags()
in modeling/coval/conll/mention.py
20 10 2