amazon-research / generalized-fairness-metrics
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 274 units with 3,786 lines of code in units (61.7% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (318 lines of code)
    • 25 medium complex units (751 lines of code)
    • 45 simple units (928 lines of code)
    • 201 very simple units (1,789 lines of code)
0% | 8% | 19% | 24% | 47%
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% | 11% | 24% | 26% | 37%
ts0% | 0% | 14% | 20% | 65%
tsx0% | 0% | 0% | 16% | 83%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
expanded_checklist/checklist0% | 9% | 29% | 29% | 31%
expanded_checklist/checklist/graphs0% | 49% | 0% | 13% | 36%
expanded_checklist/visual_interface/src0% | 0% | 6% | 17% | 76%
src/models/readers0% | 0% | 14% | 33% | 51%
src/models0% | 0% | 25% | 42% | 32%
expanded_checklist/checklist/viewer0% | 0% | 33% | 0% | 66%
ROOT0% | 0% | 0% | 0% | 100%
expanded_checklist0% | 0% | 0% | 0% | 100%
expanded_checklist/visual_interface/lib0% | 0% | 0% | 0% | 100%
src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def template()
in expanded_checklist/checklist/editor.py
80 41 11
def flatten_within_group()
in expanded_checklist/checklist/core_record.py
104 33 2
def plot_groups()
in expanded_checklist/checklist/graphs/graphs.py
134 30 8
def remove_negation()
in expanded_checklist/checklist/perturb.py
43 25 1
def add_negation()
in expanded_checklist/checklist/perturb.py
52 19 1
def text_to_instance()
in src/models/readers/sst_reader.py
34 18 3
def unmask()
in expanded_checklist/checklist/text_generation.py
61 18 4
def change_names()
in expanded_checklist/checklist/perturb.py
37 18 6
def unmask_multiple()
in expanded_checklist/checklist/text_generation.py
32 17 6
def _get_fillin_items()
in expanded_checklist/checklist/editor.py
39 16 4
def tokenize_template_str()
in expanded_checklist/checklist/viewer/template_editor.py
33 16 5
def replace_word()
in expanded_checklist/checklist/text_generation.py
19 16 6
def filter_options()
in expanded_checklist/checklist/text_generation.py
18 16 5
public objEqual()
in expanded_checklist/visual_interface/src/stores/Utils.ts
28 16 2
def vformat()
in expanded_checklist/checklist/editor.py
17 15 4
def _load_lexicons()
in expanded_checklist/checklist/editor.py
30 15 2
def perturb()
in expanded_checklist/checklist/perturb.py
48 15 6
def example_list_and_indices()
in expanded_checklist/checklist/eval_core.py
28 14 3
def update_results_from_preds()
in expanded_checklist/checklist/eval_core.py
20 14 3
def all_possible_related()
in expanded_checklist/checklist/text_generation.py
9 14 3