aws-samples / streaming-analytics-workshop
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 32 units with 1,196 lines of code in units (60.5% of code).
    • 5 very long units (735 lines of code)
    • 2 long units (175 lines of code)
    • 3 medium size units (80 lines of code)
    • 10 small units (136 lines of code)
    • 12 very small units (70 lines of code)
61% | 14% | 6% | 11% | 5%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts78% | 12% | 3% | 4% | 1%
py29% | 19% | 12% | 24% | 13%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
resources/flink-on-kda/cdk/lib73% | 20% | 0% | 3% | 2%
resources/beam-on-kda/cdk/lib85% | 0% | 8% | 5% | 0%
resources/flink-on-kda37% | 24% | 16% | 8% | 12%
resources/beam-on-kda/cdk/lambda0% | 0% | 0% | 66% | 33%
resources/flink-on-kda/cdk/lambda0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in resources/flink-on-kda/cdk/lib/workshop-infrastructure.ts
237 1 3
constructor()
in resources/beam-on-kda/cdk/lib/windows-dev-environment.ts
158 1 3
def put_alarms()
in resources/flink-on-kda/index.py
122 8 2
constructor()
in resources/beam-on-kda/cdk/lib/github-build-pipeline.ts
109 5 3
constructor()
in resources/flink-on-kda/cdk/lib/github-build-pipeline.ts
109 5 3
constructor()
in resources/flink-on-kda/cdk/lib/build-workshop-resources.ts
96 1 3
def lambda_handler()
in resources/flink-on-kda/index.py
79 18 2
def get_scaling_policies()
in resources/flink-on-kda/index.py
28 3 1
constructor()
in resources/beam-on-kda/cdk/lib/cloud9-dev-environment.ts
27 2 3
def update_parallelism()
in resources/flink-on-kda/index.py
25 2 4
constructor()
in resources/beam-on-kda/cdk/lib/empty-bucket.ts
18 1 3
constructor()
in resources/flink-on-kda/cdk/lib/empty-bucket.ts
18 1 3
def get_resource_id()
in resources/flink-on-kda/index.py
14 2 1
def get_custom_role_arn()
in resources/flink-on-kda/index.py
14 2 1
def download_sources()
in resources/beam-on-kda/cdk/lambda/build-pipeline-helper.py
13 3 2
def download_sources()
in resources/flink-on-kda/cdk/lambda/build-pipeline-helper.py
13 3 2
def notify_build_success()
in resources/beam-on-kda/cdk/lambda/build-pipeline-helper.py
12 2 2
def notify_build_success()
in resources/flink-on-kda/cdk/lambda/build-pipeline-helper.py
12 2 2
def empty_bucket()
in resources/beam-on-kda/cdk/lambda/empty-bucket.py
11 3 2
def empty_bucket()
in resources/flink-on-kda/cdk/lambda/empty-bucket.py
11 3 2