bazelbuild / codelabs
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 29 units with 222 lines of code in units (62.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (24 lines of code)
    • 3 small units (48 lines of code)
    • 25 very small units (150 lines of code)
0% | 0% | 10% | 21% | 67%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 0% | 22% | 11% | 65%
go0% | 0% | 0% | 27% | 72%
ts0% | 0% | 0% | 36% | 63%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
android/src/main/java/bazel/bootcamp0% | 0% | 42% | 0% | 57%
go/cmd/server0% | 0% | 0% | 27% | 72%
typescript0% | 0% | 0% | 36% | 63%
java/src/main/java/bazel/bootcamp0% | 0% | 0% | 24% | 75%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected String doInBackground()
in android/src/main/java/bazel/bootcamp/AndroidLoggingClientActivity.java
24 4 1
func createJSONResponse()
in go/cmd/server/server.go
19 3 0
private displayServerLogs()
in typescript/app.ts
17 2 1
public static void main()
in java/src/main/java/bazel/bootcamp/JavaLoggingClient.java
12 2 1
func startGrpc()
in go/cmd/server/server.go
10 2 0
public void sendLogMessageToServer()
in java/src/main/java/bazel/bootcamp/JavaLoggingClientLibrary.java
10 2 1
protected void onCreate()
in android/src/main/java/bazel/bootcamp/AndroidLoggingClientActivity.java
10 1 1
protected void onPostExecute()
in android/src/main/java/bazel/bootcamp/AndroidLoggingClientActivity.java
10 2 1
private checkStatus()
in typescript/app.ts
9 3 1
public void sendMessage()
in android/src/main/java/bazel/bootcamp/AndroidLoggingClientActivity.java
9 1 1
private timestampToString()
in typescript/app.ts
8 1 1
func()
in go/cmd/server/server.go
8 1 1
func writeToFile()
in go/cmd/server/server.go
8 2 1
func main()
in go/cmd/server/server.go
8 1 0
func handleStrings()
in go/cmd/server/server.go
7 1 2
private throwError()
in typescript/app.ts
6 1 1
public JavaLoggingClientLibrary()
in java/src/main/java/bazel/bootcamp/JavaLoggingClientLibrary.java
6 1 2
func saveLogMessage()
in go/cmd/server/server.go
5 1 1
func startHTTP()
in go/cmd/server/server.go
5 1 0
private parseJSON()
in typescript/app.ts
4 1 1