tensorflow / tfjs-website
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 75 units with 1,184 lines of code in units (12.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (66 lines of code)
    • 14 simple units (469 lines of code)
    • 59 very simple units (649 lines of code)
0% | 0% | 5% | 39% | 54%
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% | 0% | 7% | 42% | 50%
js0% | 0% | 0% | 32% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
build-scripts0% | 0% | 55% | 0% | 45%
build-scripts/doc-gen0% | 0% | 0% | 48% | 51%
themes/tfjs/helper0% | 0% | 0% | 33% | 66%
themes/tfjs/source/js0% | 0% | 0% | 31% | 68%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function generateDocs()
in build-scripts/build_api_helpers.ts
48 16 1
function comparePackageVersions()
in build-scripts/build_api_helpers.ts
18 16 2
export function sortMethods()
in build-scripts/doc-gen/util.ts
36 10 2
export function linkSymbols()
in build-scripts/doc-gen/util.ts
85 10 4
export function fillHeadingsAndGetSubheading()
in build-scripts/doc-gen/util.ts
27 8 2
export function serializeMethodOrFunction()
in build-scripts/doc-gen/parser.ts
69 8 7
function updateTocView()
in themes/tfjs/source/js/api.js
29 7 0
export function addSubclassMethods()
in build-scripts/doc-gen/util.ts
27 7 2
export function serializeClass()
in build-scripts/doc-gen/parser.ts
54 7 8
async function executeCodeSnippet()
in themes/tfjs/source/js/codeSnippets.js
21 6 2
getApi: function()
in themes/tfjs/helper/index.js
18 6 3
titleFor: function()
in themes/tfjs/helper/index.js
14 6 1
docVersions: function()
in themes/tfjs/helper/index.js
19 6 1
export function replaceUseDocsFromDocStrings()
in build-scripts/doc-gen/util.ts
21 6 3
export function getIdentifierGenericMap()
in build-scripts/doc-gen/util.ts
22 6 1
function replaceSymbolsWithLinks()
in build-scripts/doc-gen/util.ts
27 6 4
export function parameterTypeToString()
in build-scripts/doc-gen/util.ts
21 5 3
export function inlineTypes()
in build-scripts/doc-gen/util.ts
33 5 2
export function parse()
in build-scripts/doc-gen/parser.ts
45 5 5
function getLineNumber()
in themes/tfjs/source/js/codeSnippets.js
17 4 1