apple / cloudkit-sample-sharing
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 18 units with 210 lines of code in units (38.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (133 lines of code)
    • 2 small units (30 lines of code)
    • 11 very small units (47 lines of code)
0% | 0% | 63% | 14% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 0% | 63% | 14% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sharing/ViewModels0% | 0% | 86% | 11% | 3%
Sharing/App0% | 0% | 58% | 0% | 41%
SharingTests0% | 0% | 54% | 45% | 0%
Sharing/Views0% | 0% | 0% | 0% | 100%
Sharing/Models0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
func fetchPrivateAndSharedContacts()
in Sharing/ViewModels/ViewModel.swift
37 6 1
func fetchOrCreateShare()
in Sharing/ViewModels/ViewModel.swift
26 4 2
func windowScene()
in Sharing/App/SceneDelegate.swift
24 3 2
func addContact()
in Sharing/ViewModels/ViewModel.swift
23 2 3
func testCreatingShare()
in SharingTests/SharingTests.swift
23 3 0
func test_CloudKitReadiness()
in SharingTests/SharingTests.swift
19 4 0
func refresh()
in Sharing/ViewModels/ViewModel.swift
11 3 0
init?()
in Sharing/Models/Contact.swift
10 1 1
func scene()
in Sharing/App/SceneDelegate.swift
9 2 3
func makeUIViewController()
in Sharing/Views/CloudSharingView.swift
7 1 1
func application()
in Sharing/App/AppDelegate.swift
3 1 2
func application()
in Sharing/App/AppDelegate.swift
3 1 3
init()
in Sharing/ViewModels/ViewModel.swift
3 1 1
func makeCoordinator()
in Sharing/Views/CloudSharingView.swift
3 1 0
func cloudSharingController()
in Sharing/Views/CloudSharingView.swift
3 1 2
func itemTitle()
in Sharing/Views/CloudSharingView.swift
3 1 1
func application()
in Sharing/App/AppDelegate.swift
2 1 2
func updateUIViewController()
in Sharing/Views/CloudSharingView.swift
1 1 2