microsoft / nni
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 4,511 units with 49,294 lines of code in units (74.6% of code).
    • 1 very complex units (204 lines of code)
    • 16 complex units (1,486 lines of code)
    • 169 medium complex units (7,806 lines of code)
    • 464 simple units (11,146 lines of code)
    • 3,861 very simple units (28,652 lines of code)
<1% | 3% | 15% | 22% | 58%
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
ts1% | 2% | 13% | 21% | 61%
py0% | 3% | 16% | 23% | 56%
tsx0% | 0% | 22% | 14% | 63%
js0% | 0% | 21% | 11% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ts/nni_manager1% | 2% | 13% | 21% | 60%
nni/compression0% | 9% | 13% | 25% | 51%
nni/retiarii0% | 4% | 13% | 23% | 58%
nni/tools0% | 5% | 17% | 27% | 48%
nni/experiment0% | 19% | 10% | 20% | 49%
nni/common0% | 10% | 15% | 27% | 46%
nni/algorithms0% | <1% | 17% | 23% | 59%
nni/nas0% | 1% | 25% | 15% | 58%
ts/webui0% | 0% | 17% | 18% | 64%
nni0% | 0% | 23% | 4% | 72%
nni/runtime0% | 0% | 11% | 23% | 64%
ROOT0% | 0% | 5% | 15% | 79%
ts/jupyter_extension0% | 0% | 0% | 0% | 100%
nni/feature_engineering0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private async trialManagementLoop()
in ts/nni_manager/training_service/reusable/trialDispatcher.ts
204 57 0
def handle_graph_nodes()
in nni/retiarii/converter/graph_gen.py
253 50 9
def to_v2()
in nni/experiment/config/convert.py
219 42 1
def launch_experiment()
in nni/tools/nnictl/legacy_launcher.py
110 41 5
def fix_mask()
in nni/compression/pytorch/utils/mask_conflict.py
94 38 1
def _inverse_cluster_metadata()
in nni/tools/nnictl/config_utils.py
56 34 2
def _build_graph()
in nni/common/graph_utils.py
68 32 1
def replace_conv2d()
in nni/compression/pytorch/speedup/compress_modules.py
78 31 2
def rand()
in nni/algorithms/hpo/metis_tuner/lib_constraint_summation.py
60 30 5
def build_engine()
in nni/compression/pytorch/quantization_speedup/integrated_tensorrt.py
89 30 5
def parse_ids()
in nni/tools/nnictl/nnictl_utils.py
71 30 1
public scheduleMachine()
in ts/nni_manager/training_service/reusable/gpuScheduler.ts
117 30 4
def _from_human_readable_architecture()
in nni/nas/pytorch/fixed.py
19 29 2
private getTrialJobsByReplayEvents()
in ts/nni_manager/core/nniDataStore.ts
76 28 1
def validate_search_space()
in nni/common/hpo_utils/validation.py
53 27 4
def __init__()
in nni/compression/pytorch/speedup/infer_mask.py
45 26 10
private getSinglePAITrialJobInfo()
in ts/nni_manager/training_service/pai/paiJobInfoCollector.ts
78 26 4
def update_indirect_sparsity()
in nni/compression/pytorch/speedup/infer_mask.py
32 25 1
26 25 3
def replace_convtranspose2d()
in nni/compression/pytorch/speedup/compress_modules.py
81 24 2