awslabs / smithy-typescript
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 684 units with 7,730 lines of code in units (71.3% of code).
    • 0 very long units (0 lines of code)
    • 12 long units (699 lines of code)
    • 94 medium size units (2,836 lines of code)
    • 149 small units (2,226 lines of code)
    • 429 very small units (1,969 lines of code)
0% | 9% | 36% | 28% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 9% | 37% | 28% | 24%
ts0% | 0% | 0% | 24% | 75%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
smithy-typescript-codegen/src/main/java0% | 9% | 37% | 28% | 24%
smithy-typescript-ssdk-libs/server-apigateway/src0% | 0% | 0% | 36% | 63%
smithy-typescript-ssdk-libs/server-common/src/validation0% | 0% | 0% | 0% | 100%
smithy-typescript-ssdk-libs/server-common/src/httpbinding0% | 0% | 0% | 0% | 100%
smithy-typescript-codegen/src/main/resources0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static void generateServiceHandler()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServerGenerator.java
75 2 4
static Set generateErrorDispatcher()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpProtocolGeneratorUtils.java
73 4 6
static void generateOperationHandler()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServerGenerator.java
70 1 4
private void writeMemberValidator()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructuredMemberWriter.java
58 7 4
private static void writeHandleFunction()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServerGenerator.java
56 1 1
void execute()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenVisitor.java
55 8 0
private void generateClientDefaults()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceBareBonesClientGenerator.java
53 3 0
private void generateOperationRequestSerializer()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java
53 5 3
public void run()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceAggregatedClientGenerator.java
52 2 0
public Void serviceShape()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenVisitor.java
52 10 1
public Void objectNode()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java
51 12 1
public String toString()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ImportDeclarations.java
51 12 0
private List readBody()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java
50 11 6
public void generateServiceHandlerFactory()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java
48 3 1
private void readPath()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java
47 7 4
private void generateOperationResponseDeserializer()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java
45 1 3
private void generateUriSpec()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java
44 9 3
private void writeServerResponseTest()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java
43 1 2
private void generateOperationRequestDeserializer()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java
43 1 3
private void readMappedQueryBindings()
in smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java
42 3 2