aws-samples / aws-fault-injection-simulator-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 36 units with 1,259 lines of code in units (16.3% of code).
    • 2 very long units (462 lines of code)
    • 3 long units (195 lines of code)
    • 15 medium size units (443 lines of code)
    • 9 small units (121 lines of code)
    • 7 very small units (38 lines of code)
36% | 15% | 35% | 9% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go61% | 0% | 38% | 0% | 0%
ts0% | 65% | 34% | 0% | 0%
py0% | 0% | 25% | 56% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
resources/templates/goad-cdk61% | 0% | 38% | 0% | 0%
resources/templates/goad-redux62% | 0% | 37% | 0% | 0%
resources/code/cdk0% | 64% | 29% | 0% | 6%
resources/templates/rds0% | 100% | 0% | 0% | 0%
resources/templates/eks0% | 100% | 0% | 0% | 0%
resources/templates/vpc0% | 0% | 100% | 0% | 0%
resources/templates/ecs0% | 0% | 100% | 0% | 0%
resources/templates/spot0% | 0% | 14% | 66% | 18%
resources/templates/asg-cdk0% | 0% | 0% | 88% | 12%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func launcher()
in resources/templates/goad-cdk/load-gen/loadgen.go
231 22 4
func launcher()
in resources/templates/goad-redux/go-lambda/load-gen/loadgen.go
231 22 4
constructor()
in resources/code/cdk/cicd/lib/cicd-stack.ts
72 1 3
constructor()
in resources/templates/rds/lib/fis-stack-rds-aurora.ts
64 5 3
constructor()
in resources/templates/eks/lib/eks-stack.ts
59 2 3
func runner()
in resources/templates/goad-cdk/load-gen/loadgen.go
46 3 4
func runner()
in resources/templates/goad-redux/go-lambda/load-gen/loadgen.go
46 3 4
constructor()
in resources/templates/ecs/lib/ecs-stack.ts
44 1 3
constructor()
in resources/templates/vpc/lib/fis-stack-vpc.ts
34 1 3
def main()
in resources/code/cdk/cicd/resources/runExperiment.py
33 4 1
func handler()
in resources/templates/goad-cdk/load-gen/main.go
32 10 1
func handler()
in resources/templates/goad-redux/go-lambda/load-gen/main.go
28 8 1
constructor()
in resources/templates/vpc/lib/fis-stack-asg.ts
24 1 3
func rlimitValidator()
in resources/templates/goad-cdk/load-gen/loadgen.go
23 5 1
func loadgen()
in resources/templates/goad-cdk/load-gen/loadgen.go
23 2 1
func rlimitValidator()
in resources/templates/goad-redux/go-lambda/load-gen/loadgen.go
23 5 1
func loadgen()
in resources/templates/goad-redux/go-lambda/load-gen/loadgen.go
23 2 1
def check_interrupt_notice()
in resources/templates/spot/assets/send_metrics.py
22 4 0
func main()
in resources/templates/goad-cdk/load-gen/main.go
21 6 0
func main()
in resources/templates/goad-redux/go-lambda/load-gen/main.go
21 6 0