pytorch / live
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 710 units with 7,943 lines of code in units (44.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (100 lines of code)
    • 3 medium complex units (205 lines of code)
    • 30 simple units (1,123 lines of code)
    • 676 very simple units (6,515 lines of code)
0% | 1% | 2% | 14% | 82%
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
ts0% | 5% | 0% | 8% | 86%
tsx0% | 0% | 7% | 27% | 65%
java0% | 0% | 1% | 15% | 82%
swift0% | 0% | 3% | 6% | 89%
js0% | 0% | 0% | 11% | 88%
cpp0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
react-native-pytorch-core/src0% | 33% | 0% | 0% | 66%
react-native-pytorch-core/example0% | 0% | 9% | 21% | 68%
react-native-pytorch-core/android0% | 0% | 2% | 14% | 82%
react-native-pytorch-core/ios0% | 0% | 3% | 6% | 89%
react-native-template-pytorch-live/template0% | 0% | 0% | 19% | 80%
torchlive-cli/src0% | 0% | 0% | 13% | 86%
website/scripts0% | 0% | 0% | 46% | 53%
react-native-template-ptl/template0% | 0% | 0% | 15% | 84%
website/src0% | 0% | 0% | 0% | 100%
react-native-pytorch-core/cpp0% | 0% | 0% | 0% | 100%
website0% | 0% | 0% | 0% | 100%
torchlive-cli/scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function parse()
in react-native-pytorch-core/src/utils/CSSFontUtils.ts
100 38 1
export default function MNIST()
in react-native-pytorch-core/example/src/toolbox/models/MNIST.tsx
108 15 0
private static Tensor doImageTransforms()
in react-native-pytorch-core/android/src/main/java/org/pytorch/rn/core/ml/processing/BaseIValuePacker.java
54 14 2
func setFont()
in react-native-pytorch-core/ios/Canvas/DrawingCanvasView.swift
43 13 1
func setSessionPreset()
in react-native-pytorch-core/ios/Camera/CameraView.swift
17 10 0
function runHealthCheck()
in torchlive-cli/src/cli-commands/Doctor.ts
52 10 2
void bindPreview()
in react-native-pytorch-core/android/src/main/java/org/pytorch/rn/core/camera/CameraView.java
55 9 1
public void arc()
in react-native-pytorch-core/android/src/main/java/org/pytorch/rn/core/canvas/CanvasRenderingContext2D.java
24 9 6
private WritableArray decodeObjects()
in react-native-pytorch-core/android/src/main/java/org/pytorch/rn/core/ml/processing/BaseIValuePacker.java
66 9 3
async function animate()
in react-native-pytorch-core/example/src/toolbox/apiTest/CanvasAnimation.tsx
63 8 1
func setupInput()
in react-native-pytorch-core/ios/Camera/CameraView.swift
37 8 0
export default function CanvasStarter()
in react-native-template-pytorch-live/template/src/toolbox/canvas/CanvasStarter.tsx
52 7 0
function importExamples()
in website/scripts/codegen-examples.js
53 7 0
export default function CanvasImageSprite()
in react-native-pytorch-core/example/src/toolbox/apiTest/CanvasImageSprite.tsx
50 7 0
func unpack()
in react-native-pytorch-core/ios/ML/Processing/BaseIValuePacker.swift
24 7 3
public static void saveStreamToFile()
in react-native-pytorch-core/android/src/main/java/org/pytorch/rn/core/utils/FileUtils.java
27 7 2
export function getInstalledPackages()
in torchlive-cli/src/android/AndroidSDK.ts
42 7 0
export function getAndroidEmulatorABI()
in torchlive-cli/src/android/AndroidSDK.ts
9 7 0
private static void initializeFlipper()
in react-native-template-pytorch-live/template/android/app/src/main/java/org/pytorch/live/example/MainApplication.java
19 6 2
export function IconButton()
in react-native-template-pytorch-live/template/src/components/UIComponents.tsx
31 6 8