firebase / firebase-tools
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 1,749 units with 30,168 lines of code in units (61.1% of code).
    • 1 very complex units (401 lines of code)
    • 11 complex units (1,793 lines of code)
    • 57 medium complex units (3,821 lines of code)
    • 180 simple units (5,969 lines of code)
    • 1,500 very simple units (18,184 lines of code)
1% | 5% | 12% | 19% | 60%
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
ts1% | 6% | 13% | 19% | 59%
js0% | 2% | 7% | 25% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/emulator4% | 11% | 15% | 17% | 50%
src0% | 5% | 8% | 27% | 58%
src/commands0% | 14% | 2% | 19% | 63%
src/firestore0% | 19% | 7% | 6% | 66%
src/extensions0% | 3% | 12% | 23% | 60%
src/hosting0% | 18% | 11% | 23% | 45%
src/deploy0% | 0% | 21% | 24% | 53%
scripts/storage-emulator-integration0% | 0% | 47% | 0% | 52%
src/init0% | 0% | 17% | 2% | 79%
src/gcp0% | 0% | 0% | 22% | 77%
src/functions0% | 0% | 0% | 51% | 48%
src/management0% | 0% | 0% | 16% | 83%
scripts0% | 0% | 0% | 8% | 91%
src/database0% | 0% | 0% | 27% | 72%
src/appdistribution0% | 0% | 0% | 33% | 66%
standalone0% | 0% | 0% | 8% | 91%
src/throttler0% | 0% | 0% | 18% | 81%
src/serve0% | 0% | 0% | 0% | 100%
src/remoteconfig0% | 0% | 0% | 0% | 100%
scripts/integration-helpers0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function createFirebaseEndpoints()
in src/emulator/storage/apis/firebase.ts
401 59 1
export function validateSpec()
in src/extensions/extensionsHelper.ts
112 47 1
function batchCreate()
in src/emulator/auth/operations.ts
169 45 2
export async function startAll()
in src/emulator/controller.ts
330 45 2
export function registerHandlers()
in src/emulator/auth/handlers.ts
231 37 3
105 35 2
133 33 1
async function installExtension()
in src/commands/ext-install.ts
152 31 1
94 30 1
function signInWithIdp()
in src/emulator/auth/operations.ts
141 29 2
export function createCloudEndpoints()
in src/emulator/storage/apis/gcloud.ts
206 27 1
private recursiveBatchDelete()
in src/firestore/delete.ts
120 26 0
export async function prepare()
in src/deploy/extensions/prepare.ts
91 23 3
124 21 1
async loadTriggers()
in src/emulator/functionsEmulator.ts
132 21 2
export async function doSetup()
in src/init/features/emulators.ts
51 20 2
function signUp()
in src/emulator/auth/operations.ts
89 18 3
export function convertConfig()
in src/deploy/hosting/convertConfig.ts
63 18 1
export function assertKeyTypes()
in src/deploy/functions/runtimes/discovery/parsing.ts
41 18 3
export function checkResponse()
in src/extensions/askUserForParam.ts
37 17 2