aws-samples / amazon-ivs-broadcast-ios-sample
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 24 units with 161 lines of code in units (19.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 5 small units (71 lines of code)
    • 19 very small units (90 lines of code)
0% | 0% | 0% | 44% | 55%
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% | 0% | 44% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
BasicBroadcast/ViewControllers0% | 0% | 0% | 58% | 41%
BasicBroadcast0% | 0% | 0% | 48% | 51%
BasicBroadcast/Storage0% | 0% | 0% | 0% | 100%
ScreenCapture0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func broadcastSession()
in BasicBroadcast/ViewControllers/LiveBroadcastViewController.swift
17 6 2
init()
in BasicBroadcast/ViewControllers/MixerViewController.swift
16 1 2
func checkAVPermissions()
in BasicBroadcast/Utils.swift
15 1 1
func setMicrophone()
in BasicBroadcast/ViewControllers/LiveBroadcastViewController.swift
12 3 1
func attachCameraPreview()
in BasicBroadcast/Utils.swift
11 1 2
func broadcastSession()
in ScreenCapture/SampleHandler.swift
8 2 2
func captureOutput()
in BasicBroadcast/ViewControllers/CustomSourcesViewController.swift
8 3 3
func checkOrGetPermission()
in BasicBroadcast/Utils.swift
8 4 2
func insert()
in BasicBroadcast/Storage/UserDefaultsAuthDao.swift
7 2 1
func displayPermissionError()
in BasicBroadcast/Utils.swift
7 1 0
func displayErrorAlert()
in BasicBroadcast/Utils.swift
7 1 2
func broadcastSession()
in BasicBroadcast/ViewControllers/LiveBroadcastViewController.swift
6 1 2
func broadcastSession()
in BasicBroadcast/ViewControllers/LiveBroadcastViewController.swift
6 1 2
init()
in BasicBroadcast/Storage/UserDefaultsDao.swift
6 1 0
func broadcastSession()
in BasicBroadcast/ViewControllers/LiveBroadcastViewController.swift
5 1 2
func broadcastSession()
in ScreenCapture/SampleHandler.swift
3 1 2
func broadcastSession()
in BasicBroadcast/ViewControllers/CustomSourcesViewController.swift
3 1 3
func application()
in BasicBroadcast/AppDelegate.swift
3 1 2
func fetchAll()
in BasicBroadcast/Storage/UserDefaultsAuthDao.swift
3 1 0
func lastUsedAuth()
in BasicBroadcast/Storage/UserDefaultsAuthDao.swift
3 1 0