pytorch / serve
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,584 units with 13,536 lines of code in units (67.3% of code).
    • 5 very long units (583 lines of code)
    • 25 long units (1,731 lines of code)
    • 109 medium size units (3,461 lines of code)
    • 200 small units (2,929 lines of code)
    • 1,245 very small units (4,832 lines of code)
4% | 12% | 25% | 21% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java3% | 14% | 26% | 18% | 36%
py5% | 8% | 24% | 27% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
frontend3% | 15% | 25% | 18% | 36%
ts8% | 4% | 23% | 26% | 37%
ts_scripts10% | 4% | 21% | 35% | 28%
benchmarks0% | 27% | 30% | 14% | 26%
model-archiver0% | 27% | 25% | 19% | 28%
plugins0% | 0% | 50% | 14% | 35%
kubernetes0% | 0% | 40% | 21% | 38%
binaries0% | 0% | 44% | 33% | 22%
workflow-archiver0% | 0% | 22% | 23% | 53%
ci0% | 0% | 19% | 35% | 45%
experimental0% | 0% | 0% | 50% | 50%
ROOT0% | 0% | 0% | 61% | 38%
serving-sdk0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void initModelStore()
in frontend/server/src/main/java/org/pytorch/serve/ModelServer.java
126 18 0
def start()
in ts/model_server.py
124 42 0
def test_sanity()
in ts_scripts/sanity_utils.py
120 29 0
public WorkFlow()
in frontend/server/src/main/java/org/pytorch/serve/ensemble/WorkFlow.java
112 14 1
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
def run_single_benchmark()
in benchmarks/benchmark.py
96 27 2
public ArrayList execute()
in frontend/server/src/main/java/org/pytorch/serve/ensemble/DagExecutor.java
91 18 2
public void run()
in frontend/server/src/main/java/org/pytorch/serve/wlm/WorkerThread.java
87 17 0
public static StatusResponse updateModelWorkers()
in frontend/server/src/main/java/org/pytorch/serve/util/ApiUtils.java
86 10 7
def export_model_args_parser()
in model-archiver/model_archiver/arg_parser.py
84 2 0
private ConfigManager()
in frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
81 19 1
public void unregisterModels()
in frontend/server/src/main/java/org/pytorch/serve/workflow/WorkflowManager.java
76 9 3
private void connect()
in frontend/server/src/main/java/org/pytorch/serve/wlm/WorkerThread.java
74 7 0
private static Operation getRegisterOperation()
in frontend/server/src/main/java/org/pytorch/serve/openapi/OpenApiUtils.java
73 2 0
private static Operation getDescribeModelOperation()
in frontend/server/src/main/java/org/pytorch/serve/openapi/OpenApiUtils.java
70 3 1
public CompletableFuture modelChanged()
in frontend/server/src/main/java/org/pytorch/serve/wlm/WorkLoadManager.java
66 19 3
public String dumpConfigurations()
in frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
63 5 0
public static StatusResponse handleRegister()
in frontend/server/src/main/java/org/pytorch/serve/util/ApiUtils.java
61 5 11
def create_predict_response()
in ts/protocol/otf_message_handler.py
61 14 5