facebookresearch / AutoCTR
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 665 units with 8,727 lines of code in units (73.1% of code).
    • 0 very complex units (0 lines of code)
    • 23 complex units (1,654 lines of code)
    • 94 medium complex units (2,915 lines of code)
    • 44 simple units (1,273 lines of code)
    • 504 very simple units (2,885 lines of code)
0% | 18% | 33% | 14% | 33%
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% | 18% | 33% | 14% | 33%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
gen-py/config0% | 17% | 45% | 8% | 28%
gen-py/block_config0% | 35% | 32% | 10% | 21%
nasrec0% | 11% | 14% | 33% | 40%
scripts0% | 42% | 30% | 3% | 23%
utils0% | 0% | 15% | 20% | 63%
trainers0% | 0% | 34% | 0% | 65%
models0% | 0% | 23% | 18% | 58%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def read()
in gen-py/block_config/ttypes.py
82 39 2
def read()
in gen-py/config/ttypes.py
88 38 2
def read()
in gen-py/block_config/ttypes.py
76 36 2
def read()
in gen-py/config/ttypes.py
79 35 2
def read()
in gen-py/config/ttypes.py
71 35 2
def read()
in gen-py/config/ttypes.py
78 34 2
def read()
in gen-py/block_config/ttypes.py
72 34 2
def read()
in gen-py/block_config/ttypes.py
73 34 2
def read()
in gen-py/block_config/ttypes.py
72 34 2
def preprocess_kdd()
in scripts/preprocess.py
116 33 1
def vec_to_block_config()
in nasrec/base_searcher.py
196 30 3
def read()
in gen-py/config/ttypes.py
60 30 2
def read()
in gen-py/config/ttypes.py
54 30 2
def read()
in gen-py/config/ttypes.py
54 29 2
def read()
in gen-py/config/ttypes.py
52 27 2
def read()
in gen-py/config/ttypes.py
49 27 2
def read()
in gen-py/config/ttypes.py
49 27 2
def read()
in gen-py/block_config/ttypes.py
54 27 2
def read()
in gen-py/block_config/ttypes.py
52 27 2
def read()
in gen-py/block_config/ttypes.py
52 27 2