awslabs / tecli
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 215 units with 3,115 lines of code in units (43.6% of code).
    • 2 very long units (365 lines of code)
    • 7 long units (489 lines of code)
    • 25 medium size units (806 lines of code)
    • 66 small units (941 lines of code)
    • 115 very small units (514 lines of code)
11% | 15% | 25% | 30% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go11% | 15% | 25% | 30% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cobra/controller24% | 13% | 31% | 18% | 11%
cobra/aid0% | 27% | 22% | 37% | 12%
box0% | 0% | 56% | 0% | 43%
helper0% | 0% | 14% | 54% | 32%
cobra/dao0% | 0% | 0% | 95% | 4%
cobra/view0% | 0% | 0% | 45% | 55%
cobra/cmd0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func workspaceRun()
in cobra/controller/workspace.go
185 53 2
func runRun()
in cobra/controller/run.go
180 50 2
func variableRun()
in cobra/controller/variable.go
87 24 2
func GetWorkspaceCreateOptions()
in cobra/aid/workspace.go
84 22 1
func GetWorkspaceUpdateOptions()
in cobra/aid/workspace.go
75 19 1
func GetOAuthClientCreateOptions()
in cobra/aid/oAuthClient.go
70 21 1
func sshKeyRun()
in cobra/controller/sshKey.go
63 17 2
func configurationVersionRun()
in cobra/controller/configurationVersion.go
57 15 2
func GetVariableCreateOptions()
in cobra/aid/variable.go
53 16 1
func main()
in box/gen.go
50 10 0
func oAuthTokenRun()
in cobra/controller/oAuthToken.go
50 13 2
func oAuthClientRun()
in cobra/controller/oAuthClient.go
47 12 2
func GetVariableUpdateOptions()
in cobra/aid/variable.go
46 13 1
func GetCredentialProfileFlags()
in cobra/aid/configure.go
46 13 1
func configureRun()
in cobra/controller/configure.go
42 12 2
func SetWorkspaceFlags()
in cobra/aid/workspace.go
41 12 1
func configureCreateCredentials()
in cobra/controller/configure.go
36 11 2
func workspacePreRun()
in cobra/controller/workspace.go
34 7 2
func sshKeyPreRun()
in cobra/controller/sshKey.go
34 13 2
func GetVCSRepoFlags()
in cobra/aid/workspace.go
32 9 1