awslabs / smithy-kotlin
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 544 units with 4,548 lines of code in units (31.8% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (300 lines of code)
    • 33 medium size units (985 lines of code)
    • 83 small units (1,185 lines of code)
    • 423 very small units (2,078 lines of code)
0% | 6% | 21% | 26% | 45%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
kt0% | 6% | 21% | 26% | 45%
kts0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
smithy-kotlin-codegen/src0% | 14% | 33% | 28% | 23%
runtime/serde0% | 0% | 10% | 23% | 65%
runtime/protocol0% | 0% | 19% | 24% | 55%
runtime/runtime-core0% | 0% | 33% | 8% | 57%
runtime/io0% | 0% | 0% | 25% | 74%
runtime/testing0% | 0% | 0% | 53% | 46%
dokka-smithy/src0% | 0% | 0% | 100% | 0%
ktlint-rules/src0% | 0% | 0% | 36% | 63%
runtime/utils0% | 0% | 0% | 0% | 100%
runtime/logging0% | 0% | 0% | 0% | 100%
runtime0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fun generateProtocolTests()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpProtocolTestGenerator.kt
72 3 0
override fun getFieldDescriptorTraits()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/serde/XmlSerdeDescriptorGenerator.kt
65 8 3
fun writeGradleBuild()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/GradleGenerator.kt
55 5 3
protected open fun renderOperationSetup()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpProtocolClientGenerator.kt
54 5 3
protected open fun renderUri()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGenerator.kt
54 6 3
fun buildRfc5322Formatter()
in runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt
49 1 0
override fun objectNode()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/ShapeValueGenerator.kt
48 4 1
fun renderKmpGradleBuild()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/GradleGenerator.kt
44 3 6
protected fun deserializerForShape()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/serde/DeserializeStructGenerator.kt
43 1 1
protected open fun renderHttpSerialize()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpBindingProtocolGenerator.kt
43 4 3
fun render()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/protocol/HttpStringValuesMapSerializer.kt
43 6 1
fun render()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/EnumGenerator.kt
42 3 0
override fun render()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/serde/AbstractSerdeDescriptorGenerator.kt
37 5 0
fun renderJvmGradleBuild()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/GradleGenerator.kt
37 2 6
fun parseDom()
in runtime/serde/serde-xml/common/src/aws/smithy/kotlin/runtime/serde/xml/dom/XmlNode.kt
34 4 1
fun execute()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/CodegenVisitor.kt
33 2 0
fun render()
in smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/ServiceGenerator.kt
32 1 0
suspend fun dumpRequest()
in runtime/protocol/http/common/src/aws/smithy/kotlin/runtime/http/request/HttpRequestBuilder.kt
30 4 2
override fun hasNextElement()
in runtime/serde/serde-xml/common/src/aws/smithy/kotlin/runtime/serde/xml/XmlDeserializer.kt
29 10 0
override fun findNextFieldIndex()
in runtime/serde/serde-json/common/src/aws/smithy/kotlin/runtime/serde/json/JsonDeserializer.kt
26 3 0