pytorch / torchx
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 336 units with 2,817 lines of code in units (55.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (113 lines of code)
    • 17 simple units (417 lines of code)
    • 316 very simple units (2,287 lines of code)
0% | 0% | 4% | 14% | 81%
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% | 4% | 14% | 81%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
torchx/schedulers0% | 0% | 6% | 17% | 76%
torchx/apps0% | 0% | 17% | 0% | 82%
torchx/cli0% | 0% | 0% | 25% | 74%
torchx/pipelines0% | 0% | 0% | 47% | 52%
torchx/runner0% | 0% | 0% | 11% | 88%
scripts0% | 0% | 0% | 7% | 92%
torchx/util0% | 0% | 0% | 17% | 82%
torchx/components0% | 0% | 0% | 0% | 100%
torchx/runtime0% | 0% | 0% | 0% | 100%
torchx0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in torchx/apps/utils/process_monitor.py
43 13 1
def kill()
in torchx/schedulers/local_scheduler.py
23 12 1
def describe()
in torchx/schedulers/docker_scheduler.py
47 11 2
def _run()
in torchx/cli/cmd_run.py
78 10 3
def load()
in torchx/runner/config.py
26 9 4
def describe()
in torchx/schedulers/local_scheduler.py
30 9 2
def __next__()
in torchx/schedulers/local_scheduler.py
15 9 1
def main()
in scripts/copyright.py
18 9 1
def describe()
in torchx/schedulers/slurm_scheduler.py
44 8 2
def factory_wrapper()
in torchx/pipelines/kfp/adapter.py
35 7 2
def format_error_message()
in torchx/cli/cmd_status.py
18 7 3
def format_replica_status()
in torchx/cli/cmd_status.py
22 7 1
def __iter__()
in torchx/schedulers/local_scheduler.py
12 7 1
def _validate()
in torchx/schedulers/ray_scheduler.py
17 7 3
def _get_value()
in torchx/util/types.py
8 6 5
def load()
in torchx/util/entrypoints.py
10 6 3
def strip_prefix()
in torchx/runner/config.py
6 6 1
def terminate()
in torchx/schedulers/local_scheduler.py
11 6 1
def _start_thread()
in torchx/schedulers/streams.py
13 6 1
def role_to_pod()
in torchx/schedulers/kubernetes_scheduler.py
54 6 2