firebase / firebase-ios-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 6,319 units with 54,012 lines of code in units (24.4% of code).
    • 14 very long units (1,951 lines of code)
    • 57 long units (3,772 lines of code)
    • 414 medium size units (12,494 lines of code)
    • 952 small units (13,419 lines of code)
    • 4,882 very small units (22,376 lines of code)
3% | 6% | 23% | 24% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift15% | 6% | 24% | 27% | 26%
cc1% | 4% | 24% | 31% | 37%
c9% | 23% | 37% | 18% | 11%
h3% | <1% | <1% | 11% | 83%
m2% | 6% | 46% | 25% | 19%
rb15% | 0% | 16% | 31% | 36%
py0% | 21% | 27% | 18% | 32%
mm0% | 0% | 38% | 38% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
FirebaseMLModelDownloader36% | 14% | 10% | 18% | 20%
Crashlytics7% | 14% | 38% | 22% | 16%
Firestore<1% | 3% | 18% | 26% | 50%
ReleaseTooling29% | 0% | 44% | 15% | 10%
FirebaseMessaging17% | 9% | 20% | 16% | 35%
FirebaseAuth51% | 27% | 0% | 0% | 21%
scripts2% | 23% | 33% | 16% | 24%
Firebase0% | 17% | 36% | 19% | 25%
FirebasePerformance0% | 3% | 53% | 24% | 18%
FirebaseDynamicLinks0% | 0% | 31% | 33% | 34%
SwiftPMTests0% | 0% | 80% | 0% | 19%
FirebaseRemoteConfig0% | 0% | 40% | 12% | 47%
FirebaseInAppMessaging0% | 0% | 11% | 21% | 67%
FirebaseDatabase0% | 0% | 34% | 27% | 38%
FirebaseFunctions0% | 0% | 60% | 39% | 0%
FirebaseCore0% | 0% | 32% | 0% | 67%
FirebaseCombineSwift0% | 0% | 3% | 90% | 6%
Example0% | 0% | 13% | 10% | 76%
FirebaseAppCheck0% | 0% | 0% | 33% | 66%
FirebaseStorage0% | 0% | 0% | 54% | 45%
FirebaseDatabaseSwift0% | 0% | 0% | 68% | 31%
FirebaseStorageSwift0% | 0% | 0% | 0% | 100%
FirebaseInstallations0% | 0% | 0% | 0% | 100%
FirebaseAppDistribution0% | 0% | 0% | 0% | 100%
FirebaseRemoteConfigSwift0% | 0% | 0% | 0% | 100%
FirebaseAnalyticsSwift0% | 0% | 0% | 0% | 100%
FirebaseABTesting0% | 0% | 0% | 0% | 100%
SharedTestUtilities0% | 0% | 0% | 0% | 100%
SymbolCollisionTest0% | 0% | 0% | 0% | 100%
CocoapodsIntegrationTest0% | 0% | 0% | 0% | 100%
FirebaseFunctionsSwift0% | 0% | 0% | 0% | 100%
GoogleUtilitiesComponents0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func downloadModelInfo()
in FirebaseMLModelDownloader/Sources/ModelInfoRetriever.swift
323 11 1
typedef NS_ENUM()
in FirebaseMessaging/Sources/FIRMessagingCode.h
184 1 2
func handleResponse()
in FirebaseMLModelDownloader/Sources/ModelDownloadTask.swift
168 8 3
typedef NS_ENUM()
in FirebaseAuth/Sources/Utilities/FIRAuthInternalErrors.h
152 1 2
static Error CodeForErrno()
in Firestore/core/src/util/status_errno.cc
140 85 1
static void FIRCLSMachExceptionNameLookup()
in Crashlytics/Crashlytics/Handlers/FIRCLSMachException.c
124 36 4
bool FIRCLSContextInitialize()
in Crashlytics/Crashlytics/Components/FIRCLSContext.m
122 10 3
sync_firestore
in scripts/sync_project.rb
109 3 1
func buildAndAssembleZip()
in ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift
108 16 3
bool FIRCLSDwarfUnwindSetRegisterValue()
in Crashlytics/Crashlytics/Unwind/FIRCLSUnwind_arm.c
107 33 3
ViewDocumentChanges View::ComputeDocumentChanges()
in Firestore/core/src/core/view.cc
106 37 2
bool FIRCLSDwarfExpressionMachineExecuteNextOpcode()
in Crashlytics/Crashlytics/Unwind/Dwarf/FIRCLSDwarfExpressionMachine.c
105 74 1
func run()
in ReleaseTooling/Sources/ZipBuilder/main.swift
102 12 0
std::string Reader::Describe()
in Firestore/core/src/local/leveldb_key.cc
101 35 0
func downloadInfoAndModel()
in FirebaseMLModelDownloader/Sources/ModelDownloader.swift
100 14 5
97 20 5
BOOL FIRMessagingIsProductionApp()
in FirebaseMessaging/Sources/FIRMessagingUtilities.m
97 24 1
static bool FIRCLSProcessRecordThreadRegisters()
in Crashlytics/Crashlytics/Components/FIRCLSProcess.c
96 1 2
func resume()
in FirebaseMLModelDownloader/Sources/ModelDownloadTask.swift
93 5 0
def CheckLanguage()
in scripts/cpplint.py
91 45 7