aws / ec2-macos-utils
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 82 units with 810 lines of code in units (67.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (219 lines of code)
    • 23 small units (306 lines of code)
    • 53 very small units (285 lines of code)
0% | 0% | 27% | 37% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 0% | 27% | 37% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
internal/cmd0% | 0% | 60% | 19% | 20%
internal/util0% | 0% | 88% | 11% | 0%
internal/diskutil0% | 0% | 15% | 42% | 41%
internal/system0% | 0% | 0% | 67% | 32%
internal/diskutil/types0% | 0% | 0% | 91% | 8%
internal/cmd/gen-docs0% | 0% | 0% | 100% | 0%
cmd/ec2-macos-utils0% | 0% | 0% | 100% | 0%
internal/diskutil/mocks0% | 0% | 0% | 0% | 100%
internal/contextual0% | 0% | 0% | 0% | 100%
internal/diskutil/identifier0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func getUIDandGID()
in internal/util/util.go
49 11 1
func GrowContainer()
in internal/diskutil/grow.go
49 10 2
func growContainerCommand()
in internal/cmd/grow_container.go
38 5 0
func ExecuteCommand()
in internal/util/util.go
35 8 4
func rootCommand()
in internal/cmd/root.go
27 3 0
func run()
in internal/cmd/grow_container.go
21 4 2
func()
in internal/diskutil/types/partitions.go
17 5 1
func()
in internal/system/product.go
16 6 1
func getVersionRelease()
in internal/system/product.go
16 6 1
func main()
in internal/cmd/gen-docs/main.go
16 4 0
func Scan()
in internal/system/system.go
15 3 0
func repairParentDisk()
in internal/diskutil/grow.go
15 4 2
func validateDeviceID()
in internal/cmd/grow_container.go
15 5 2
func ForProduct()
in internal/diskutil/diskutil.go
14 5 1
func canAPFSResize()
in internal/diskutil/grow.go
14 6 1
func()
in internal/diskutil/types/disk.go
14 4 1
func main()
in cmd/ec2-macos-utils/main.go
14 4 0
func updatePhysicalStores()
in internal/diskutil/mojave.go
13 4 1
func getTargetDiskInfo()
in internal/cmd/grow_container.go
13 4 2
func readProductVersionFile()
in internal/system/system.go
12 3 1