awslabs / aws-sdk-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 155 units with 1,519 lines of code in units (29.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (327 lines of code)
    • 41 small units (589 lines of code)
    • 104 very small units (603 lines of code)
0% | 0% | 21% | 38% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
kt0% | 0% | 18% | 45% | 36%
kts0% | 0% | 80% | 14% | 5%
swift0% | 0% | 15% | 26% | 58%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
codegen/smithy-aws-swift-codegen0% | 0% | 18% | 44% | 37%
codegen/sdk-codegen0% | 0% | 85% | 14% | 0%
AWSClientRuntime/Sources0% | 0% | 11% | 17% | 70%
scripts0% | 0% | 38% | 15% | 46%
codegen0% | 0% | 0% | 100% | 0%
buildSrc/src0% | 0% | 0% | 100% | 0%
ROOT0% | 0% | 0% | 48% | 52%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
override fun renderInitializers()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSServiceConfig.kt
50 2 1
fun generateSmithyBuild()
in codegen/sdk-codegen/build.gradle.kts
42 2 1
fun discoverServices()
in codegen/sdk-codegen/build.gradle.kts
38 1 0
override fun render()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/restxml/httpResponse/AWSXMLHttpResponseTraitWithoutPayload.kt
36 4 0
override fun render()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/ec2query/httpResponse/AWSEc2QueryHttpResponseTraitWithoutPayload.kt
32 3 0
func tryRequest()
in AWSClientRuntime/Sources/Middlewares/RetryerMiddleware.swift
27 4 6
func generateTargets()
in scripts/generatePackageSwift.swift
27 2 1
override fun otherRuntimeConfigProperties()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/AWSServiceConfig.kt
26 1 0
override fun generateMiddlewareClosure()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/InputTypeGETQueryItemMiddleware.kt
26 4 0
override fun generateProtocolUnitTests()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/restxml/RestXmlProtocolGenerator.kt
23 1 1
override fun render()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/restxml/AWSRestXMLHttpResponseBindingErrorGenerator.kt
20 1 2
override fun writeAdditionalFiles()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/presignable/PresignableGetIntegration.kt
20 2 2
override fun render()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/restjson/AWSRestJson1HttpResponseBindingErrorGeneratable.kt
19 1 2
override fun render()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/awsjson/AWSJsonHttpResponseBindingErrorGenerator.kt
19 1 2
func appendLibTarget()
in codegen/Package.swift
19 1 2
fun runTests()
in buildSrc/src/main/kotlin/software/amazon/smithy/gradle/tasks/ProtocolTestTask.kt
19 2 0
override fun writeAdditionalFiles()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGenerator.kt
18 2 2
override fun render()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/ec2query/httpResponse/AWSEc2QueryHttpResponseBindingErrorGenerator.kt
18 1 2
override fun render()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/middleware/GlacierAccountIdMiddleware.kt
18 2 3
override fun writeAdditionalFiles()
in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/machinelearning/PredictEndpointIntegration.kt
18 1 2