Ktor
Unit Size

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,742 units with 13,781 lines of code in units (19.6% of code).
    • 1 very long units (106 lines of code)
    • 7 long units (432 lines of code)
    • 110 medium size units (3,194 lines of code)
    • 232 small units (3,307 lines of code)
    • 1,392 very small units (6,742 lines of code)
<1% | 3% | 23% | 23% | 48%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
kt<1% | 3% | 23% | 23% | 48%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Logical Component
primary logical decomposition
ktor-server3% | 1% | 25% | 18% | 51%
ktor-client0% | 7% | 27% | 24% | 40%
ktor-http0% | 5% | 25% | 27% | 41%
ktor-io0% | 1% | 22% | 25% | 49%
ktor-features0% | 5% | 20% | 28% | 45%
ktor-network0% | 0% | 15% | 28% | 55%
ktor-utils0% | 0% | 8% | 22% | 68%
Legend:
101+
51-100
21-50
11-20
1-10
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
public fun commandLineEnvironment()
in ktor-server/ktor-server-host-common/jvm/src/io/ktor/server/engine/CommandLine.kt
106 15 1
public fun HttpClient()
in ktor-client/ktor-client-core/common/src/io/ktor/client/HttpClient.kt
85 4 2
public fun parseBoundary()
in ktor-http/ktor-http-cio/jvm/src/io/ktor/http/cio/Multipart.kt
67 13 1
override fun install()
in ktor-server/ktor-server-core/jvm/src/io/ktor/features/ContentNegotiation.kt
62 8 2
override fun invoke()
in ktor-client/ktor-client-ios/darwin/src/io/ktor/client/engine/ios/certificates/CertificatePinner.kt
57 8 5
public suspend fun decodeUTF8LineLoopSuspend()
in ktor-io/common/src/io/ktor/utils/io/core/internal/UTF8.kt
55 11 3
override fun install()
in ktor-client/ktor-client-features/ktor-client-logging/common/src/io/ktor/client/features/logging/Logging.kt
55 10 2
public fun createObtainRequestTokenHeader()
in ktor-features/ktor-auth/jvm/src/io/ktor/auth/OAuth1a.kt
51 1 4
override fun install()
in ktor-server/ktor-server-core/jvm/src/io/ktor/features/DoubleReceive.kt
48 9 2
public fun forName()
in ktor-io/common/src/io/ktor/utils/io/charsets/Encoding.kt
48 2 1
override suspend fun execute()
in ktor-client/ktor-client-android/jvm/src/io/ktor/client/engine/android/AndroidClientEngine.kt
47 7 1
override fun handle()
in ktor-server/ktor-server-jetty/jvm/src/io/ktor/server/jetty/JettyKtorHandler.kt
46 9 4
protected fun commitHeaders()
in ktor-server/ktor-server-host-common/jvm/src/io/ktor/server/engine/BaseApplicationResponse.kt
46 6 1
public fun interceptPipeline()
in ktor-features/ktor-auth/jvm/src/io/ktor/auth/Authentication.kt
45 6 2
public suspend fun decodeChunked()
in ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/ChunkedTransferEncoding.kt
44 15 3
override fun install()
in ktor-server/ktor-server-core/jvm/src/io/ktor/features/OriginConnectionPoint.kt
43 3 2
override fun install()
in ktor-features/ktor-metrics/jvm/src/io/ktor/metrics/dropwizard/DropwizardMetrics.kt
41 2 2
public suspend fun readAvailable()
in ktor-io/posix/src/io/ktor/utils/io/ByteReadChannelNative.kt
40 1 3
override suspend fun execute()
in ktor-client/ktor-client-ios/darwin/src/io/ktor/client/engine/ios/IosClientEngine.kt
40 3 1
public fun generateCertificate()
in ktor-network/ktor-network-tls/ktor-network-tls-certificates/jvm/src/io/ktor/network/tls/certificates/Certificates.kt
39 1 6
fun configureServer()
in ktor-server/ktor-server-benchmarks/src/jmh/kotlin/io/ktor/server/benchmarks/AsyncIntegrationBenchmark.kt
39 1 0
public fun merge()
in ktor-utils/common/src/io/ktor/util/pipeline/Pipeline.kt
39 7 1
public suspend fun readAvailable()
in ktor-io/posix/src/io/ktor/utils/io/ByteReadChannelNative.kt
39 1 3
override fun install()
in ktor-server/ktor-server-core/jvm/src/io/ktor/features/CallId.kt
38 6 2
fun configureServer()
in ktor-server/ktor-server-benchmarks/src/jmh/kotlin/io/ktor/server/benchmarks/IntegrationBenchmark.kt
38 1 0
override fun install()
in ktor-features/ktor-metrics-micrometer/jvm/src/io/ktor/metrics/micrometer/MicrometerMetrics.kt
38 3 2
override fun install()
in ktor-server/ktor-server-core/jvm/src/io/ktor/features/OriginConnectionPoint.kt
37 7 2
fun runProfiler()
in ktor-server/ktor-server-benchmarks/src/jmh/kotlin/io/ktor/server/benchmarks/BenchmarkRunner.kt
37 5 1
public suspend fun readAvailable()
in ktor-io/js/src/io/ktor/utils/io/ByteReadChannelJs.kt
37 1 3
public suspend fun readFully()
in ktor-io/posix/src/io/ktor/utils/io/ByteReadChannelNative.kt
36 1 3
public fun addEventListener()
in ktor-client/ktor-client-core/js/src/io/ktor/client/fetch/LibDom.kt
36 1 3
public fun defaultEnginePipeline()
in ktor-server/ktor-server-host-common/jvm/src/io/ktor/server/engine/DefaultEnginePipeline.kt
35 5 1
public suspend fun readFully()
in ktor-io/posix/src/io/ktor/utils/io/ByteReadChannelNative.kt
35 1 3
override suspend fun performUpgrade()
in ktor-server/ktor-server-jetty/jvm/src/io/ktor/server/jetty/internal/JettyUpgradeImpl.kt
34 2 5
public fun createUpgradeRequestTokenHeader()
in ktor-features/ktor-auth/jvm/src/io/ktor/auth/OAuth1a.kt
34 1 4
public suspend fun readFully()
in ktor-io/js/src/io/ktor/utils/io/ByteReadChannelJs.kt
34 1 3
override fun install()
in ktor-client/ktor-client-core/common/src/io/ktor/client/features/cache/HttpCache.kt
34 8 2
public suspend fun readAvailable()
in ktor-io/common/src/io/ktor/utils/io/ByteReadChannel.kt
33 1 3
public suspend fun readAvailable()
in ktor-io/common/src/io/ktor/utils/io/ByteReadChannel.kt
32 1 1
public suspend fun parseHttpBody()
in ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/HttpBody.kt
32 4 5
public fun new()
in ktor-client/ktor-client-ios/darwin/src/io/ktor/client/engine/ios/certificates/PinnedCertificate.kt
32 5 2
public fun formData()
in ktor-client/ktor-client-core/common/src/io/ktor/client/request/forms/formDsl.kt
32 2 1
public suspend fun readFully()
in ktor-io/common/src/io/ktor/utils/io/ByteReadChannel.kt
31 1 3
override fun produceContent()
in ktor-client/ktor-client-apache/jvm/src/io/ktor/client/engine/apache/ApacheRequestProducer.kt
31 6 2
public fun scheduleRequest()
in ktor-client/ktor-client-curl/posix/src/io/ktor/client/engine/curl/internal/CurlMultiApiHandler.kt
31 2 1
public fun addEventListener()
in ktor-client/ktor-client-core/js/src/io/ktor/client/fetch/LibDom.kt
31 1 3
override fun getEngineHeaderValues()
in ktor-server/ktor-server-cio/jvm/src/io/ktor/server/cio/CIOApplicationResponse.kt
30 9 1
override suspend fun respondUpgrade()
in ktor-server/ktor-server-netty/jvm/src/io/ktor/server/netty/http1/NettyHttp1ApplicationResponse.kt
30 2 1
protected open suspend fun respondOutgoingContent()
in ktor-server/ktor-server-host-common/jvm/src/io/ktor/server/engine/BaseApplicationResponse.kt
30 1 1
fun submitAndAwait()
in ktor-io/jvm/src/io/ktor/utils/io/jvm/javaio/Blocking.kt
30 2 1