awslabs / smithy-rs
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 1,468 units with 17,104 lines of code in units (33.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (141 lines of code)
    • 20 simple units (746 lines of code)
    • 1,445 very simple units (16,217 lines of code)
0% | 0% | <1% | 4% | 94%
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
rs0% | 0% | 1% | 3% | 95%
kt0% | 0% | 0% | 5% | 94%
py0% | 0% | 0% | 18% | 81%
kts0% | 0% | 0% | 0% | 100%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools0% | 0% | 4% | 10% | 85%
aws0% | 0% | <1% | 2% | 96%
codegen0% | 0% | 0% | 6% | 93%
rust-runtime0% | 0% | 0% | 2% | 97%
codegen-server0% | 0% | 0% | 0% | 100%
codegen-server-test0% | 0% | 0% | 0% | 100%
codegen-test0% | 0% | 0% | 0% | 100%
buildSrc0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
fn headers()
in aws/rust-runtime/aws-sigv4/src/http_request/canonical_request.rs
43 12 4
fn fix_all()
in tools/sdk-lints/src/lint.rs
37 11 2
fn render()
in tools/sdk-lints/src/changelog.rs
61 11 3
fn classify()
in aws/rust-runtime/aws-http/src/retry.rs
40 10 2
def main()
in aws/sdk/test-services.py
19 10 0
fn render()
in tools/sdk-lints/src/changelog.rs
33 9 2
override fun section()
in codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/FluentClientDecorator.kt
125 9 1
fn parse_token_json()
in aws/rust-runtime/aws-config/src/sso.rs
36 9 1
fn parse_imf_fixdate()
in rust-runtime/aws-smithy-types/src/date_time/format.rs
69 8 1
fn decode_inner()
in rust-runtime/aws-smithy-types/src/base64.rs
31 8 1
fn to_connector_error()
in rust-runtime/aws-smithy-client/src/hyper_ext.rs
17 8 1
fn batch_packages()
in tools/publisher/src/package.rs
31 7 1
fn sync_aws_sdk_with_smithy_rs()
in tools/smithy-rs-sync/src/main.rs
71 7 5
def main()
in tools/codegen-diff-revisions.py
26 7 0
override fun section()
in aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/SigV4SigningDecorator.kt
47 7 1
fn from_str()
in rust-runtime/aws-smithy-types/src/retry.rs
12 7 1
fn update_manifest()
in tools/sdk-versioner/src/main.rs
21 6 2
fn name()
in tools/sdk-lints/src/lint.rs
28 6 1
fn files_to_check()
in tools/sdk-lints/src/todos.rs
17 6 1
override fun toSymbol()
in codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/StreamingTraitSymbolProvider.kt
16 6 1