aws-samples / aws-codepipeline-sfn-statemachine-cdk
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 15 units with 620 lines of code in units (84.5% of code).
    • 2 very long units (332 lines of code)
    • 2 long units (125 lines of code)
    • 2 medium size units (73 lines of code)
    • 3 small units (45 lines of code)
    • 6 very small units (45 lines of code)
53% | 20% | 11% | 7% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts61% | 23% | 13% | 2% | 0%
py0% | 0% | 0% | 46% | 53%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
codepipeline89% | 0% | 10% | 0% | 0%
application0% | 100% | 0% | 0% | 0%
initial-setup0% | 0% | 75% | 24% | 0%
integration-test/lambda0% | 0% | 0% | 46% | 53%
application/lambda0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 15 longest units
Unit# linesMcCabe index# params
constructor()
in lib/codepipeline/codepipeline-iam-construct.ts
182 1 3
constructor()
in lib/codepipeline/codepipeline-stack.ts
150 1 3
constructor()
in lib/application/firehose-construct.ts
63 1 3
constructor()
in lib/application/application-stack.ts
62 1 3
constructor()
in lib/codepipeline/codebuild-construct.ts
39 1 3
constructor()
in lib/initial-setup/dev-account-setup-stack.ts
34 1 3
def get_test_status()
in lib/integration-test/lambda/get_test_status.py
20 5 2
def generate_kinesis_events()
in lib/integration-test/lambda/generate_kinesis_events.py
14 3 2
constructor()
in lib/initial-setup/cross-account-iam-stack.ts
11 1 3
def count_s3_records()
in lib/integration-test/lambda/get_test_status.py
10 2 1
def getReferrer()
in lib/integration-test/lambda/generate_kinesis_events.py
9 1 0
def clean_s3()
in lib/integration-test/lambda/delete_s3_objects.py
9 2 2
def verify_file_contents()
in lib/integration-test/lambda/get_test_status.py
6 3 1
function processPayload()
in lib/application/lambda/process-kinesis-event.js
6 1 1
def delete_s3_objects()
in lib/integration-test/lambda/delete_s3_objects.py
5 1 1