firebase / snippets-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 183 units with 1,560 lines of code in units (25.5% of code).
    • 1 very long units (125 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (324 lines of code)
    • 28 small units (384 lines of code)
    • 144 very small units (727 lines of code)
8% | 0% | 20% | 24% | 46%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift8% | 0% | 21% | 25% | 44%
m0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
firoptions75% | 0% | 19% | 0% | 5%
firestore0% | 0% | 28% | 32% | 39%
storage0% | 0% | 23% | 22% | 53%
dl-invites-sample0% | 0% | 30% | 8% | 61%
ml-functions0% | 0% | 35% | 35% | 28%
database0% | 0% | 36% | 12% | 51%
mlkit0% | 0% | 22% | 50% | 27%
invites0% | 0% | 0% | 54% | 45%
appcheck0% | 0% | 0% | 36% | 63%
crashlytics0% | 0% | 0% | 36% | 63%
installations0% | 0% | 0% | 0% | 100%
inappmessaging0% | 0% | 0% | 0% | 100%
functions0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func enhancedEcommerce()
in firoptions/FiroptionConfiguration/ViewController.swift
125 1 0
func DefaultInvitePresenters()
in dl-invites-sample/InvitesSample/InvitePresenter.swift
44 1 1
func getRecognizedTextsFrom()
in ml-functions/MLFunctionsExampleSwift/ViewController.swift
42 6 1
func storageDownloadCombinedExample()
in storage/StorageReferenceSwift/ViewController.swift
36 5 0
func loadCached()
in database/DatabaseReference/swift/ViewController.swift
34 4 0
func storageUploadCombinedExample()
in storage/StorageReferenceSwift/ViewController.swift
33 6 0
func fetchRemoteBundle()
in firestore/swift/firestore-smoketest/SolutionBundles.swift
32 6 3
func application()
in firoptions/FiroptionConfiguration/AppDelegate.swift
32 1 2
func setupModelDownloadNotifications()
in mlkit/swift-snippets/ModelManagement.swift
26 1 0
func loadQuery()
in firestore/swift/firestore-smoketest/SolutionBundles.swift
24 4 4
func addRatingTransaction()
in firestore/swift/firestore-smoketest/SolutionAggregationViewController.swift
21 2 2
func nonFirebaseBackend()
in appcheck/AppCheckSnippetsSwift/AppDelegate.swift
20 1 0
func imageOrientation()
in mlkit/swift-snippets/ImagePreparation.swift
17 10 2
func geoQuery()
in firestore/swift/firestore-smoketest/SolutionGeoPointViewController.swift
16 2 0
func getDocumentsCompletion()
in firestore/swift/firestore-smoketest/SolutionGeoPointViewController.swift
16 3 2
func runStoriesQuery()
in firestore/swift/firestore-smoketest/SolutionBundles.swift
16 3 0
func storageInMemoryExample()
in storage/StorageReferenceSwift/ViewController.swift
16 1 0
func storageUploadFromDiskExample()
in storage/StorageReferenceSwift/ViewController.swift
16 1 0
func prepareTextData()
in ml-functions/MLFunctionsExampleSwift/ViewController.swift
16 1 1
func setupRemoteModel()
in mlkit/swift-snippets/ModelManagement.swift
16 2 0