awslabs / fargatecli
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 3,880 units with 26,355 lines of code in units (91.8% of code).
    • 1 very long units (111 lines of code)
    • 5 long units (325 lines of code)
    • 48 medium size units (1,455 lines of code)
    • 570 small units (6,474 lines of code)
    • 3,256 very small units (17,990 lines of code)
<1% | 1% | 5% | 24% | 68%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go<1% | 1% | 5% | 24% | 68%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd5% | 10% | 41% | 20% | 21%
ecs0% | 21% | 49% | 17% | 11%
elbv20% | 0% | 9% | 24% | 65%
route530% | 0% | 2% | 27% | 70%
cloudwatchlogs0% | 0% | 61% | 30% | 7%
iam0% | 0% | 86% | 0% | 13%
acm0% | 0% | 3% | 28% | 67%
ec20% | 0% | <1% | 24% | 75%
ecr0% | 0% | 0% | 92% | 7%
docker0% | 0% | 0% | 78% | 21%
git0% | 0% | 0% | 72% | 27%
console0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func getServiceInfo()
in cmd/service_info.go
111 22 1
func createService()
in cmd/service_create.go
85 9 1
func()
in ecs/service.go
71 9 1
func runTask()
in cmd/task_run.go
61 6 1
func()
in ecs/task.go
54 9 1
func listServices()
in cmd/service_list.go
54 11 0
func()
in cmd/lb_create.go
48 5 1
func()
in cmd/certificate_validate.go
48 10 1
func()
in ecs/task_definition.go
46 3 1
func newLBCreateOperation()
in cmd/lb_create.go
46 11 10
44 8 1
func getTaskInfo()
in cmd/task_info.go
43 9 1
func()
in elbv2/listener.go
42 8 1
func destroyService()
in cmd/service_destroy.go
40 8 1
func()
in cloudwatchlogs/log_group.go
39 7 1
func()
in ecs/service.go
38 5 1
func()
in cmd/lb_list.go
35 7 1
func()
in cmd/lb_alias.go
34 5 1
func()
in cmd/certificate_list.go
33 7 1
33 14 2