cdklabs / json2jsii
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 36 units with 360 lines of code in units (90.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (65 lines of code)
    • 0 medium complex units (0 lines of code)
    • 3 simple units (76 lines of code)
    • 32 very simple units (219 lines of code)
0% | 18% | 0% | 21% | 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
ts0% | 18% | 0% | 21% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src0% | 18% | 0% | 21% | 60%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private emitTypeInternal()
in src/type-generator.ts
65 34 3
private emitEnum()
in src/type-generator.ts
30 8 3
private tryEmitUnion()
in src/type-generator.ts
26 7 3
private emitDescription()
in src/type-generator.ts
20 6 4
private typeForRef()
in src/type-generator.ts
16 5 1
private resolveReference()
in src/type-generator.ts
12 5 1
private emitStruct()
in src/type-generator.ts
20 4 3
public static normalizeTypeName()
in src/type-generator.ts
17 3 1
public emitCustomType()
in src/type-generator.ts
13 3 2
private emitProperty()
in src/type-generator.ts
14 3 6
private typeForArray()
in src/type-generator.ts
6 3 2
private isExcluded()
in src/type-generator.ts
9 3 1
function supportedUnionOptionType()
in src/type-generator.ts
3 3 1
public line()
in src/code.ts
6 2 1
public emit()
in src/tojson.ts
18 2 1
constructor()
in src/type-generator.ts
9 2 1
public renderToCode()
in src/type-generator.ts
10 2 1
private isPropertyRequired()
in src/type-generator.ts
3 2 2
public open()
in src/code.ts
4 1 1
public close()
in src/code.ts
4 1 1