awslabs / smithy-swift
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 430 units with 3,939 lines of code in units (29.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 10 simple units (370 lines of code)
    • 420 very simple units (3,569 lines of code)
0% | 0% | 0% | 9% | 90%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
kt0% | 0% | 0% | 9% | 90%
swift0% | 0% | 0% | 7% | 92%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
smithy-swift-codegen/src0% | 0% | 0% | 9% | 90%
Packages/ClientRuntime0% | 0% | 0% | 8% | 91%
Packages/SmithyTestUtil0% | 0% | 0% | 0% | 100%
buildSrc/src0% | 0% | 0% | 0% | 100%
smithy-swift-codegen-test/expected0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
fun writeAvailableAttribute()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/SwiftWriter.kt
24 8 2
override fun head()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/DocumentationConverter.kt
18 8 2
override fun tail()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/DocumentationConverter.kt
20 8 2
fun renderMemberAssertions()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/HttpProtocolUnitTestResponseGenerator.kt
20 8 7
fun render()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/httpResponse/HttpResponseHeaders.kt
145 8 0
func toLoggerLevel()
in Packages/ClientRuntime/Sources/Logging/SwiftLog+LogAgent.swift
16 7 0
override fun generateSerializers()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/integration/HttpBindingProtocolGenerator.kt
44 7 1
mutating func add()
in Packages/ClientRuntime/Sources/Middleware/OrderedGroup.swift
16 6 2
func toAwsInputStream()
in Packages/ClientRuntime/Sources/Networking/Http/HttpBody.swift
18 6 0
override fun objectNode()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/ShapeValueGenerator.kt
49 6 1
mutating func insert()
in Packages/ClientRuntime/Sources/Middleware/OrderedGroup.swift
12 5 3
func toCRTType()
in Packages/ClientRuntime/Sources/Retries/ExponentialBackOffJitterMode.swift
8 5 0
func toCRTType()
in Packages/ClientRuntime/Sources/Retries/RetryError.swift
8 5 0
override fun structureShape()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/SymbolVisitor.kt
13 5 1
fun computeAbsolutePath()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/resources/Resources.kt
17 5 3
fun renderOperationDefinition()
in smithy-swift-codegen/src/main/kotlin/software/amazon/smithy/swift/codegen/ServiceGenerator.kt
29 5 6
func dateFormatted()
in Packages/ClientRuntime/Sources/Serialization/SerializationUtils/TimestampWrapper.swift
11 4 0
init()
in Packages/ClientRuntime/Sources/PrimitiveTypeExtensions/Data+Extensions.swift
21 4 1
func encoded()
in Packages/ClientRuntime/Sources/PrimitiveTypeExtensions/Number+Extension.swift
10 4 0
func encoded()
in Packages/ClientRuntime/Sources/PrimitiveTypeExtensions/Number+Extension.swift
10 4 0