awslabs / ssosync
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 59 units with 1,177 lines of code in units (74.3% of code).
    • 1 very long units (149 lines of code)
    • 2 long units (145 lines of code)
    • 22 medium size units (592 lines of code)
    • 10 small units (158 lines of code)
    • 24 very small units (133 lines of code)
12% | 12% | 50% | 13% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go12% | 12% | 50% | 13% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
internal29% | 28% | 32% | 3% | 6%
internal/aws0% | 0% | 81% | 14% | 3%
cmd0% | 0% | 55% | 27% | 17%
internal/config0% | 0% | 44% | 0% | 55%
internal/google0% | 0% | 0% | 75% | 24%
internal/aws/mock0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in internal/sync.go
149 32 1
func()
in internal/sync.go
74 14 1
func()
in internal/sync.go
71 19 1
func DoSync()
in internal/sync.go
49 10 2
func()
in internal/sync.go
41 9 1
func()
in internal/aws/client.go
34 8 1
func()
in internal/aws/client.go
31 5 1
func initConfig()
in cmd/root.go
30 5 0
func getUserOperations()
in internal/sync.go
29 10 2
func UpdateUser()
in internal/aws/users.go
28 1 5
func()
in internal/aws/client.go
27 6 1
func NewUser()
in internal/aws/users.go
27 1 4
func()
in internal/aws/client.go
26 6 1
func configLambda()
in cmd/root.go
25 5 0
func()
in internal/aws/client.go
24 5 1
func()
in internal/aws/client.go
24 5 1
func()
in internal/aws/client.go
24 6 1
func()
in internal/aws/client.go
24 6 1
func getGroupOperations()
in internal/sync.go
23 7 2
func()
in internal/config/secrets.go
21 4 1