aws-samples / aws-cdk-examples-proserve
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 35 units with 562 lines of code in units (22.5% of code).
    • 2 very long units (236 lines of code)
    • 1 long units (89 lines of code)
    • 3 medium size units (116 lines of code)
    • 2 small units (39 lines of code)
    • 27 very small units (82 lines of code)
41% | 15% | 20% | 6% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts53% | 20% | 20% | 4% | <1%
go0% | 0% | 68% | 0% | 31%
py0% | 0% | 0% | 22% | 77%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
iis-smbshare-sqlserver/typescript/lib56% | 21% | 21% | 0% | <1%
hello-world/go0% | 0% | 68% | 0% | 31%
typescript/api-swagger-lambda0% | 0% | 0% | 100% | 0%
python/api-swagger-lambda0% | 0% | 0% | 100% | 0%
python/elasticache/config0% | 0% | 0% | 0% | 100%
python/api-swagger-lambda/lambda0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in iis-smbshare-sqlserver/typescript/lib/constructs/windows-autoscaling-stack.ts
128 4 4
constructor()
in iis-smbshare-sqlserver/typescript/lib/cdk-iis-smbshare-fileshare-sqlserver.ts
108 4 3
constructor()
in iis-smbshare-sqlserver/typescript/lib/constructs/ad-fsx-smbshare-stack.ts
89 2 3
constructor()
in iis-smbshare-sqlserver/typescript/lib/constructs/alb-stack.ts
47 2 4
constructor()
in iis-smbshare-sqlserver/typescript/lib/constructs/bastion-stack.ts
43 1 4
func NewHelloWorldStack()
in hello-world/go/hello-world.go
26 2 3
constructor()
in typescript/api-swagger-lambda/index.ts
20 1 2
def __init__()
in python/api-swagger-lambda/app.py
19 1 4
func main()
in hello-world/go/hello-world.go
9 1 0
def handler()
in python/api-swagger-lambda/lambda/index.py
8 1 2
def get_user_group_id()
in python/elasticache/config/config_util.py
6 2 0
def get_cmk()
in python/elasticache/config/config_util.py
6 2 0
def get_auth_token_enabled()
in python/elasticache/config/config_util.py
6 2 0
public addListener()
in iis-smbshare-sqlserver/typescript/lib/constructs/alb-stack.ts
4 1 2
func env()
in hello-world/go/hello-world.go
3 1 0
def get_secret_config()
in python/elasticache/config/config_util.py
2 1 0
def get_transit_encryption()
in python/elasticache/config/config_util.py
2 1 0
def get_at_rest_encryption()
in python/elasticache/config/config_util.py
2 1 0
def get_log_group_retention_limit()
in python/elasticache/config/config_util.py
2 1 0
def get_snapshot_window()
in python/elasticache/config/config_util.py
2 1 0