pytorch / serve
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,584 units with 13,536 lines of code in units (67.3% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (340 lines of code)
    • 25 medium complex units (1,460 lines of code)
    • 92 simple units (2,487 lines of code)
    • 1,464 very simple units (9,249 lines of code)
0% | 2% | 10% | 18% | 68%
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% | 7% | 7% | 19% | 65%
java0% | 0% | 12% | 17% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ts0% | 8% | 4% | 31% | 56%
ts_scripts0% | 10% | 10% | 7% | 71%
benchmarks0% | 13% | 14% | 16% | 56%
frontend0% | 0% | 13% | 17% | 68%
model-archiver0% | 0% | 9% | 24% | 66%
binaries0% | 0% | 0% | 54% | 45%
kubernetes0% | 0% | 0% | 23% | 76%
plugins0% | 0% | 0% | 8% | 91%
ci0% | 0% | 0% | 12% | 87%
ROOT0% | 0% | 0% | 25% | 74%
workflow-archiver0% | 0% | 0% | 0% | 100%
experimental0% | 0% | 0% | 0% | 100%
serving-sdk0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def start()
in ts/model_server.py
124 42 0
def test_sanity()
in ts_scripts/sanity_utils.py
120 29 0
def run_single_benchmark()
in benchmarks/benchmark.py
96 27 2
def generate_mars()
in ts_scripts/marsgen.py
55 24 2
private ConfigManager()
in frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
81 19 1
public static Status getGRPCStatusCode()
in frontend/server/src/main/java/org/pytorch/serve/util/GRPCUtils.java
40 19 1
public CompletableFuture modelChanged()
in frontend/server/src/main/java/org/pytorch/serve/wlm/WorkLoadManager.java
66 19 3
public ArrayList execute()
in frontend/server/src/main/java/org/pytorch/serve/ensemble/DagExecutor.java
91 18 2
private void initModelStore()
in frontend/server/src/main/java/org/pytorch/serve/ModelServer.java
126 18 0
public static void sendHttpResponse()
in frontend/server/src/main/java/org/pytorch/serve/util/NettyUtils.java
50 17 3
public void run()
in frontend/server/src/main/java/org/pytorch/serve/wlm/WorkerThread.java
87 17 0
def copy_artifacts()
in model-archiver/model_archiver/model_packaging_utils.py
29 16 2
def get_cudnn_version()
in ts_scripts/print_env_info.py
28 16 0
public void handleRequest()
in frontend/server/src/main/java/org/pytorch/serve/http/api/rest/ManagementRequestHandler.java
55 15 4
public WorkFlow()
in frontend/server/src/main/java/org/pytorch/serve/ensemble/WorkFlow.java
112 14 1
public void handleRequest()
in frontend/server/src/main/java/org/pytorch/serve/http/api/rest/InferenceRequestHandler.java
54 14 4
private boolean isInferenceReq()
in frontend/server/src/main/java/org/pytorch/serve/http/api/rest/InferenceRequestHandler.java
13 14 1
def create_predict_response()
in ts/protocol/otf_message_handler.py
61 14 5
public StatusResponse registerWorkflow()
in frontend/server/src/main/java/org/pytorch/serve/workflow/WorkflowManager.java
101 13 5
def main()
in benchmarks/automated/run_benchmark.py
99 13 0