awslabs / aws-apigateway-lambda-authorizer-blueprints
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 88 units with 691 lines of code in units (58.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 6 simple units (156 lines of code)
    • 82 very simple units (535 lines of code)
0% | 0% | 0% | 22% | 77%
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
js0% | 0% | 0% | 52% | 47%
cs0% | 0% | 0% | 19% | 80%
py0% | 0% | 0% | 26% | 73%
go0% | 0% | 0% | 22% | 77%
java0% | 0% | 0% | 0% | 100%
rs0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
nodejs0% | 0% | 0% | 52% | 47%
dotnet/src/APIGatewayAuthorizerHandler0% | 0% | 0% | 30% | 69%
python0% | 0% | 0% | 26% | 73%
go0% | 0% | 0% | 22% | 77%
java/src/io0% | 0% | 0% | 0% | 100%
dotnet/src/APIGatewayAuthorizerHandler/Model0% | 0% | 0% | 0% | 100%
rust0% | 0% | 0% | 0% | 100%
java/src/example0% | 0% | 0% | 0% | 100%
dotnet/src/APIGatewayAuthorizerHandler/Model/Auth0% | 0% | 0% | 0% | 100%
dotnet/src/APIGatewayAuthorizerHandler/Error0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in blueprints/go/main.go
21 9 1
def _addMethod()
in blueprints/python/api-gateway-authorizer-python.py
25 7 5
function AuthPolicy()
in blueprints/nodejs/index.js
23 7 3
var addMethod = function()
in blueprints/nodejs/index.js
30 7 4
var getStatementsForEffect = function()
in blueprints/nodejs/index.js
21 7 2
private void AddMethod()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/AuthPolicyBuilder.cs
36 7 4
def _getStatementForEffect()
in blueprints/python/api-gateway-authorizer-python.py
14 5 3
def build()
in blueprints/python/api-gateway-authorizer-python.py
14 5 1
build: function()
in blueprints/nodejs/index.js
15 5 0
private void addResourceToStatement()
in blueprints/java/src/io/AuthPolicy.java
8 4 3
public AuthPolicyBuilder()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/AuthPolicyBuilder.cs
8 4 3
func()
in blueprints/go/main.go
9 3 1
public AuthPolicy FunctionHandler()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/Function.cs
25 3 2
public AuthPolicy Build()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/AuthPolicyBuilder.cs
33 3 0
public Map getPolicyDocument()
in blueprints/java/src/io/AuthPolicy.java
17 2 0
public AuthPolicy handleRequest()
in blueprints/java/src/example/APIGatewayAuthorizerHandler.java
17 2 2
exports.handler = function()
in blueprints/nodejs/index.js
25 2 3
public static ApiGatewayArn Parse()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/Model/ApiGatewayArn.cs
18 2 1
public static bool TryParse()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/Model/ApiGatewayArn.cs
13 2 2
func handleRequest()
in blueprints/go/main.go
19 1 2