pytorch / ios-demo-app
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 189 units with 1,488 lines of code in units (33.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 5 simple units (139 lines of code)
    • 184 very simple units (1,349 lines of code)
0% | 0% | 0% | 9% | 90%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
swift0% | 0% | 0% | 8% | 91%
py0% | 0% | 0% | 12% | 87%
mm0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
QuestionAnswering0% | 0% | 0% | 63% | 36%
Seq2SeqNMT0% | 0% | 0% | 21% | 78%
ViT4MNIST0% | 0% | 0% | 13% | 86%
PyTorchDemo0% | 0% | 0% | 0% | 100%
D2Go0% | 0% | 0% | 0% | 100%
TorchVideo0% | 0% | 0% | 0% | 100%
ObjectDetection0% | 0% | 0% | 0% | 100%
HelloWorld-CoreML0% | 0% | 0% | 0% | 100%
SpeechRecognition0% | 0% | 0% | 0% | 100%
ImageSegmentation0% | 0% | 0% | 0% | 100%
HelloWorld0% | 0% | 0% | 0% | 100%
HelloWorld-Metal0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func wordPieceTokenizer()
in QuestionAnswering/QuestionAnswering/QuestionAnswering.swift
42 8 1
func answer()
in QuestionAnswering/QuestionAnswering/QuestionAnswering.swift
29 8 2
func recognize()
in ViT4MNIST/ViT4MNIST/HandwrittenDigitRecogizer.swift
21 8 3
def readLangs()
in Seq2SeqNMT/seq2seq_nmt.py
13 7 3
def train()
in Seq2SeqNMT/seq2seq_nmt.py
34 7 8
func normalized()
in TorchVideo/TorchVideo/CVPixelBuffer+Helper.swift
34 5 2
def trainIters()
in Seq2SeqNMT/seq2seq_nmt.py
30 5 6
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
def forward()
in SpeechRecognition/create_wav2vec2.py
15 4 2
func tokenizer()
in QuestionAnswering/QuestionAnswering/QuestionAnswering.swift
20 4 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 startSession()
in TorchVideo/TorchVideo/CameraController.swift
21 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
def unicodeToAscii()
in Seq2SeqNMT/seq2seq_nmt.py
5 3 1
def filterPairs()
in Seq2SeqNMT/seq2seq_nmt.py
2 3 1