facebookresearch / xcit
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 131 units with 2,235 lines of code in units (51.1% of code).
    • 1 very complex units (204 lines of code)
    • 1 complex units (96 lines of code)
    • 4 medium complex units (236 lines of code)
    • 7 simple units (240 lines of code)
    • 118 very simple units (1,459 lines of code)
9% | 4% | 10% | 10% | 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
py9% | 4% | 10% | 10% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT17% | 0% | 2% | 9% | 69%
detection/tools0% | 31% | 23% | 0% | 45%
semantic_segmentation/tools0% | 0% | 60% | 0% | 39%
detection/backbone0% | 0% | 0% | 22% | 77%
semantic_segmentation/backbone0% | 0% | 0% | 22% | 77%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in main.py
204 52 1
def main()
in detection/tools/test.py
96 39 0
def main()
in semantic_segmentation/tools/test.py
64 21 0
def main()
in detection/tools/train.py
72 19 0
def main()
in semantic_segmentation/tools/train.py
71 19 0
def build_dataset()
in datasets.py
29 11 2
37 8 12
def log_every()
in utils.py
45 7 4
def init_weights()
in detection/backbone/xcit.py
17 7 2
def init_weights()
in semantic_segmentation/backbone/xcit.py
17 7 2
def __init__()
in xcit.py
32 6 20
def __init__()
in detection/backbone/xcit.py
46 6 23
def __init__()
in semantic_segmentation/backbone/xcit.py
46 6 23
8 5 2
def build_transform()
in datasets.py
36 5 2
def forward()
in losses.py
28 5 4
def parse_args()
in detection/tools/test.py
79 5 0
def parse_args()
in detection/tools/train.py
61 5 0
def forward_features()
in detection/backbone/xcit.py
17 5 2
def __init__()
in samplers.py
17 5 5