aws-samples / amazon-ivs-broadcast-for-ios-demo
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 66 units with 570 lines of code in units (16.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (54 lines of code)
    • 5 medium size units (140 lines of code)
    • 7 small units (91 lines of code)
    • 53 very small units (285 lines of code)
0% | 9% | 24% | 15% | 50%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 9% | 24% | 15% | 50%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Broadcasting/Views/Components0% | 45% | 24% | 0% | 30%
Broadcasting0% | 0% | 35% | 28% | 36%
Broadcasting/Views/Broadcasting0% | 0% | 0% | 0% | 100%
Broadcasting/Helpers0% | 0% | 0% | 0% | 100%
Broadcasting/Views/Settings0% | 0% | 0% | 0% | 100%
ReplayKitBroadcaster0% | 0% | 0% | 0% | 100%
Broadcasting/Views/Onboarding0% | 0% | 0% | 0% | 100%
Broadcasting/Views/AutoConfiguration0% | 0% | 0% | 0% | 100%
Broadcasting/Views0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func body()
in Broadcasting/Views/Components/NotificationView.swift
54 3 1
func loadVideoConfiguration()
in Broadcasting/BroadcastConfiguration.swift
39 11 0
func makeUIView()
in Broadcasting/Views/Components/TextWithHyperlink.swift
29 1 1
func broadcastSession()
in Broadcasting/BroadcastViewDelegate.swift
26 6 2
func initializeBroadcastSession()
in Broadcasting/BroadcastViewModel.swift
25 4 0
func setupSlots()
in Broadcasting/BroadcastConfiguration.swift
21 4 0
func toggleBroadcastSession()
in Broadcasting/BroadcastViewModel.swift
18 3 0
func setVideoBitrate()
in Broadcasting/BroadcastConfiguration.swift
14 2 1
func updateResolution()
in Broadcasting/BroadcastConfiguration.swift
13 2 1
func toggleCamera()
in Broadcasting/BroadcastViewModel.swift
12 2 0
func deviceOrientationChanged()
in Broadcasting/BroadcastViewModel.swift
12 5 1
func reconnectOnceNetworkIsAvailable()
in Broadcasting/BroadcastViewModel.swift
11 2 0
func broadcastSession()
in Broadcasting/BroadcastViewDelegate.swift
11 3 2
init()
in Broadcasting/Views/Settings/ResolutionAndFramerate.swift
10 1 2
init()
in Broadcasting/Views/Settings/Bitrate.swift
10 1 2
func start()
in Broadcasting/ElapsedTimeAndDataManager.swift
10 1 0
init()
in Broadcasting/Helpers/MonitorNetwork.swift
10 2 1
func broadcastSession()
in ReplayKitBroadcaster/SampleHandler.swift
9 2 2
func attachCameraPreview()
in Broadcasting/Views/Broadcasting/BroadcastPreview.swift
9 3 0
func body()
in Broadcasting/Helpers/Modifiers.swift
9 1 1