firebase / firebase-functions
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 318 units with 4,889 lines of code in units (67.3% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (163 lines of code)
    • 2 medium complex units (124 lines of code)
    • 14 simple units (410 lines of code)
    • 301 very simple units (4,192 lines of code)
0% | 3% | 2% | 8% | 85%
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% | 3% | 2% | 8% | 85%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 18% | 11% | 7% | 62%
src/common0% | 0% | 5% | 37% | 56%
src/logger0% | 0% | 0% | 58% | 41%
integration_test/functions0% | 0% | 0% | 20% | 79%
src/providers0% | 0% | 0% | 4% | 95%
src/runtime0% | 0% | 0% | 38% | 61%
src/v20% | 0% | 0% | 0% | 100%
docgen0% | 0% | 0% | 0% | 100%
spec/fixtures0% | 0% | 0% | 0% | 100%
src/utilities0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
docgen/theme0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function assertRuntimeOptionsValid()
in src/function-builder.ts
163 37 1
export function makeCloudFunction()
in src/cloud-functions.ts
95 14 1
export function encode()
in src/common/providers/https.ts
29 11 1
private _checkAndConvertToArray()
in src/providers/database.ts
34 10 1
33 9 0
export function extractStack()
in src/runtime/loader.ts
25 9 4
export function decode()
in src/common/providers/https.ts
33 9 1
function wrapOnCallHandler()
in src/common/providers/https.ts
47 9 2
34 9 0
function deepEq()
in integration_test/functions/src/testing.ts
20 8 2
function removeCircular()
in src/logger/index.ts
27 8 2
function isValidRequest()
in src/common/providers/https.ts
29 8 1
20 7 1
export function convertInvoker()
in src/common/encoding.ts
20 7 1
async function fetchDefaultDevice()
in integration_test/functions/src/testLab-utils.ts
27 6 1
export function write()
in src/logger/index.ts
25 6 1
export function onDispatchHandler()
in src/common/providers/https.ts
36 6 1
export function getOptsAndBucket()
in src/v2/providers/storage.ts
24 5 1
resource: triggerResource()
in src/cloud-functions.ts
24 5 0
export function _refWithOptions()
in src/providers/database.ts
34 5 2