facebookresearch / convit
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 80 units with 1,133 lines of code in units (91.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (163 lines of code)
    • 1 medium complex units (31 lines of code)
    • 5 simple units (193 lines of code)
    • 73 very simple units (746 lines of code)
0% | 14% | 2% | 17% | 65%
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% | 14% | 2% | 17% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 14% | 2% | 17% | 65%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in main.py
163 39 1
31 14 6
def build_dataset()
in datasets.py
25 9 2
def main()
in run_with_submitit.py
48 8 0
34 8 10
def __init__()
in convit.py
41 8 20
def log_every()
in utils.py
45 7 4
def __init__()
in samplers.py
17 5 5
8 5 2
8 5 2
8 5 2
8 5 2
8 5 2
def copy_py()
in run_with_submitit.py
7 4 2
def __init__()
in datasets.py
31 4 8
def __init__()
in datasets.py
16 4 9
def build_transform()
in datasets.py
27 4 2
21 4 1
def __iter__()
in samplers.py
13 4 1
def local_init()
in convit.py
12 4 2