awslabs / aws-rails-provisioner
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 105 units with 1,464 lines of code in units (54.4% of code).
    • 2 very long units (232 lines of code)
    • 4 long units (296 lines of code)
    • 8 medium size units (220 lines of code)
    • 25 small units (338 lines of code)
    • 66 very small units (378 lines of code)
15% | 20% | 15% | 23% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts34% | 43% | 21% | 0% | 0%
rb0% | 0% | 9% | 42% | 47%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
spec/fixtures/cdk34% | 43% | 21% | 0% | 0%
lib/aws-rails-provisioner0% | 0% | 4% | 47% | 47%
lib/aws-rails-provisioner/views0% | 0% | 17% | 39% | 43%
spec0% | 0% | 36% | 0% | 63%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in spec/fixtures/cdk/multi_service/rails-foo-pipeline-stack.ts
116 1 3
constructor()
in spec/fixtures/cdk/single_service/rails-foo-pipeline-stack.ts
116 1 3
constructor()
in spec/fixtures/cdk/multi_service/rails-no-db-pipeline-stack.ts
84 1 3
constructor()
in spec/fixtures/cdk/no_db/rails-no-db-pipeline-stack.ts
84 1 3
constructor()
in spec/fixtures/cdk/multi_service/rails-foo-fargate-stack.ts
66 1 3
constructor()
in spec/fixtures/cdk/single_service/rails-foo-fargate-stack.ts
62 1 3
constructor()
in spec/fixtures/cdk/multi_service/cdk-sample-init-stack.ts
30 1 3
constructor()
in spec/fixtures/cdk/multi_service/rails-no-db-fargate-stack.ts
30 1 3
constructor()
in spec/fixtures/cdk/single_service/cdk-sample-init-stack.ts
30 1 3
constructor()
in spec/fixtures/cdk/no_db/cdk-sample-init-stack.ts
30 1 3
constructor()
in spec/fixtures/cdk/no_db/rails-no-db-fargate-stack.ts
28 1 3
initialize
in lib/aws-rails-provisioner/db_cluster.rb
27 11 1
services
in lib/aws-rails-provisioner/views/fargate_stack.rb
23 9 0
cdk_fixtures
in spec/spec_helper.rb
22 7 1
initialize
in lib/aws-rails-provisioner/views/pipeline_stack.rb
17 11 1
run
in lib/aws-rails-provisioner/cdk_builder.rb
17 2 0
_init_cdk
in lib/aws-rails-provisioner/cdk_builder.rb
17 5 0
initialize
in lib/aws-rails-provisioner/scaling.rb
17 5 2
_create_default_pg
in lib/aws-rails-provisioner/db_cluster.rb
16 3 1
initialize
in lib/aws-rails-provisioner/service.rb
15 4 2