awslabs / smithy-swift
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 430 units with 3,939 lines of code in units (29.1% of code).
    • 1 very long units (145 lines of code)
    • 1 long units (52 lines of code)
    • 37 medium size units (1,151 lines of code)
    • 70 small units (1,027 lines of code)
    • 321 very small units (1,564 lines of code)
3% | 1% | 29% | 26% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
kt4% | 1% | 34% | 27% | 32%
swift0% | 0% | 3% | 19% | 77%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
smithy-swift-codegen/src4% | 1% | 34% | 26% | 32%
Packages/ClientRuntime0% | 0% | 3% | 13% | 83%
Packages/SmithyTestUtil0% | 0% | 0% | 80% | 20%
buildSrc/src0% | 0% | 0% | 100% | 0%
smithy-swift-codegen-test/expected0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/httpResponse/HttpResponseHeaders.kt
145 8 0
override fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/httpResponse/bindingTraits/HttpResponseTraitWithHttpPayload.kt
52 4 0
override fun objectNode()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/ShapeValueGenerator.kt
49 6 1
fun renderDecodeListMember()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/json/MemberShapeDecodeGenerator.kt
46 3 5
fun renderEncodeListMember()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/json/MemberShapeEncodeGenerator.kt
46 4 4
override fun generateSerializers()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/HttpBindingProtocolGenerator.kt
44 7 1
override fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/httpResponse/HttpResponseBindingErrorInitGenerator.kt
40 1 0
fun renderMapMember()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/xml/MemberShapeDecodeXMLGenerator.kt
39 3 4
fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/httpResponse/HttpResponseBindingErrorNarrowGenerator.kt
38 2 0
override fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/xml/UnionDecodeXMLGenerator.kt
37 1 0
fun renderListMember()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/xml/MemberShapeDecodeXMLGenerator.kt
37 2 4
fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/HttpProtocolServiceClient.kt
36 2 1
fun renderDecodeMapMember()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/json/MemberShapeDecodeGenerator.kt
35 3 5
override fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/httpResponse/bindingTraits/HttpResponseTraitWithoutHttpPayload.kt
35 3 0
fun execute()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/model/AddOperationShapes.kt
34 2 3
fun execute()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/CodegenVisitor.kt
34 1 0
override fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/xml/UnionEncodeXMLGenerator.kt
34 1 0
fun generate()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/MiddlewareGenerator.kt
32 1 0
fun renderQueryMiddleware()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/middlewares/handlers/HttpQueryItemMiddleware.kt
31 3 4
override fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/serde/json/StructEncodeGenerator.kt
31 2 0