awslabs / multi-model-server
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 993 units with 7,697 lines of code in units (75.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (113 lines of code)
    • 13 medium complex units (739 lines of code)
    • 66 simple units (1,879 lines of code)
    • 913 very simple units (4,966 lines of code)
0% | 1% | 9% | 24% | 64%
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% | 6% | 16% | 22% | 54%
java0% | 0% | 7% | 24% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mms0% | 20% | 13% | 17% | 48%
frontend/server0% | 0% | 8% | 23% | 67%
benchmarks0% | 0% | 36% | 31% | 32%
mms/protocol0% | 0% | 32% | 24% | 43%
model-archiver/model_archiver0% | 0% | 13% | 24% | 61%
mms/model_service0% | 0% | 18% | 26% | 54%
frontend/modelarchive0% | 0% | 0% | 33% | 66%
frontend/cts0% | 0% | 0% | 27% | 72%
mms/metrics0% | 0% | 0% | 16% | 83%
mms/utils0% | 0% | 0% | 25% | 74%
plugins/endpoints0% | 0% | 0% | 28% | 71%
ROOT0% | 0% | 0% | 37% | 62%
serving-sdk/src0% | 0% | 0% | 0% | 100%
model-archiver0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def start()
in mms/model_server.py
113 37 0
def run_single_benchmark()
in benchmarks/benchmark.py
84 22 2
private void initModelStore()
in frontend/server/src/main/java/com/amazonaws/ml/mms/ModelServer.java
100 17 0
public static void sendHttpResponse()
in frontend/server/src/main/java/com/amazonaws/ml/mms/util/NettyUtils.java
50 17 3
public void run()
in frontend/server/src/main/java/com/amazonaws/ml/mms/wlm/WorkerThread.java
58 15 0
public void run()
in frontend/server/src/main/java/com/amazonaws/ml/mms/metrics/MetricCollector.java
82 15 0
def create_predict_response()
in mms/protocol/otf_message_handler.py
54 13 5
public void pollBatch()
in frontend/server/src/main/java/com/amazonaws/ml/mms/wlm/Model.java
45 12 3
def load()
in mms/model_loader.py
45 12 6
def convert_onnx_model()
in model-archiver/model_archiver/model_packaging_utils.py
50 11 3
private ConfigManager()
in frontend/server/src/main/java/com/amazonaws/ml/mms/util/ConfigManager.java
50 11 1
public ModelArchive registerModel()
in frontend/server/src/main/java/com/amazonaws/ml/mms/wlm/ModelManager.java
49 11 9
def __init__()
in mms/model_service_worker.py
32 11 8
def __init__()
in mms/model_service/mxnet_model_service.py
40 11 5
private static File download()
in frontend/modelarchive/src/main/java/com/amazonaws/ml/mms/archive/ModelArchive.java
37 10 1
protected void decode()
in frontend/server/src/main/java/com/amazonaws/ml/mms/util/codec/ModelResponseDecoder.java
55 10 3
public String toSerializable()
in frontend/server/src/main/java/com/amazonaws/ml/mms/util/logging/QLogLayout.java
55 10 1
public void run()
in frontend/server/src/main/java/com/amazonaws/ml/mms/wlm/WorkerLifeCycle.java
34 10 0
protected void channelRead0()
in frontend/server/src/main/java/com/amazonaws/ml/mms/http/HttpRequestHandler.java
36 10 2
private boolean isInferenceReq()
in frontend/server/src/main/java/com/amazonaws/ml/mms/http/InferenceRequestHandler.java
10 10 1