firebase / firebase-android-sdk
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 9,003 units with 78,858 lines of code in units (65.4% of code).
    • 12 very long units (1,701 lines of code)
    • 105 long units (6,877 lines of code)
    • 662 medium size units (19,452 lines of code)
    • 1,373 small units (19,868 lines of code)
    • 6,851 very small units (30,960 lines of code)
2% | 8% | 24% | 25% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java2% | 8% | 24% | 24% | 39%
kt0% | 0% | 30% | 39% | 29%
cpp0% | 0% | 18% | 46% | 34%
py0% | 0% | 15% | 35% | 48%
h0% | 0% | 0% | 35% | 64%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
buildSrc22% | 23% | 21% | 16% | 15%
firebase-database2% | 11% | 25% | 23% | 36%
firebase-storage7% | 15% | 30% | 17% | 30%
firebase-inappmessaging-display5% | 6% | 25% | 21% | 40%
firebase-inappmessaging4% | 0% | 18% | 30% | 46%
firebase-firestore0% | 5% | 23% | 26% | 43%
encoders0% | 27% | 18% | 17% | 36%
firebase-ml-modeldownloader0% | 26% | 16% | 30% | 25%
transport0% | 11% | 30% | 21% | 36%
firebase-messaging0% | 6% | 26% | 26% | 40%
firebase-perf0% | 2% | 28% | 26% | 42%
firebase-segmentation0% | 50% | 20% | 9% | 19%
firebase-crashlytics0% | 3% | 22% | 33% | 40%
firebase-functions0% | 32% | 29% | 20% | 17%
appcheck0% | 12% | 16% | 27% | 43%
firebase-installations0% | 9% | 30% | 26% | 33%
firebase-config0% | 2% | 28% | 28% | 40%
firebase-appdistribution0% | 0% | 37% | 23% | 39%
firebase-components0% | 0% | 24% | 28% | 46%
firebase-common0% | 0% | 18% | 28% | 53%
firebase-database-collection0% | 0% | 19% | 23% | 57%
firebase-dynamic-links0% | 0% | 19% | 13% | 67%
firebase-crashlytics-ndk0% | 0% | 13% | 38% | 47%
tools0% | 0% | 40% | 21% | 37%
ci0% | 0% | 15% | 35% | 48%
firebase-abt0% | 0% | 17% | 32% | 50%
integ-testing0% | 0% | 22% | 29% | 47%
firebase-messaging-directboot0% | 0% | 28% | 14% | 57%
firebase-appdistribution-stub0% | 0% | 0% | 0% | 100%
macrobenchmark0% | 0% | 0% | 0% | 100%
apk-size0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected void onCreate()
in firebase-storage/test-app/src/main/java/com/example/storage/MainActivity.java
261 9 1
public String generateVersionUpdate()
in buildSrc/src/main/java/com/google/firebase/gradle/bomgenerator/RecipeVersionWriter.java
206 1 0
public void apply()
in buildSrc/src/main/java/com/google/firebase/gradle/MultiProjectReleasePlugin.java
164 9 1
private static void applyDoclava()
in buildSrc/src/main/java/com/google/firebase/gradle/plugins/JavadocPlugin.java
148 13 1
public void apply()
in buildSrc/src/main/java/com/google/firebase/gradle/plugins/publish/PublishingPlugin.java
142 5 1
private void inflateBinding()
in firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/FirebaseInAppMessagingDisplay.java
121 17 2
public Flowable createFirebaseInAppMessageStream()
in firebase-inappmessaging/src/main/java/com/google/firebase/inappmessaging/internal/InAppMessageStreamManager.java
120 8 0
private static boolean deepEquals()
in firebase-database/src/testUtil/java/com/google/firebase/database/DeepEquals.java
114 34 3
public static Task streamDownload()
in firebase-storage/src/testUtil/java/com/google/firebase/storage/TestDownloadHelper.java
108 12 4
private void rerunTransactionQueue()
in firebase-database/src/main/java/com/google/firebase/database/core/Repo.java
107 12 2
private void deferredInitialization()
in firebase-database/src/main/java/com/google/firebase/database/core/Repo.java
105 3 0
public ProcessorResult applyOperation()
in firebase-database/src/main/java/com/google/firebase/database/core/view/ViewProcessor.java
105 11 4
public boolean onTouch()
in firebase-inappmessaging-display/src/main/java/com/google/firebase/inappmessaging/display/internal/SwipeDismissTouchListener.java
99 24 2
private static void setupApiInformationAnalysis()
in buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseJavaLibraryPlugin.java
94 3 1
private Task getCustomModelTask()
in firebase-ml-modeldownloader/src/main/java/com/google/firebase/ml/modeldownloader/FirebaseModelDownloader.java
92 17 3
public List addEventRegistration()
in firebase-database/src/main/java/com/google/firebase/database/core/SyncTree.java
92 20 1
public void startTransaction()
in firebase-database/src/main/java/com/google/firebase/database/core/Repo.java
92 9 3
JsonValueObjectEncoderContext add()
in encoders/firebase-encoders-json/src/main/java/com/google/firebase/encoders/json/JsonValueObjectEncoderContext.java
91 27 2
private static void setupApiInformationAnalysis()
in buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseLibraryPlugin.java
90 4 2
public Operation nextOperation()
in firebase-database/src/testUtil/java/com/google/firebase/database/core/RandomOperationGenerator.java
88 21 0