aws-samples / amazon-ivs-ecommerce-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 20 units with 174 lines of code in units (30.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (73 lines of code)
    • 3 small units (39 lines of code)
    • 14 very small units (62 lines of code)
0% | 0% | 41% | 22% | 35%
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% | 41% | 22% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
eCommerce/Views/Player0% | 0% | 56% | 17% | 25%
eCommerce/Views/Product0% | 0% | 88% | 0% | 12%
eCommerce/Controllers0% | 0% | 0% | 54% | 45%
eCommerce0% | 0% | 0% | 0% | 100%
eCommerce/Models0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func setup()
in eCommerce/Views/Player/PlayerView.swift
28 2 0
func player()
in eCommerce/Views/Player/PlayerView.swift
23 6 2
func setup()
in eCommerce/Views/Product/ProductView.swift
22 2 2
func commonInit()
in eCommerce/Views/Player/PlayerView.swift
16 2 0
func tableView()
in eCommerce/Controllers/ProductsViewController.swift
12 2 2
func tableView()
in eCommerce/Controllers/ProductsViewController.swift
11 1 2
func application()
in eCommerce/AppDelegate.swift
9 2 2
func scrollViewDidScroll()
in eCommerce/Controllers/ProductsViewController.swift
8 2 1
func getImage()
in eCommerce/Models/Products.swift
8 2 1
func show()
in eCommerce/Controllers/ProductsViewController.swift
5 1 2
func addApplicationLifecycleObservers()
in eCommerce/Views/Player/PlayerView.swift
4 1 0
func removeApplicationLifecycleObservers()
in eCommerce/Views/Player/PlayerView.swift
4 1 0
func show()
in eCommerce/Views/Player/PlayerView.swift
3 1 2
func startPlayback()
in eCommerce/Views/Player/PlayerView.swift
3 1 0
func pausePlayback()
in eCommerce/Views/Player/PlayerView.swift
3 1 0
func player()
in eCommerce/Views/Player/PlayerView.swift
3 1 2
func player()
in eCommerce/Views/Player/PlayerView.swift
3 1 2
func showBottomSeparator()
in eCommerce/Views/Product/ProductView.swift
3 1 1
func tableView()
in eCommerce/Controllers/ProductsViewController.swift
3 1 2
func tableView()
in eCommerce/Controllers/ProductsViewController.swift
3 1 2