tensorflow / tfjs
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 4,875 units with 68,219 lines of code in units (55.1% of code).
    • 0 very complex units (0 lines of code)
    • 18 complex units (2,008 lines of code)
    • 194 medium complex units (12,266 lines of code)
    • 398 simple units (13,443 lines of code)
    • 4,265 very simple units (40,502 lines of code)
0% | 2% | 17% | 19% | 59%
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% | 2% | 17% | 19% | 60%
py0% | 10% | 33% | 22% | 33%
js0% | 2% | 8% | 22% | 66%
cc0% | 0% | 21% | 18% | 59%
tsx0% | 0% | 0% | 26% | 73%
h0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tfjs-layers0% | 5% | 14% | 16% | 62%
tfjs-core0% | 3% | 12% | 17% | 66%
tfjs-backend-wasm0% | 3% | 18% | 19% | 57%
tfjs-converter0% | 6% | 23% | 24% | 45%
tfjs-backend-webgl0% | 1% | 19% | 19% | 59%
tfjs-backend-webgpu0% | 2% | 27% | 9% | 59%
scripts0% | 9% | 17% | 31% | 41%
tfjs-node0% | 1% | 11% | 22% | 65%
tfjs-backend-cpu0% | 0% | 37% | 19% | 42%
tfjs-vis0% | 0% | 29% | 28% | 42%
tfjs-react-native0% | 0% | 13% | 17% | 69%
tfjs-data0% | 0% | 16% | 17% | 66%
tfjs-tflite0% | 0% | 21% | 27% | 50%
tfjs-inference0% | 0% | 0% | 68% | 31%
tfjs0% | 0% | 0% | 34% | 65%
tools0% | 0% | 0% | 94% | 5%
tfjs-automl0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function sliceInfo()
in tfjs-core/src/ops/slice_util.ts
159 48 9
private mapNode()
in tfjs-converter/src/operations/operation_mapper.ts
152 45 1
constructor()
in tfjs-layers/src/engine/container.ts
252 44 1
def CheckLanguage()
in tfjs-backend-wasm/tools/cpplint.py
87 44 7
def Update()
in tfjs-backend-wasm/tools/cpplint.py
88 40 5
export function runProgram()
in tfjs-backend-webgl/src/gpgpu_math.ts
145 38 5
def CheckBraces()
in tfjs-backend-wasm/tools/cpplint.py
68 38 4
def fold_batch_norms()
in tfjs-converter/python/tensorflowjs/converters/fold_batch_norms.py
176 37 1
function generateCloudbuild()
in scripts/generate_cloudbuild.js
95 34 2
def CheckSpacing()
in tfjs-backend-wasm/tools/cpplint.py
51 33 5
export async function fitDataset()
in tfjs-layers/src/engine/training_dataset.ts
170 32 3
83 32 2
function fromPixels_()
in tfjs-core/src/ops/browser.ts
109 31 2
export function execute()
in tfjs-layers/src/engine/executor.ts
106 31 4
export function getBinaryOpString()
in tfjs-backend-webgpu/src/binary_op_util.ts
45 30 2
export function decodeWeights()
in tfjs-core/src/io/io_utils.ts
114 28 2
export function getUnaryOpString()
in tfjs-backend-webgpu/src/unary_op_util.ts
54 28 2
def CheckEmptyBlockBody()
in tfjs-backend-wasm/tools/cpplint.py
54 27 4
export function batchMatMulImpl()
in tfjs-backend-webgl/src/kernels/BatchMatMul_impl.ts
116 25 9
def CheckBracesSpacing()
in tfjs-backend-wasm/tools/cpplint.py
32 25 5