android / search-samples
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 15 units with 125 lines of code in units (38.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (26 lines of code)
    • 3 small units (33 lines of code)
    • 11 very small units (66 lines of code)
0% | 0% | 20% | 26% | 52%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
kt0% | 0% | 20% | 26% | 52%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
appsearchsample0% | 0% | 27% | 11% | 61%
appsearchsample/model0% | 0% | 0% | 75% | 24%
Alternative Visuals
Longest Units
Top 15 longest units
Unit# linesMcCabe index# params
override fun onCreate()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/MainActivity.kt
26 2 1
override fun onCreateViewHolder()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/NoteListItemAdapter.kt
11 1 2
fun addNote()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/model/NoteViewModel.kt
11 2 1
fun removeNote()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/model/NoteViewModel.kt
11 2 2
fun bind()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/NoteListItemAdapter.kt
10 2 2
suspend fun queryLatestNotes()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/NoteAppSearchManager.kt
9 1 1
suspend fun removeNote()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/NoteAppSearchManager.kt
9 1 2
override fun create()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/model/NoteViewModel.kt
7 2 1
override fun areItemsTheSame()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/NoteListItemAdapter.kt
6 2 2
override fun onCreateOptionsMenu()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/MainActivity.kt
6 1 1
suspend fun addNote()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/NoteAppSearchManager.kt
5 1 1
override fun onQueryTextSubmit()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/MainActivity.kt
4 1 1
override fun onQueryTextChange()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/MainActivity.kt
4 2 1
override fun onBindViewHolder()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/NoteListItemAdapter.kt
3 1 2
override fun areContentsTheSame()
in AppSearchSample/app/src/main/java/com/android/example/appsearchsample/NoteListItemAdapter.kt
3 1 2