facebookresearch / CrypTen
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 1,109 units with 8,391 lines of code in units (72.8% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (118 lines of code)
    • 16 medium complex units (668 lines of code)
    • 74 simple units (1,479 lines of code)
    • 1,017 very simple units (6,126 lines of code)
0% | 1% | 7% | 17% | 73%
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% | 1% | 8% | 17% | 72%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
crypten/nn0% | 3% | 5% | 23% | 67%
crypten/communicator0% | 11% | 0% | 17% | 71%
crypten0% | 0% | 8% | 13% | 78%
crypten/mpc0% | 0% | 8% | 13% | 78%
scripts0% | 0% | 38% | 15% | 45%
crypten/common0% | 0% | 11% | 26% | 61%
crypten/cuda0% | 0% | 12% | 4% | 82%
crypten/debug0% | 0% | 46% | 0% | 53%
benchmarks0% | 0% | 0% | 22% | 77%
benchmarks/dash_app0% | 0% | 0% | 20% | 79%
crypten/optim0% | 0% | 0% | 90% | 9%
pycon-workshop-20200% | 0% | 0% | 0% | 100%
tutorials0% | 0% | 0% | 0% | 100%
website/pages0% | 0% | 0% | 0% | 100%
crypten/models0% | 0% | 0% | 0% | 100%
crypten/config0% | 0% | 0% | 0% | 100%
website/core0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _logging()
in crypten/communicator/communicator.py
55 37 1
def forward()
in crypten/nn/module.py
63 32 2
def _arithmetic_function()
in crypten/mpc/primitives/arithmetic.py
59 23 6
def backward()
in crypten/cryptensor.py
38 22 3
def _adaptive_pool2d_helper()
in crypten/common/functions/pooling.py
80 19 3
def __getattribute__()
in crypten/cryptensor.py
33 18 2
def main()
in scripts/aws_launcher.py
115 17 0
def _get_autograd_forward_function()
in crypten/cryptensor.py
30 16 4
def __torch_function__()
in crypten/cuda/cuda_tensor.py
18 14 4
def matmul()
in crypten/cuda/cuda_tensor.py
25 14 4
def div_()
in crypten/mpc/primitives/arithmetic.py
25 14 2
def run_multiprocess()
in crypten/mpc/context.py
47 14 1
30 12 4
def validate_correctness()
in crypten/debug/debug.py
43 12 4
def __setattr__()
in crypten/nn/module.py
29 11 3
def forward()
in crypten/nn/module.py
32 11 2
def _setup_prng()
in crypten/__init__.py
39 11 0
def norm()
in crypten/common/functions/power.py
25 11 4
def forward()
in crypten/nn/privacy/dp_split.py
25 10 2
def _process_targets()
in crypten/nn/privacy/dp_split.py
16 10 2