aws / jsii
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 3,490 units with 35,859 lines of code in units (72.5% of code).
    • 1 very complex units (307 lines of code)
    • 5 complex units (899 lines of code)
    • 64 medium complex units (4,007 lines of code)
    • 221 simple units (6,689 lines of code)
    • 3,199 very simple units (23,957 lines of code)
<1% | 2% | 11% | 18% | 66%
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% | 3% | 10% | 17% | 67%
go0% | 0% | 21% | 25% | 53%
cs0% | 0% | 12% | 25% | 61%
py0% | 0% | 7% | 20% | 71%
java0% | 0% | 3% | 17% | 79%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/jsii4% | 8% | 14% | 21% | 51%
packages/jsii-pacmak0% | 2% | 16% | 18% | 63%
packages/jsii-rosetta0% | 2% | 4% | 18% | 74%
packages/@jsii0% | 0% | 12% | 22% | 65%
packages/jsii-diff0% | 0% | 6% | 7% | 85%
packages/oo-ascii-tree0% | 0% | 49% | 0% | 50%
packages/jsii-reflect0% | 0% | 0% | 17% | 82%
packages/jsii-calc0% | 0% | 0% | 2% | 97%
ROOT0% | 0% | 0% | 89% | 10%
packages/jsii-config0% | 0% | 0% | 0% | 100%
packages/codemaker0% | 0% | 0% | 0% | 100%
tools/jsii-compliance0% | 0% | 0% | 0% | 100%
packages/@scope0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private async _visitClass()
in packages/jsii/lib/assembler.ts
307 54 2
private dispatch()
in packages/jsii-rosetta/lib/renderer.ts
150 48 1
public removeFrom()
in packages/jsii/lib/transforms/deprecated-remover.ts
171 44 1
private async _visitInterface()
in packages/jsii/lib/assembler.ts
204 34 2
private emitClassBuilder()
in packages/jsii-pacmak/lib/targets/java.ts
206 30 1
private async _visitNode()
in packages/jsii/lib/assembler.ts
168 28 2
private visitor()
in packages/jsii/lib/transforms/deprecated-remover.ts
99 25 1
func()
in packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go
65 22 1
private emitProperty()
in packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts
71 22 5
private addJavaDocs()
in packages/jsii-pacmak/lib/targets/java.ts
85 21 3
func()
in packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/conversions.go
70 20 1
func Create()
in packages/@jsii/go-runtime/jsii-runtime-go/runtime/runtime.go
70 19 3
public write()
in packages/jsii-pacmak/lib/targets/python.ts
184 19 2
export function serializationType()
in packages/@jsii/kernel/lib/serialization.ts
58 18 2
export function isSuperType()
in packages/jsii-diff/lib/type-analysis.ts
69 18 3
TypeReference InferType()
in packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/Converters/FrameworkToJsiiConverter.cs
78 17 2
public Type GetFrameworkType()
in packages/@jsii/dotnet-runtime/src/Amazon.JSII.Runtime/Services/TypeCache.cs
64 17 2
public emit()
in packages/jsii-pacmak/lib/targets/python.ts
120 17 3
private emitMethod()
in packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts
65 17 4
private emitInterfaceMembersForProxyOrDatatype()
in packages/jsii-pacmak/lib/targets/dotnet/dotnetgenerator.ts
90 17 3