aws-samples / aws-analytics-reference-architecture
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 437 units with 7,558 lines of code in units (63.6% of code).
    • 11 very long units (2,260 lines of code)
    • 25 long units (1,766 lines of code)
    • 47 medium size units (1,605 lines of code)
    • 45 small units (637 lines of code)
    • 309 very small units (1,290 lines of code)
29% | 23% | 21% | 8% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py41% | 24% | 19% | 7% | 6%
ts32% | 40% | 10% | 8% | 7%
java7% | 0% | 24% | 10% | 57%
scala0% | 20% | 60% | 10% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
refarch/aws-native/common46% | 15% | 28% | 5% | 4%
refarch/aws-native/streaming36% | 0% | 20% | 12% | 31%
refarch/aws-native/dwh47% | 25% | 20% | 0% | 6%
core/src/data-generator52% | 17% | 20% | 4% | 4%
core/src/emr-eks-platform27% | 28% | 23% | 12% | 7%
refarch/aws-native/batch32% | 56% | 9% | 0% | <1%
core/src41% | 23% | 11% | 11% | 11%
core/src/db-schema-manager9% | 4% | 21% | 9% | 54%
refarch/aws-native/dataviz0% | 64% | 27% | 2% | 5%
core/src/notebook-platform0% | 58% | 8% | 29% | 3%
core/src/synchronous-athena-query0% | 66% | 0% | 22% | 11%
core/src/synchronous-crawler0% | 49% | 0% | 35% | 15%
refarch/aws-native/cicd0% | 0% | 82% | 0% | 17%
core/src/datasets0% | 0% | 0% | 16% | 83%
core/src/common0% | 0% | 0% | 0% | 100%
refarch/aws-native0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in refarch/aws-native/common/common_cdk/stream_data_generator.py
427 2 13
def __init__()
in refarch/aws-native/common/common_cdk/batch_data_generator.py
401 2 9
constructor()
in core/src/data-generator/data-generator.ts
265 2 3
def __init__()
in refarch/aws-native/streaming/streaming_cdk/es_domain.py
196 7 7
private constructor()
in core/src/emr-eks-platform/emr-eks-cluster.ts
188 4 3
def __init__()
in refarch/aws-native/dwh/dwh_cdk/redshift_admin.py
139 4 10
def __init__()
in refarch/aws-native/batch/batch_cdk/raw2clean_job.py
137 3 18
constructor()
in core/src/data-lake-exporter.ts
137 7 3
def __init__()
in refarch/aws-native/dwh/dwh_cdk/dwh_loader.py
134 1 5
def __init__()
in refarch/aws-native/streaming/streaming_cdk/kda_application.py
127 3 8
public Flyway configure()
in core/src/db-schema-manager/resources/flyway-lambda/src/main/java/com/geekoosh/flyway/FlywayService.java
109 33 0
constructor()
in core/src/synchronous-athena-query/synchronous-athena-query.ts
99 2 3
def __init__()
in refarch/aws-native/common/common_cdk/data_lake.py
89 9 4
constructor()
in core/src/data-generator/batch-replayer.ts
88 3 3
constructor()
in core/src/notebook-platform/notebook-platform.ts
87 8 3
def main()
in refarch/aws-native/batch/glue-scripts/raw2clean_hudi.py
86 22 0
def __init__()
in refarch/aws-native/dwh/dwh_cdk/redshift.py
86 1 8
def __init__()
in refarch/aws-native/batch/batch_cdk/crawler.py
79 1 9
constructor()
in core/src/data-lake-storage.ts
77 7 3
def __init__()
in refarch/aws-native/common/common_cdk/audit_trail_glue.py
76 2 8