tensorflow / tfjs-examples
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 821 units with 12,608 lines of code in units (29.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (173 lines of code)
    • 12 medium complex units (1,048 lines of code)
    • 38 simple units (1,550 lines of code)
    • 770 very simple units (9,837 lines of code)
0% | 1% | 8% | 12% | 78%
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
tsx0% | 85% | 0% | 0% | 14%
js0% | 0% | 4% | 12% | 82%
ts0% | 0% | 60% | 4% | 34%
py0% | 0% | 14% | 13% | 71%
java0% | 0% | 0% | 20% | 79%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
react-native0% | 31% | 0% | 10% | 57%
interactive-visualizers0% | 0% | 69% | 7% | 22%
snake-dqn0% | 0% | 33% | 13% | 53%
translation0% | 0% | 29% | 4% | 65%
lstm-text-generation0% | 0% | 18% | 7% | 74%
visualize-convnet0% | 0% | 21% | 19% | 58%
intent-classifier0% | 0% | 10% | 0% | 89%
sentiment0% | 0% | 0% | 43% | 56%
addition-rnn0% | 0% | 0% | 69% | 30%
jena-weather0% | 0% | 0% | 30% | 69%
mnist-acgan0% | 0% | 0% | 19% | 80%
quantization0% | 0% | 0% | 13% | 86%
addition-rnn-webworker0% | 0% | 0% | 41% | 58%
date-conversion-attention0% | 0% | 0% | 21% | 78%
electron0% | 0% | 0% | 31% | 68%
simple-object-detection0% | 0% | 0% | 20% | 79%
fashion-mnist-vae0% | 0% | 0% | 12% | 87%
mnist-transfer-cnn0% | 0% | 0% | 4% | 95%
chrome-extension0% | 0% | 0% | 12% | 87%
iris0% | 0% | 0% | 0% | 100%
iris-fitDataset0% | 0% | 0% | 0% | 100%
cart-pole0% | 0% | 0% | 0% | 100%
gpu-pipeline0% | 0% | 0% | 0% | 100%
data-generator0% | 0% | 0% | 0% | 100%
mnist0% | 0% | 0% | 0% | 100%
website-phishing0% | 0% | 0% | 0% | 100%
boston-housing0% | 0% | 0% | 0% | 100%
baseball-node0% | 0% | 0% | 0% | 100%
tsne-mnist-canvas0% | 0% | 0% | 0% | 100%
mnist-core0% | 0% | 0% | 0% | 100%
webcam-transfer-learning0% | 0% | 0% | 0% | 100%
polynomial-regression0% | 0% | 0% | 0% | 100%
data-csv0% | 0% | 0% | 0% | 100%
polynomial-regression-core0% | 0% | 0% | 0% | 100%
mnist-node0% | 0% | 0% | 0% | 100%
mobilenet0% | 0% | 0% | 0% | 100%
abalone-node0% | 0% | 0% | 0% | 100%
custom-layer0% | 0% | 0% | 0% | 100%
getting-started0% | 0% | 0% | 0% | 100%
firebase-object-detection-node0% | 0% | 0% | 0% | 100%
angular-predictive-prefetching0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export default function App()
in react-native/pose-detection/App.tsx
173 26 0
export function setUpUI()
in lstm-text-generation/ui.js
132 20 0
async runImageSegmenter()
in interactive-visualizers/src/app/app.component.ts
131 20 2
def read_data()
in translation/python/translation.py
65 18 0
async runObjectDetector()
in interactive-visualizers/src/app/app.component.ts
140 18 2
async function readData()
in translation/translation.ts
114 13 1
async runImageClassifier()
in interactive-visualizers/src/app/app.component.ts
74 13 2
step()
in snake-dqn/snake_game.js
51 13 1
updateDirection_()
in snake-dqn/snake_game.js
27 13 1
async function run()
in visualize-convnet/index.js
83 12 0
export async function train()
in snake-dqn/train.js
66 12 9
async function getDataIterator()
in intent-classifier/training/train_tagger.js
69 11 4
export function renderSnakeGame()
in snake-dqn/snake_graphics.js
96 11 3
function loadFeatures()
in sentiment/data.js
50 10 4
async function run()
in visualize-convnet/main.js
77 10 0
async load()
in jena-weather/data.js
52 10 0
async fetchLabelmap()
in interactive-visualizers/src/app/app.component.ts
37 10 1
async function main()
in sentiment/train.js
69 9 0
async ensureModelLoaded()
in electron/image_classifier.js
33 9 1
async generateExample()
in simple-object-detection/synthetic_images.js
56 9 3