microsoft / pai
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 2,692 units with 25,564 lines of code in units (34.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (180 lines of code)
    • 53 medium complex units (2,477 lines of code)
    • 183 simple units (4,901 lines of code)
    • 2,454 very simple units (18,006 lines of code)
0% | <1% | 9% | 19% | 70%
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
java0% | <1% | 7% | 17% | 74%
py0% | 1% | 12% | 24% | 62%
js0% | 0% | 7% | 16% | 76%
go0% | 0% | 27% | 12% | 60%
rb0% | 0% | 23% | 0% | 76%
ts0% | 0% | 0% | 72% | 27%
tsx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
subprojects/frameworklauncher0% | <1% | 7% | 17% | 74%
contrib/profiler0% | 17% | 30% | 12% | 38%
src/webportal0% | 0% | 9% | 19% | 70%
src/watchdog0% | 0% | 27% | 12% | 60%
deployment/k8sPaiLibrary0% | 0% | 13% | 20% | 65%
src/job-exporter0% | 0% | 13% | 30% | 56%
deployment/clusterObjectModel0% | 0% | 25% | 27% | 46%
src/rest-server0% | 0% | 5% | 12% | 82%
deployment/utility0% | 0% | 61% | 0% | 38%
contrib/aks-engine0% | 0% | 29% | 13% | 57%
build/core0% | 0% | 36% | 8% | 55%
deployment0% | 0% | 13% | 18% | 68%
src/database-controller0% | 0% | 4% | 16% | 79%
src/alert-manager0% | 0% | 14% | 43% | 42%
src/fluentd0% | 0% | 22% | 0% | 77%
contrib/kubespray0% | 0% | 6% | 34% | 58%
deployment/confStorage0% | 0% | 5% | 15% | 78%
src/authentication0% | 0% | 32% | 16% | 51%
contrib/autoscaler0% | 0% | 4% | 0% | 95%
deployment/paiLibrary0% | 0% | 0% | 26% | 73%
contrib/remote-dev-tool0% | 0% | 0% | 37% | 62%
src/cluster0% | 0% | 0% | 44% | 55%
build/model0% | 0% | 0% | 47% | 52%
contrib/debug-tools0% | 0% | 0% | 47% | 52%
contrib/hived-config-adapter0% | 0% | 0% | 56% | 43%
src/utilities0% | 0% | 0% | 72% | 27%
ROOT0% | 0% | 0% | 87% | 12%
contrib/submit-job-v20% | 0% | 0% | 13% | 86%
src/pylon0% | 0% | 0% | 48% | 51%
src/prometheus-pushgateway0% | 0% | 0% | 27% | 72%
src/device-plugin0% | 0% | 0% | 46% | 53%
build0% | 0% | 0% | 0% | 100%
contrib/api-stress-test0% | 0% | 0% | 0% | 100%
src/base-image0% | 0% | 0% | 0% | 100%
src/internal-storage0% | 0% | 0% | 0% | 100%
src/postgresql0% | 0% | 0% | 0% | 100%
src/grafana0% | 0% | 0% | 0% | 100%
src/prometheus0% | 0% | 0% | 0% | 100%
src/hivedscheduler0% | 0% | 0% | 0% | 100%
src/k8s-dashboard0% | 0% | 0% | 0% | 100%
src/marketplace-restserver0% | 0% | 0% | 0% | 100%
src/marketplace-db0% | 0% | 0% | 0% | 100%
src/marketplace-webportal0% | 0% | 0% | 0% | 100%
src/docker-cache0% | 0% | 0% | 0% | 100%
src/dshuttle0% | 0% | 0% | 0% | 100%
src/log-manager0% | 0% | 0% | 0% | 100%
src/node-exporter0% | 0% | 0% | 0% | 100%
src/storage-manager0% | 0% | 0% | 0% | 100%
src/k8s-job-exit-spec0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def detect_pattern()
in contrib/profiler/utils.py
88 50 2
public synchronized void transitionTaskState()
in subprojects/frameworklauncher/yarn/src/main/java/com/microsoft/frameworklauncher/applicationmaster/StatusManager.java
92 27 3
def run()
in src/alert-manager/config/alert_manager.py
44 24 1
def parse_docker_inspect()
in src/job-exporter/src/docker_inspect.py
34 22 2
async create()
in src/database-controller/src/common/framework.js
67 21 0
def parse_smi_xml_result()
in src/job-exporter/src/nvidia.py
82 21 1
getPaiCommand()
in src/webportal/src/app/job-submission/models/data/mount-directories.js
88 20 0
def check_layout()
in contrib/kubespray/script/validate_layout_schema.py
36 19 2
public synchronized void transitionFrameworkState()
in subprojects/frameworklauncher/yarn/src/main/java/com/microsoft/frameworklauncher/service/StatusManager.java
73 19 3
def get_k8s_cluster_info()
in contrib/aks-engine/azure.py
77 17 3
def validation_pre()
in deployment/clusterObjectModel/mainParser/kubernetes.py
33 17 1
def validation_host_properties()
in deployment/clusterObjectModel/mainParser/machine.py
31 16 1
def convert_nvidia_gpu_info_to_metrics()
in src/job-exporter/src/collector.py
49 16 5
private void attemptToRetry()
in subprojects/frameworklauncher/yarn/src/main/java/com/microsoft/frameworklauncher/service/Service.java
88 16 1
private void resyncFrameworksWithLiveApplications()
in subprojects/frameworklauncher/yarn/src/main/java/com/microsoft/frameworklauncher/service/Service.java
71 16 1
write
in src/fluentd/src/fluent-plugin-pgjson/lib/fluent/plugin/out_pgjson.rb
41 15 1
private void attemptToRetry()
in subprojects/frameworklauncher/yarn/src/main/java/com/microsoft/frameworklauncher/applicationmaster/ApplicationMaster.java
74 15 1
def analyze_value()
in contrib/profiler/profiler.py
69 14 3
def ssh_shell_with_password_input_paramiko()
in deployment/k8sPaiLibrary/maintainlib/common.py
38 14 2
func()
in src/watchdog/src/pkg/watchdog/metric_generator.go
74 14 1