aws-samples / aws-cdk-intro-workshop
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 78 units with 968 lines of code in units (10.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (81 lines of code)
    • 13 medium size units (401 lines of code)
    • 20 small units (314 lines of code)
    • 44 very small units (172 lines of code)
0% | 8% | 41% | 32% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 24% | 38% | 33% | 3%
cs0% | 0% | 88% | 0% | 11%
java0% | 0% | 31% | 40% | 28%
py0% | 0% | 22% | 45% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdkworkshop.com0% | 50% | 22% | 23% | 3%
code/csharp0% | 0% | 88% | 0% | 11%
code/typescript0% | 0% | 53% | 43% | 3%
code/java0% | 0% | 31% | 40% | 28%
code/python0% | 0% | 22% | 45% | 32%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in cdkworkshop.com/cdkworkshop.com.ts
81 4 3
constructor()
in code/typescript/pipelines-workshop/lib/pipeline-stack.ts
45 1 3
def __init__()
in code/python/pipelines-workshop/cdk_workshop/pipeline_stack.py
43 1 4
public WorkshopPipelineStack()
in code/csharp/pipelines-workshop/src/CdkWorkshop/PipelineStack.cs
38 1 3
constructor()
in cdkworkshop.com/pipeline.ts
37 1 3
public WorkshopPipelineStack()
in code/java/pipelines-workshop/src/main/java/com/myorg/WorkshopPipelineStack.java
36 1 3
public CdkWorkshopStack()
in code/csharp/pipelines-workshop/src/CdkWorkshop/CdkWorkshopStack.cs
30 1 3
public HitCounter()
in code/java/tests-workshop/src/main/java/com/myorg/HitCounter.java
28 4 3
constructor()
in code/typescript/pipelines-workshop/lib/cdk-workshop-stack.ts
25 1 3
public HitCounter()
in code/csharp/main-workshop/src/CdkWorkshop/HitCounter.cs
25 1 3
public HitCounter()
in code/csharp/pipelines-workshop/src/CdkWorkshop/HitCounter.cs
25 1 3
public CdkWorkshopStack()
in code/java/pipelines-workshop/src/main/java/com/myorg/CdkWorkshopStack.java
24 1 3
constructor()
in code/typescript/tests-workshop/lib/hitcounter.ts
23 3 3
public CdkWorkshopStack()
in code/csharp/main-workshop/src/CdkWorkshop/CdkWorkshopStack.cs
22 1 2
public HitCounter()
in code/java/main-workshop/src/main/java/com/myorg/HitCounter.java
20 1 3
public HitCounter()
in code/java/pipelines-workshop/src/main/java/com/myorg/HitCounter.java
20 1 3
constructor()
in code/typescript/main-workshop/lib/cdk-workshop-stack.ts
19 1 3
constructor()
in code/typescript/pipelines-workshop/lib/hitcounter.ts
19 1 3
constructor()
in code/typescript/tests-workshop/lib/cdk-workshop-stack.ts
19 1 3
public CdkWorkshopStack()
in code/java/main-workshop/src/main/java/com/myorg/CdkWorkshopStack.java
18 1 3