awslabs / clencli
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 139 units with 1,832 lines of code in units (58.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (76 lines of code)
    • 20 medium size units (627 lines of code)
    • 49 small units (725 lines of code)
    • 69 very small units (404 lines of code)
0% | 4% | 34% | 39% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 4% | 34% | 39% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cobra/aid0% | 11% | 31% | 38% | 19%
cobra/controller0% | 0% | 58% | 31% | 9%
box0% | 0% | 56% | 0% | 43%
helper0% | 0% | 15% | 57% | 27%
cobra/cmd0% | 0% | 49% | 0% | 50%
cobra/view0% | 0% | 14% | 47% | 38%
cobra/dao0% | 0% | 0% | 84% | 15%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func writeInputs()
in cobra/aid/render.go
76 29 0
func main()
in box/gen.go
50 10 0
func writeOutputs()
in cobra/aid/render.go
50 19 0
func initRun()
in cobra/controller/init.go
45 13 2
func TrimRightFile()
in helper/files.go
40 10 2
func unsplashRun()
in cobra/controller/unsplash.go
38 10 2
func DownloadPhotoByID()
in cobra/aid/unsplash.go
37 17 2
func updateLogoFromUnsplashFile()
in cobra/controller/render.go
36 7 0
func updateLogoFromConfigurations()
in cobra/controller/render.go
32 11 1
func GetAppInfo()
in cobra/aid/root.go
30 3 0
func InitCustomized()
in cobra/aid/init.go
29 11 2
func initConfig()
in cobra/cmd/root.go
29 9 0
func renderPreRun()
in cobra/controller/render.go
26 6 2
func askAboutInitialization()
in cobra/view/configure.go
26 6 2
func gitIgnoreRun()
in cobra/controller/gitignore.go
25 7 2
func DownloadPhoto()
in cobra/aid/unsplash.go
25 7 3
func UnsplashCmd()
in cobra/controller/unsplash.go
24 2 0
func BuildTemplate()
in cobra/aid/render.go
22 4 1
func InitCmd()
in cobra/controller/init.go
21 2 0
func configureRun()
in cobra/controller/configure.go
21 5 2