firebase / quickstart-ios
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 333 units with 3,216 lines of code in units (19.2% of code).
    • 1 very long units (195 lines of code)
    • 4 long units (238 lines of code)
    • 21 medium size units (574 lines of code)
    • 67 small units (975 lines of code)
    • 240 very small units (1,234 lines of code)
6% | 7% | 17% | 30% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift6% | 7% | 18% | 31% | 36%
m0% | 0% | 0% | 0% | 100%
rb0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
authentication19% | 7% | 23% | 25% | 22%
firestore0% | 21% | 26% | 21% | 30%
performance0% | 22% | 27% | 17% | 32%
abtesting0% | 0% | 26% | 57% | 16%
storage0% | 0% | 60% | 18% | 21%
database0% | 0% | 5% | 44% | 49%
functions0% | 0% | 20% | 30% | 48%
crashlytics0% | 0% | 0% | 55% | 44%
dynamiclinks0% | 0% | 0% | 37% | 63%
messaging0% | 0% | 0% | 37% | 62%
config0% | 0% | 0% | 29% | 70%
inappmessaging0% | 0% | 0% | 39% | 60%
admob0% | 0% | 0% | 27% | 72%
analytics0% | 0% | 0% | 10% | 89%
appdistribution0% | 0% | 0% | 0% | 100%
installations0% | 0% | 0% | 0% | 100%
template0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
swiftui0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func showAuthPicker()
in authentication/LegacyAuthQuickstart/AuthenticationExampleSwift/MainViewController.swift
195 34 1
func firebaseLogin()
in authentication/LegacyAuthQuickstart/AuthenticationExampleSwift/MainViewController.swift
78 10 1
func populate()
in firestore/FirestoreSwiftUIExample/Extensions/Firestore+Extension.swift
55 6 0
func reviewController()
in firestore/FirestoreExample/RestaurantDetailViewController.swift
54 6 2
func generateSaliencyMap()
in performance/SwiftUIPerformanceQuickstart/PerformanceExample/Shared/Process.swift
51 1 0
func imagePickerController()
in storage/StorageExampleSwift/ViewController.swift
48 6 2
func add()
in firestore/FirestoreSwiftUIExample/ViewModels/RestaurantViewModel.swift
37 4 1
func downloadImage()
in performance/SwiftUIPerformanceQuickstart/PerformanceExample/Shared/Process.swift
31 1 0
func classifyImage()
in performance/SwiftUIPerformanceQuickstart/PerformanceExample/Shared/Process.swift
31 1 0
func DRAFT_testGoogleSignInAndLinkAccount()
in authentication/AuthenticationExampleUITests/AuthenticationExampleUITests.swift
29 2 0
init?()
in authentication/AuthenticationExample/Models/AuthProvider.swift
29 13 1
func didSelectRowAt()
in authentication/AuthenticationExample/ViewControllers/AccountLinkingViewController.swift
29 9 2
func testStaticUI()
in abtesting/Shared/UITests.swift
28 2 0
func controller()
in firestore/FirestoreExample/RestaurantsTableViewController.swift
27 4 5
func didSelectRowAt()
in authentication/AuthenticationExample/ViewControllers/AuthViewController.swift
27 11 2
func didSelectRowAt()
in authentication/AuthenticationExample/ViewControllers/UserViewController.swift
27 11 2
func authorizationController()
in authentication/AuthenticationExample/ViewControllers/AuthViewController.swift
26 1 2
func incrementStars()
in database/DatabaseExampleSwift/PostTableViewCell.swift
26 4 1
func listen()
in firestore/FirestoreExample/LocalCollection.swift
25 3 0
func query()
in firestore/FirestoreExample/RestaurantsTableViewController.swift
23 6 4