awslabs / smithy-ruby
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 1,565 units with 13,612 lines of code in units (47.6% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (492 lines of code)
    • 124 medium size units (3,897 lines of code)
    • 187 small units (2,623 lines of code)
    • 1,246 very small units (6,600 lines of code)
0% | 3% | 28% | 19% | 48%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 5% | 23% | 30% | 40%
rb0% | 2% | 31% | 11% | 53%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
codegen/smithy-ruby-codegen0% | 4% | 25% | 31% | 38%
codegen/projections0% | 2% | 36% | 9% | 51%
codegen/smithy-ruby-rails-codegen0% | 5% | 16% | 29% | 47%
seahorse/lib0% | 0% | 0% | 31% | 68%
seahorse/spec0% | 0% | 0% | 61% | 38%
sample-service/app0% | 0% | 0% | 0% | 100%
sample-service/db0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static ApplicationTransport createDefaultHttpApplicationTransport()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/ApplicationTransport.java
86 2 0
public CodegenOrchestrator()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/CodegenOrchestrator.java
77 4 1
public void addDefaultMiddleware()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/middleware/MiddlewareBuilder.java
65 1 1
self.build
in codegen/projections/rails_json/lib/rails_json/builders.rb
59 38 2
initialize
in codegen/projections/weather/lib/weather/waiters.rb
52 3 2
self.stub
in codegen/projections/rails_json/lib/rails_json/stubs.rb
51 28 2
self.build
in codegen/projections/rails_json/lib/rails_json/builders.rb
51 28 2
private void renderErrorCodeFromStatusCode()
in codegen/smithy-ruby-rails-codegen/src/main/java/software/amazon/smithy/ruby/codegen/protocol/railsjson/generators/ErrorsGenerator.java
51 1 0
self.error_code
in codegen/projections/high_score_service/lib/high_score_service/errors.rb
50 47 1
self.build
in codegen/projections/rails_json/lib/rails_json/params.rb
50 15 2
protected void renderUriBuilder()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/RestBuilderGeneratorBase.java
47 7 2
self.parse
in codegen/projections/rails_json/lib/rails_json/parsers.rb
46 17 1
initialize
in codegen/projections/white_label/lib/white_label/waiters.rb
46 4 2
public Void unionShape()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/ParamsGenerator.java
44 2 1
public void render()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/ClientGenerator.java
39 3 0
public Void timestampShape()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/RestBuilderGeneratorBase.java
39 6 1
private void renderStructureToSMethod()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/TypesGenerator.java
38 8 1
public Void structureShape()
in codegen/smithy-ruby-codegen/src/main/java/software/amazon/smithy/ruby/codegen/generators/TypesGenerator.java
36 2 1
create_high_score
in codegen/projections/high_score_service/lib/high_score_service/client.rb
35 2 3
delete_high_score
in codegen/projections/high_score_service/lib/high_score_service/client.rb
35 2 3