firebase / firebase-cpp-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 5,564 units with 51,195 lines of code in units (50.5% of code).
    • 16 very long units (2,116 lines of code)
    • 67 long units (4,298 lines of code)
    • 458 medium size units (13,731 lines of code)
    • 884 small units (12,818 lines of code)
    • 4,139 very small units (18,232 lines of code)
4% | 8% | 26% | 25% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc3% | 8% | 29% | 26% | 32%
py14% | 20% | 29% | 21% | 15%
java5% | 1% | 21% | 19% | 51%
cpp41% | 18% | 15% | 13% | 10%
mm0% | 7% | 31% | 29% | 31%
h0% | 1% | 3% | 16% | 77%
rb0% | 48% | 0% | 0% | 51%
swift0% | 0% | 47% | 15% | 38%
kt0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
app6% | 4% | 29% | 22% | 36%
scripts11% | 22% | 27% | 20% | 18%
admob12% | 2% | 23% | 26% | 35%
ROOT34% | 12% | 27% | 20% | 5%
firestore2% | 3% | 13% | 21% | 59%
database1% | 13% | 30% | 26% | 28%
performance9% | 0% | 9% | 23% | 57%
storage3% | 5% | 33% | 18% | 39%
auth0% | 7% | 23% | 33% | 34%
dynamic_links0% | 25% | 35% | 20% | 18%
messaging0% | 10% | 36% | 23% | 29%
functions0% | 24% | 36% | 20% | 18%
testing0% | 9% | 18% | 32% | 39%
remote_config0% | 0% | 31% | 33% | 34%
analytics0% | 0% | 37% | 19% | 43%
testlab0% | 0% | 29% | 33% | 36%
installations0% | 0% | 0% | 38% | 61%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void CurlThread::ProcessRequests()
in app/rest/transport_curl.cc
169 30 0
def main()
in generate_xml_from_google_services_json.py
168 1 0
def main()
in scripts/gha/lint_commenter.py
164 11 0
void GameEngine::onTap()
in admob/tools/ios/testapp/testapp/game_engine.cpp
163 60 2
std::vector BundleTemplate()
in firestore/integration_test_internal/src/util/bundle_builder.cc
159 1 0
def main()
in scripts/gha/pr_file_commenter.py
159 15 0
129 32 3
int ZLib::UncompressAtMostOrAll()
in app/rest/zlibwrapper.cc
125 40 5
void Variant::Clear()
in app/src/variant.cc
125 37 1
def main()
in scripts/merge_libraries.py
122 45 1
void Repo::RerunTransactionQueue()
in database/src/desktop/core/repo.cc
112 13 2
private boolean updatePopUpLocation()
in admob/src_java/com/google/firebase/admob/internal/cpp/NativeExpressAdViewHelper.java
108 21 1
private boolean updatePopUpLocation()
in admob/src_java/com/google/firebase/admob/internal/cpp/BannerViewHelper.java
106 21 1
jclass FindClassInFiles()
in app/src/util_android.cc
103 6 4
int main()
in performance/example_usage.cc
103 3 0
void StorageReferenceInternal::FutureCallback()
in storage/src/android/storage_reference_android.cc
101 24 5
99 15 1
std::vector SyncTree::AddEventRegistration()
in database/src/desktop/core/sync_tree.cc
97 19 1
void InvitesReceiverInternalIos::FinishFetch()
in app/src/invites/ios/invites_receiver_internal_ios.mm
94 18 0
int QueryParamsComparator::CompareValues()
in database/src/desktop/query_params_comparator.cc
94 28 2