aws-amplify / amplify-ci-support
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 295 units with 3,369 lines of code in units (50.6% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (275 lines of code)
    • 40 medium size units (1,118 lines of code)
    • 62 small units (917 lines of code)
    • 189 very small units (1,059 lines of code)
0% | 8% | 33% | 27% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 33% | 26% | 30%
ts0% | 0% | 22% | 35% | 41%
js0% | 0% | 0% | 51% | 48%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
integ_test_resources/ios/sdk0% | 14% | 30% | 29% | 26%
integ_test_resources/android/sdk0% | 20% | 53% | 17% | 8%
build_infrastructure/android/stacks0% | 0% | 74% | 11% | 13%
release_artifacts_resources/ios/cdk0% | 0% | 37% | 26% | 36%
integ_test_resources/android/amplify0% | 0% | 39% | 14% | 45%
build_infrastructure/android/amplify_custom_resources0% | 0% | 32% | 34% | 33%
credentials_rotators/npm/stacks0% | 0% | 41% | 26% | 31%
credentials_rotators/npm-token-rotation/src0% | 0% | 22% | 35% | 41%
integ_test_resources/common0% | 0% | 15% | 25% | 59%
credentials_rotators/npm/lambda_functions0% | 0% | 0% | 47% | 52%
integ_test_resources/common/scripts0% | 0% | 0% | 16% | 83%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def setup_custom_authorizer_user_pass()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/iot_stack.py
92 1 1
def __init__()
in src/integ_test_resources/android/sdk/integration/cdk/cdk_integration_tests_android/kinesis_stack.py
70 1 5
def setup_custom_authorizer()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/iot_stack.py
62 5 1
def create_firehose_role()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/firehose_stack.py
51 1 2
def __init__()
in src/integ_test_resources/android/sdk/integration/cdk/cdk_integration_tests_android/pinpoint_stack.py
50 1 5
def __init__()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/mobileclient_stack.py
44 2 5
def __init__()
in src/integ_test_resources/android/amplify/integration/cdk/stacks/amplify_deployer_stack.py
40 3 5
def get_auth_config()
in src/integ_test_resources/android/amplify/integration/cdk/scripts/auth.py
37 3 0
def setup_test_policies()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/iot_stack.py
37 1 2
def __init__()
in src/build_infrastructure/android/stacks/maven_release_stack.py
35 4 5
def setup_identity_pool()
in src/integ_test_resources/android/sdk/integration/cdk/cdk_integration_tests_android/iot_stack.py
35 1 1
def __init__()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/core_stack.py
35 1 5
def _create_artifact_bucket()
in src/build_infrastructure/android/stacks/build_pipeline_stack.py
34 1 2
def __init__()
in src/integ_test_resources/android/sdk/integration/cdk/cdk_integration_tests_android/apigateway_stack.py
33 6 5
def __init__()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/lambda_stack.py
33 1 5
def __init__()
in src/build_infrastructure/android/stacks/build_pipeline_stack.py
32 3 5
def _create_pipeline()
in src/build_infrastructure/android/stacks/build_pipeline_stack.py
31 1 7
def setup_iot_endpoint_provider()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/iot_stack.py
30 1 1
def __init__()
in src/integ_test_resources/ios/sdk/integration/cdk/cdk_integration_tests_ios/kms_stack.py
29 1 5
headers: generateCircleCIHeaders()
in src/credentials_rotators/npm-token-rotation/src/lambda/utils/circleci-helper.ts
29 2 1