awslabs / aws-simple-cicd
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 20 units with 573 lines of code in units (64.1% of code).
    • 1 very long units (181 lines of code)
    • 0 long units (0 lines of code)
    • 11 medium size units (340 lines of code)
    • 2 small units (31 lines of code)
    • 6 very small units (21 lines of code)
31% | 0% | 59% | 5% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts36% | 0% | 62% | 0% | 1%
py0% | 0% | 39% | 43% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/pipelines100% | 0% | 0% | 0% | 0%
lib/projects0% | 0% | 98% | 0% | 1%
lib0% | 0% | 100% | 0% | 0%
lib/iam0% | 0% | 87% | 0% | 12%
lambda-helpers/semver-handler0% | 0% | 54% | 21% | 23%
lambda-helpers/email-handler0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in lib/pipelines/simple-cicd-pipeline.ts
181 7 3
constructor()
in lib/iam/code-build-role.ts
43 2 3
export function projectEnvironmentVars()
in lib/projects/deploy-project-environment.ts
39 1 1
constructor()
in lib/cicd-stack.ts
33 2 3
constructor()
in lib/semverHandler-stack.ts
33 1 3
constructor()
in lib/projects/test-project.ts
32 1 3
constructor()
in lib/projects/deploy-project.ts
31 1 3
constructor()
in lib/projects/build-project.ts
29 1 3
def semver_handler()
in lambda-helpers/semver-handler/lambda.py
28 2 2
constructor()
in lib/emailHandler-stack.ts
27 1 3
constructor()
in lib/cicd-s3-stack.ts
23 1 3
export function projectEnvironmentVars()
in lib/projects/build-project-environment.ts
22 1 1
def send_codebuild_events_to_sns()
in lambda-helpers/email-handler/lambda.py
20 1 2
def get_user_params()
in lambda-helpers/semver-handler/lambda.py
11 5 1
constructor()
in lib/iam/pipeline-role.ts
6 1 3
def put_job_success()
in lambda-helpers/semver-handler/lambda.py
6 2 2
def put_job_failure()
in lambda-helpers/semver-handler/lambda.py
6 2 2
environmentVariables: projectEnvironmentVars()
in lib/projects/deploy-project.ts
1 1 4
environmentVariables: projectEnvironmentVars()
in lib/projects/build-project.ts
1 1 3
environmentVariables: projectEnvironmentVars()
in lib/projects/test-project.ts
1 1 3