apple / servicetalk
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 9,779 units with 61,314 lines of code in units (62.5% of code).
    • 9 very long units (1,312 lines of code)
    • 48 long units (3,172 lines of code)
    • 356 medium size units (10,689 lines of code)
    • 782 small units (11,194 lines of code)
    • 8,584 very small units (34,947 lines of code)
2% | 5% | 17% | 18% | 56%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java2% | 4% | 17% | 18% | 57%
groovy0% | 28% | 26% | 25% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
servicetalk-concurrent-api2% | 3% | 18% | 21% | 53%
servicetalk-http-api3% | 2% | 16% | 16% | 61%
servicetalk-http-utils17% | 9% | 15% | 13% | 43%
servicetalk-http-netty2% | 9% | 19% | 18% | 49%
servicetalk-grpc-protoc13% | 0% | 50% | 14% | 21%
servicetalk-grpc-api0% | 11% | 18% | 29% | 40%
servicetalk-encoding-netty0% | 28% | 25% | 5% | 41%
servicetalk-http-router-jersey0% | 4% | 15% | 18% | 61%
servicetalk-gradle-plugin-internal0% | 28% | 26% | 25% | 19%
servicetalk-loadbalancer0% | 26% | 26% | 11% | 34%
servicetalk-benchmarks0% | 13% | 9% | 22% | 54%
servicetalk-serialization-api0% | 25% | 14% | 4% | 55%
servicetalk-utils-internal0% | 21% | 6% | 19% | 53%
servicetalk-tcp-netty-internal0% | 14% | 28% | 15% | 41%
servicetalk-buffer-api0% | 4% | 10% | 8% | 77%
servicetalk-grpc-protobuf0% | 24% | 20% | 16% | 38%
servicetalk-concurrent-api-internal0% | 23% | 25% | 10% | 40%
servicetalk-log4j2-mdc-utils0% | 24% | 13% | 17% | 44%
servicetalk-dns-discovery-netty0% | 8% | 14% | 21% | 55%
servicetalk-transport-netty-internal0% | 0% | 20% | 18% | 60%
servicetalk-concurrent-internal0% | 0% | 26% | 22% | 50%
servicetalk-opentracing-inmemory0% | 0% | 20% | 17% | 62%
servicetalk-opentracing-zipkin-publisher0% | 0% | 44% | 10% | 45%
servicetalk-data-jackson0% | 0% | 26% | 16% | 56%
servicetalk-client-api-internal0% | 0% | 22% | 32% | 44%
servicetalk-serializer-utils0% | 0% | 39% | 19% | 41%
servicetalk-data-jackson-jersey0% | 0% | 33% | 25% | 40%
servicetalk-encoding-api-internal0% | 0% | 27% | 27% | 45%
servicetalk-serializer-api0% | 0% | 59% | 0% | 40%
servicetalk-grpc-internal0% | 0% | 95% | 0% | 4%
servicetalk-client-api0% | 0% | 10% | 15% | 73%
servicetalk-grpc-utils0% | 0% | 11% | 0% | 88%
servicetalk-opentracing-log4j20% | 0% | 38% | 21% | 39%
servicetalk-opentracing-internal0% | 0% | 31% | 43% | 25%
servicetalk-buffer-netty0% | 0% | 0% | 8% | 91%
servicetalk-opentracing-http0% | 0% | 0% | 37% | 62%
servicetalk-router-utils-internal0% | 0% | 0% | 81% | 18%
servicetalk-data-protobuf0% | 0% | 0% | 37% | 62%
servicetalk-transport-api0% | 0% | 0% | 3% | 96%
servicetalk-grpc-netty0% | 0% | 0% | 11% | 88%
servicetalk-logging-slf4j-internal0% | 0% | 0% | 16% | 83%
servicetalk-http-router-predicate0% | 0% | 0% | 10% | 89%
servicetalk-context-api0% | 0% | 0% | 30% | 69%
servicetalk-encoding-api0% | 0% | 0% | 10% | 89%
servicetalk-http-router-jersey-internal0% | 0% | 0% | 14% | 85%
servicetalk-concurrent0% | 0% | 0% | 26% | 73%
servicetalk-concurrent-jdkflow0% | 0% | 0% | 24% | 76%
servicetalk-concurrent-reactivestreams0% | 0% | 0% | 24% | 76%
servicetalk-http-security-jersey0% | 0% | 0% | 0% | 100%
servicetalk-opentracing-asynccontext0% | 0% | 0% | 0% | 100%
servicetalk-transport-netty0% | 0% | 0% | 0% | 100%
servicetalk-oio-api-internal0% | 0% | 0% | 0% | 100%
servicetalk-opentracing-inmemory-api0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public void onSuccess()
in servicetalk-http-utils/src/main/java/io/servicetalk/http/utils/BeforeFinallyHttpOperator.java
215 40 1
private CopyContextMap removeAll()
in servicetalk-concurrent-api/src/main/java/io/servicetalk/concurrent/api/CopyOnWriteContextMap.java
213 64 1
protected abstract T createMessage()
in servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/HttpObjectDecoder.java
173 40 7
static HttpSetCookie parseSetCookie()
in servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultHttpSetCookie.java
151 39 4
private static HttpResponseStatus valueOf()
in servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpResponseStatus.java
128 62 1
private CopyContextMap removeBelowSeven()
in servicetalk-concurrent-api/src/main/java/io/servicetalk/concurrent/api/CopyOnWriteContextMap.java
125 34 1
public static StreamingHttpClient from()
in servicetalk-http-api/src/testFixtures/java/io/servicetalk/http/api/TestStreamingHttpClient.java
104 1 1
private CopyContextMap removeAll()
in servicetalk-concurrent-api/src/main/java/io/servicetalk/concurrent/api/CopyOnWriteContextMap.java
102 32 1
private static MethodSpec newRpcMethodSpec()
in servicetalk-grpc-protoc/src/main/java/io/servicetalk/grpc/protoc/Generator.java
101 24 8
private NettyConnection newNettyConnection()
in servicetalk-benchmarks/src/jmh/java/io/servicetalk/http/netty/NettyPipelinedConnectionBenchmark.java
98 2 0
private void runTest()
in servicetalk-http-router-jersey/src/testFixtures/java/io/servicetalk/http/router/jersey/ExecutionStrategyTest.java
96 35 0
static boolean isValidIpV6Address()
in servicetalk-http-api/src/main/java/io/servicetalk/http/api/NetUtils.java
95 33 1
private static void applyJavaLibraryPlugin()
in servicetalk-gradle-plugin-internal/src/main/groovy/io/servicetalk/gradle/plugin/internal/ServiceTalkLibraryPlugin.groovy
90 5 1
public BlockingIterator iterator()
in servicetalk-serialization-api/src/main/java/io/servicetalk/serialization/api/BlockingIterableFlatMap.java
90 15 0
static
in servicetalk-utils-internal/src/main/java/io/servicetalk/utils/internal/PlatformDependent0.java
90 25 0
private static StreamingHttpClient buildStreaming()
in servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/DefaultSingleAddressHttpClientBuilder.java
83 15 1
public void write()
in servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/HttpObjectEncoder.java
81 21 3
public static Single bind()
in servicetalk-tcp-netty-internal/src/main/java/io/servicetalk/tcp/netty/internal/TcpServerBinder.java
78 10 7
static int hashCodeAscii()
in servicetalk-buffer-api/src/main/java/io/servicetalk/buffer/api/AsciiBuffer.java
76 41 1
public Single handle()
in servicetalk-http-api/src/main/java/io/servicetalk/http/api/BlockingStreamingToStreamingService.java
74 12 3