microsoft / TypeScript-DOM-lib-generator
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 243 units with 3,387 lines of code in units (36.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (62 lines of code)
    • 9 medium complex units (528 lines of code)
    • 31 simple units (778 lines of code)
    • 202 very simple units (2,019 lines of code)
0% | 1% | 15% | 22% | 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% | 1% | 16% | 23% | 58%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/build0% | 2% | 13% | 24% | 59%
src0% | 0% | 31% | 12% | 55%
src/build/bcd0% | 0% | 0% | 100% | 0%
deploy0% | 0% | 0% | 0% | 100%
src/build/webref0% | 0% | 0% | 0% | 100%
src/build/utils0% | 0% | 0% | 0% | 100%
unittests/files0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
62 26 2
127 20 0
function emitProperty()
in src/build/emitter.ts
55 19 4
export function convert()
in src/build/widlprocess.ts
67 15 2
export function getExposedTypes()
in src/build/expose.ts
72 13 3
export function merge()
in src/build/helpers.ts
34 13 3
function emitIterator()
in src/build/emitter.ts
53 12 1
function test()
in src/test.ts
39 12 0
41 11 2
function emitMethods()
in src/build/emitter.ts
40 11 4
18 10 1
function paramToString()
in src/build/emitter.ts
19 10 1
export function collectLegacyNamespaceTypes()
in src/build/legacy-namespace.ts
33 10 1
function convertConstantValue()
in src/build/widlprocess.ts
19 10 1
function mergeCompatStatements()
in src/build/bcd/mapper.ts
28 9 1
22 9 2
function mapInterfaceLike()
in src/build/bcd/mapper.ts
40 8 3
export function resolveExposure()
in src/build/helpers.ts
17 8 3
function processComments()
in src/fetch-comment.ts
33 8 1
18 7 1