firebase / snippets-android
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 660 units with 6,514 lines of code in units (59.1% of code).
    • 3 very long units (363 lines of code)
    • 2 long units (133 lines of code)
    • 61 medium size units (1,655 lines of code)
    • 147 small units (2,196 lines of code)
    • 447 very small units (2,167 lines of code)
5% | 2% | 25% | 33% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java5% | 0% | 31% | 36% | 27%
kt7% | 7% | 10% | 26% | 48%
py0% | 0% | 0% | 50% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
analytics96% | 0% | 0% | 0% | 3%
storage17% | 12% | 18% | 33% | 18%
firestore0% | 3% | 33% | 35% | 27%
mlkit0% | 0% | 61% | 14% | 23%
predictions0% | 0% | 53% | 37% | 9%
auth0% | 0% | 15% | 50% | 34%
database0% | 0% | 19% | 28% | 52%
dynamic-links0% | 0% | 27% | 44% | 27%
appindexing0% | 0% | 21% | 32% | 46%
perf0% | 0% | 24% | 45% | 29%
tasks0% | 0% | 36% | 32% | 30%
ml-functions0% | 0% | 19% | 62% | 18%
dl-invites0% | 0% | 0% | 18% | 81%
scripts0% | 0% | 0% | 50% | 49%
firebaseoptions0% | 0% | 0% | 100% | 0%
test-lab0% | 0% | 0% | 38% | 61%
crashlytics0% | 0% | 0% | 11% | 88%
appcheck0% | 0% | 0% | 14% | 85%
messaging0% | 0% | 0% | 0% | 100%
inappmessaging0% | 0% | 0% | 0% | 100%
functions0% | 0% | 0% | 0% | 100%
admob0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public void enhancedEcommerce()
in analytics/app/src/main/java/com/google/firebase/example/analytics/MainActivity.java
126 1 0
fun enhancedEcommerce()
in analytics/app/src/main/java/com/google/firebase/example/analytics/kotlin/MainActivity.kt
125 1 0
public void includesForUploadFiles()
in storage/app/src/main/java/com/google/firebase/referencecode/storage/StorageActivity.java
112 3 0
fun includesForUploadFiles()
in storage/app/src/main/java/com/google/firebase/referencecode/storage/kotlin/StorageActivity.kt
80 4 0
fun exampleDataCollectionGroup()
in firestore/app/src/main/java/com/google/example/firestore/kotlin/DocSnippets.kt
53 1 0
void runAll()
in firestore/app/src/main/java/com/google/example/firestore/DocSnippets.java
47 3 0
public void includesForDownloadFiles()
in storage/app/src/main/java/com/google/firebase/referencecode/storage/StorageActivity.java
47 1 0
private void detectFaces()
in mlkit/app/src/main/java/com/google/firebase/example/mlkit/FaceDetectionActivity.java
44 6 1
public void exampleData()
in firestore/app/src/main/java/com/google/example/firestore/DocSnippets.java
43 1 0
public void exampleDataCollectionGroup()
in firestore/app/src/main/java/com/google/example/firestore/DocSnippets.java
43 1 0
public void queryStartAtEndAt()
in firestore/app/src/main/java/com/google/example/firestore/DocSnippets.java
41 1 0
private void scanBarcodes()
in mlkit/app/src/main/java/com/google/firebase/example/mlkit/BarcodeScanningActivity.java
38 4 1
private void childEventListenerRecycler()
in database/app/src/main/java/com/google/firebase/referencecode/database/QueryActivity.java
34 1 0
public void basicTaskHandlers()
in tasks/app/src/main/java/com/google/firebase/quickstart/tasks/MainActivity.java
34 3 0
public void startUpdates()
in firestore/app/src/main/java/com/google/example/firestore/SolutionRateLimiting.java
33 5 0
public static void queryHashes()
in firestore/app/src/main/java/com/google/example/firestore/SolutionGeoqueries.java
32 5 0
public void createDynamicLink_Advanced()
in dynamic-links/app/src/main/java/com/google/firebase/quickstart/dynamiclinks/MainActivity.java
31 1 0
private void queryRecentScores()
in database/app/src/main/java/com/google/firebase/referencecode/database/OfflineActivity.java
31 1 0
fun queryHashes()
in firestore/app/src/main/java/com/google/example/firestore/kotlin/SolutionGeoqueries.kt
29 5 0
public void includesForFileMetadata()
in storage/app/src/main/java/com/google/firebase/referencecode/storage/StorageActivity.java
29 1 0