firebase / quickstart-cpp
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 331 units with 2,879 lines of code in units (37.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (58 lines of code)
    • 26 medium size units (654 lines of code)
    • 67 small units (900 lines of code)
    • 237 very small units (1,267 lines of code)
0% | 2% | 22% | 31% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 17% | 11% | 44% | 26%
cc0% | 0% | 26% | 27% | 45%
mm0% | 0% | 10% | 39% | 49%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
auth0% | 9% | 26% | 28% | 35%
storage0% | 0% | 24% | 27% | 48%
messaging0% | 0% | 30% | 32% | 37%
dynamic_links0% | 0% | 19% | 41% | 39%
firestore0% | 0% | 19% | 33% | 47%
functions0% | 0% | 21% | 34% | 44%
database0% | 0% | 16% | 26% | 56%
admob0% | 0% | 19% | 31% | 48%
analytics0% | 0% | 22% | 31% | 45%
remote_config0% | 0% | 23% | 31% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static String readText()
in auth/testapp/src/android/java/com/google/firebase/example/TextEntryField.java
58 4 4
std::string ReadTextInput()
in auth/testapp/src/ios/ios_main.mm
38 4 3
public static void initLogWindow()
in storage/testapp/src/android/java/com/google/firebase/example/LoggingUtils.java
36 4 2
static bool WaitForFuture()
in messaging/testapp/src/common_main.cc
29 7 4
std::string ReadText()
in auth/testapp/src/android/android_main.cc
28 4 3
static bool WaitForFuture()
in auth/testapp/src/common_main.cc
27 7 4
jclass FindClass()
in remote_config/testapp/src/android/android_main.cc
25 3 3
jclass FindClass()
in firestore/testapp/src/android/android_main.cc
25 3 3
jclass FindClass()
in storage/testapp/src/android/android_main.cc
25 3 3
std::string PathForResource()
in storage/testapp/src/desktop/desktop_main.cc
25 9 0
jclass FindClass()
in auth/testapp/src/android/android_main.cc
25 3 3
jclass FindClass()
in messaging/testapp/src/android/android_main.cc
25 3 3
jclass FindClass()
in analytics/testapp/src/android/android_main.cc
25 3 3
jclass FindClass()
in functions/testapp/src/android/android_main.cc
25 3 3
jclass FindClass()
in dynamic_links/testapp/src/android/android_main.cc
25 3 3
jclass FindClass()
in database/testapp/src/android/android_main.cc
25 3 3
jclass FindClass()
in admob/testapp/src/android/android_main.cc
25 3 3
static void LogVariantMap()
in auth/testapp/src/common_main.cc
23 5 2
void CheckJNIException()
in remote_config/testapp/src/android/android_main.cc
22 2 0
void CheckJNIException()
in firestore/testapp/src/android/android_main.cc
22 2 0