awslabs / aws-lambda-dart-runtime
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 48 units with 307 lines of code in units (26.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (48 lines of code)
    • 5 small units (65 lines of code)
    • 41 very small units (194 lines of code)
0% | 0% | 15% | 21% | 63%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 0% | 15% | 21% | 63%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/runtime0% | 0% | 59% | 0% | 40%
lib/client0% | 0% | 0% | 64% | 35%
lib/events0% | 0% | 0% | 16% | 83%
example/lib0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Context copyWith()
in lib/runtime/context.dart
27 1 12
void invoke()
in lib/runtime/runtime.dart
21 4 0
Future postInvocationResponse()
in lib/client/client.dart
14 1 1
Future postInvocationError()
in lib/client/client.dart
14 1 2
const AwsCognitoResponse()
in lib/events/cognito_event.dart
13 1 12
const AwsApiGatewayEventRequestContextIdentity()
in lib/events/apigateway_event.dart
12 1 11
static Future fromResponse()
in lib/client/client.dart
12 1 1
const AwsApiGatewayEvent()
in lib/events/apigateway_event.dart
10 1 9
const AwsS3EventRecord()
in lib/events/s3_event.dart
10 1 9
const AwsSQSEventRecord()
in lib/events/sqs_event.dart
10 1 9
void main()
in example/lib/main.dart
10 1 0
const AwsCloudwatchEvent()
in lib/events/cloudwatch_event.dart
9 1 8
const AwsKinesisDataStreamRecord()
in lib/events/kinesis_data_stream_event.dart
9 1 8
const AwsCognitoEvent()
in lib/events/cognito_event.dart
9 1 8
const AwsApiGatewayEventRequestContext()
in lib/events/apigateway_event.dart
8 1 7
const AwsALBEvent()
in lib/events/alb_event.dart
8 1 7
const AwsCognitoRequest()
in lib/events/cognito_event.dart
8 1 7
const NextInvocation()
in lib/client/client.dart
8 1 7
const AwsDynamoDBUpdateEventRecord()
in lib/events/dynamodb_event.dart
7 1 6
Map toJson()
in lib/events/alb_event.dart
7 1 0