pytorch / workshops
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 12 units with 102 lines of code in units (8.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (64 lines of code)
    • 1 small units (17 lines of code)
    • 9 very small units (21 lines of code)
0% | 0% | 62% | 16% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 0% | 66% | 34% | 0%
swift0% | 0% | 59% | 0% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
PTMobileWalkthruAndroid/app/src/main/java/com/example/ptmobilewalkthru0% | 0% | 66% | 34% | 0%
PTMobileWalkthruIOS/PTMobileDemo0% | 0% | 59% | 0% | 40%
Alternative Visuals
Longest Units
Top 12 longest units
Unit# linesMcCabe index# params
protected void onCreate()
in PTMobileWalkthruAndroid/app/src/main/java/com/example/ptmobilewalkthru/MainActivity.java
33 4 1
func normalized()
in PTMobileWalkthruIOS/PTMobileDemo/UIImage+Helper.swift
31 3 0
public static String assetFilePath()
in PTMobileWalkthruAndroid/app/src/main/java/com/example/ptmobilewalkthru/MainActivity.java
17 4 2
func application()
in PTMobileWalkthruIOS/PTMobileDemo/AppDelegate.swift
3 1 2
func application()
in PTMobileWalkthruIOS/PTMobileDemo/AppDelegate.swift
3 1 3
func scene()
in PTMobileWalkthruIOS/PTMobileDemo/SceneDelegate.swift
3 1 3
func application()
in PTMobileWalkthruIOS/PTMobileDemo/AppDelegate.swift
2 1 2
func sceneDidDisconnect()
in PTMobileWalkthruIOS/PTMobileDemo/SceneDelegate.swift
2 1 1
func sceneDidBecomeActive()
in PTMobileWalkthruIOS/PTMobileDemo/SceneDelegate.swift
2 1 1
func sceneWillResignActive()
in PTMobileWalkthruIOS/PTMobileDemo/SceneDelegate.swift
2 1 1
func sceneWillEnterForeground()
in PTMobileWalkthruIOS/PTMobileDemo/SceneDelegate.swift
2 1 1
func sceneDidEnterBackground()
in PTMobileWalkthruIOS/PTMobileDemo/SceneDelegate.swift
2 1 1