awslabs / aws-apigateway-lambda-authorizer-blueprints
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 88 units with 691 lines of code in units (58.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (265 lines of code)
    • 12 small units (186 lines of code)
    • 66 very small units (240 lines of code)
0% | 0% | 38% | 26% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 70% | 10% | 18%
cs0% | 0% | 51% | 17% | 30%
rs0% | 0% | 83% | 0% | 16%
py0% | 0% | 26% | 48% | 25%
go0% | 0% | 22% | 51% | 25%
java0% | 0% | 0% | 30% | 70%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
nodejs0% | 0% | 70% | 10% | 18%
dotnet/src/APIGatewayAuthorizerHandler0% | 0% | 79% | 0% | 20%
rust0% | 0% | 83% | 0% | 16%
python0% | 0% | 26% | 48% | 25%
go0% | 0% | 22% | 51% | 25%
dotnet/src/APIGatewayAuthorizerHandler/Model0% | 0% | 0% | 59% | 40%
java/src/io0% | 0% | 0% | 21% | 78%
java/src/example0% | 0% | 0% | 100% | 0%
dotnet/src/APIGatewayAuthorizerHandler/Model/Auth0% | 0% | 0% | 0% | 100%
dotnet/src/APIGatewayAuthorizerHandler/Error0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void AddMethod()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/AuthPolicyBuilder.cs
36 7 4
public AuthPolicy Build()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/AuthPolicyBuilder.cs
33 3 0
var addMethod = function()
in blueprints/nodejs/index.js
30 7 4
fn my_handler()
in blueprints/rust/main.rs
26 1 2
def _addMethod()
in blueprints/python/api-gateway-authorizer-python.py
25 7 5
exports.handler = function()
in blueprints/nodejs/index.js
25 2 3
public AuthPolicy FunctionHandler()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/Function.cs
25 3 2
function AuthPolicy()
in blueprints/nodejs/index.js
23 7 3
func()
in blueprints/go/main.go
21 9 1
var getStatementsForEffect = function()
in blueprints/nodejs/index.js
21 7 2
func handleRequest()
in blueprints/go/main.go
19 1 2
def lambda_handler()
in blueprints/python/api-gateway-authorizer-python.py
19 1 2
public static ApiGatewayArn Parse()
in blueprints/dotnet/src/APIGatewayAuthorizerHandler/Model/ApiGatewayArn.cs
18 2 1
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
func()
in blueprints/go/main.go
15 1 1
build: function()
in blueprints/nodejs/index.js
15 5 0
func NewAuthorizerResponse()
in blueprints/go/main.go
14 1 2
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