awslabs / aws-dataset-ingestion-metrics-collection-framework
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 62 units with 981 lines of code in units (37.4% of code).
    • 1 very long units (228 lines of code)
    • 3 long units (190 lines of code)
    • 7 medium size units (198 lines of code)
    • 9 small units (126 lines of code)
    • 42 very small units (239 lines of code)
23% | 19% | 20% | 12% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py23% | 19% | 20% | 12% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk_constructs75% | 0% | 0% | 5% | 19%
stacks0% | 47% | 32% | 11% | 9%
definitions0% | 47% | 40% | 0% | 12%
lambda0% | 0% | 45% | 27% | 26%
dataquality0% | 0% | 0% | 30% | 69%
accounts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in cdk_constructs/glue_job_construct.py
228 5 15
75 14 1
def generate_dashboard()
in stacks/metrics_streamer.py
64 13 1
def __init__()
in definitions/definition.py
51 18 2
def provision_metrics_streaming_resources()
in stacks/metrics_streamer.py
46 2 1
def translate_metrics_to_records()
in lambda/metric_stream_producer.py
33 10 5
def translate_clas_to_records()
in lambda/sla_stream_producer.py
26 6 5
def generate_alarms()
in stacks/metrics_streamer.py
26 3 1
def provision_slas_streaming_resources()
in stacks/metrics_streamer.py
24 1 1
def generate_sla_metrics()
in definitions/definition.py
22 4 1
def __init__()
in definitions/definition.py
21 2 2
def deploy_definitions_metadata()
in stacks/centralized_resources.py
19 3 1
def __init__()
in cdk_constructs/lambda_construct.py
17 1 0
def metric_data_queries()
in dataquality/stream.py
15 3 2
def put_metrics()
in lambda/metric_stream_producer.py
14 2 5
def generate_dashboard_sets()
in stacks/metrics_streamer.py
14 4 1
def __init__()
in dataquality/sla.py
13 1 0
def __init__()
in dataquality/metric.py
12 1 0
def get_metric_data()
in lambda/metric_stream_producer.py
11 2 3
def put_slas()
in lambda/sla_stream_producer.py
11 1 5