pytorch / ios-demo-app
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 189 units with 1,488 lines of code in units (33.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 22 medium size units (659 lines of code)
    • 21 small units (308 lines of code)
    • 146 very small units (521 lines of code)
0% | 0% | 44% | 20% | 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% | 50% | 14% | 35%
py0% | 0% | 27% | 38% | 33%
mm0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
D2Go0% | 0% | 68% | 6% | 25%
TorchVideo0% | 0% | 52% | 16% | 31%
ObjectDetection0% | 0% | 59% | 8% | 32%
QuestionAnswering0% | 0% | 63% | 17% | 18%
Seq2SeqNMT0% | 0% | 29% | 31% | 39%
PyTorchDemo0% | 0% | 24% | 31% | 44%
HelloWorld-CoreML0% | 0% | 43% | 23% | 33%
ImageSegmentation0% | 0% | 59% | 0% | 40%
HelloWorld0% | 0% | 65% | 0% | 34%
HelloWorld-Metal0% | 0% | 91% | 0% | 8%
SpeechRecognition0% | 0% | 32% | 21% | 45%
ViT4MNIST0% | 0% | 13% | 41% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
43 1 0
func wordPieceTokenizer()
in QuestionAnswering/QuestionAnswering/QuestionAnswering.swift
42 8 1
func normalized()
in TorchVideo/TorchVideo/CVPixelBuffer+Helper.swift
34 5 2
def train()
in Seq2SeqNMT/seq2seq_nmt.py
34 7 8
func normalized()
in D2Go/D2Go/Live/CVPixelBuffer+Helper.swift
34 5 2
func normalized()
in ObjectDetection/ObjectDetection/Live/CVPixelBuffer+Helper.swift
34 5 2
func normalized()
in PyTorchDemo/PyTorchDemo/ImageClassification/CVPixelBuffer+Helper.swift
34 5 2
func normalized()
in HelloWorld/HelloWorld/HelloWorld/UIImage+Helper.swift
31 3 0
func normalized()
in HelloWorld-CoreML/HelloWorld/HelloWorld/UIImage+Helper.swift
31 3 0
func normalized()
in ImageSegmentation/ImageSegmentation/UIImage+Helper.swift
31 3 0
func normalized()
in TorchVideo/TorchVideo/UIImage+Helper.swift
31 3 0
func normalized()
in HelloWorld-Metal/HelloWorld-Metal/HelloWorld-Metal/UIImage+Helper.swift
31 3 0
func normalized()
in D2Go/D2Go/Utils/UIImage+Helper.swift
31 3 0
func normalized()
in ObjectDetection/ObjectDetection/Utils/UIImage+Helper.swift
31 3 0
def trainIters()
in Seq2SeqNMT/seq2seq_nmt.py
30 5 6
func answer()
in QuestionAnswering/QuestionAnswering/QuestionAnswering.swift
29 8 2
func audioRecorderDidFinishRecording()
in SpeechRecognition/SpeechRecognition/ViewController.swift
23 2 2
func startSession()
in TorchVideo/TorchVideo/CameraController.swift
21 3 0
func recognize()
in ViT4MNIST/ViT4MNIST/HandwrittenDigitRecogizer.swift
21 8 3
func startSession()
in D2Go/D2Go/Live/CameraController.swift
21 3 0