facebookresearch / unbiased-teacher
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 74 units with 1,143 lines of code in units (56.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 7 medium complex units (324 lines of code)
    • 13 simple units (289 lines of code)
    • 54 very simple units (530 lines of code)
0% | 0% | 28% | 25% | 46%
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% | 28% | 25% | 46%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ubteacher/engine0% | 0% | 31% | 28% | 39%
ubteacher/data0% | 0% | 34% | 32% | 32%
ubteacher/checkpoint0% | 0% | 62% | 37% | 0%
ubteacher/modeling0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
ubteacher0% | 0% | 0% | 0% | 100%
ubteacher/solver0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run_step_full_semisup()
in ubteacher/engine/trainer.py
88 16 1
def __call__()
in ubteacher/data/dataset_mapper.py
63 14 2
def _write_metrics()
in ubteacher/engine/trainer.py
23 13 2
def _write_metrics()
in ubteacher/engine/trainer.py
23 13 2
def _load_model()
in ubteacher/checkpoint/detection_checkpoint.py
35 12 2
63 12 2
def _do_loss_eval()
in ubteacher/engine/hooks.py
29 12 1
def __iter__()
in ubteacher/data/common.py
31 10 1
def build_hooks()
in ubteacher/engine/trainer.py
40 10 1
44 8 2
def __init__()
in ubteacher/data/dataset_mapper.py
32 7 3
def _write_losses()
in ubteacher/engine/hooks.py
12 7 2
def __init__()
in ubteacher/engine/trainer.py
27 7 2
def _load_student_model()
in ubteacher/checkpoint/detection_checkpoint.py
21 6 2
def __iter__()
in ubteacher/data/common.py
12 6 1
def _get_loss()
in ubteacher/engine/hooks.py
12 6 3
def resume_or_load()
in ubteacher/engine/trainer.py
10 6 2
def build_evaluator()
in ubteacher/engine/trainer.py
19 6 4
def resume_or_load()
in ubteacher/engine/trainer.py
10 6 2
def build_evaluator()
in ubteacher/engine/trainer.py
19 6 4