aws-samples / amazon-lookout-for-vision-serverless-app
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 19 units with 337 lines of code in units (28.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (110 lines of code)
    • 5 medium size units (127 lines of code)
    • 5 small units (70 lines of code)
    • 7 very small units (30 lines of code)
0% | 32% | 37% | 20% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 36% | 35% | 18% | 10%
js0% | 0% | 56% | 43% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts0% | 100% | 0% | 0% | 0%
functions/DetectAnomaliesFunction0% | 44% | 21% | 26% | 7%
functions/DynamoDbToFirehose0% | 0% | 85% | 0% | 14%
functions/CreateS3BucketNotification0% | 0% | 54% | 22% | 24%
functions/CreateManifestFileInS30% | 0% | 58% | 30% | 10%
functions/ApiGwCustomAuthorizer0% | 0% | 56% | 43% | 0%
Alternative Visuals
Longest Units
Top 19 longest units
Unit# linesMcCabe index# params
def main()
in scripts/uploadImages.py
57 7 0
def lambda_handler()
in functions/DetectAnomaliesFunction/publishMessage.py
53 5 2
def put_record_in_firehose()
in functions/DynamoDbToFirehose/lambda_function.py
30 2 1
def add_notification()
in functions/CreateS3BucketNotification/lambda_function.py
27 1 3
def detect_anomalies()
in functions/DetectAnomaliesFunction/startDetectAnomalies.py
26 2 2
def create_manifest_file()
in functions/CreateManifestFileInS3/lambda_function.py
23 2 2
var generatePolicy = function()
in functions/ApiGwCustomAuthorizer/app.js
21 3 3
def lambda_handler()
in functions/DetectAnomaliesFunction/putItemInDynamoDb.py
19 2 2
exports.handler = function()
in functions/ApiGwCustomAuthorizer/app.js
16 4 3
def lambda_handler()
in functions/DetectAnomaliesFunction/startStateMachineExecution.py
12 1 2
def delete_manifest_file()
in functions/CreateManifestFileInS3/lambda_function.py
12 2 2
def create_s3_notification()
in functions/CreateS3BucketNotification/lambda_function.py
11 2 2
def lambda_handler()
in functions/DetectAnomaliesFunction/startDetectAnomalies.py
9 2 2
def delete_s3_notification()
in functions/CreateS3BucketNotification/lambda_function.py
8 2 2
def lambda_handler()
in functions/DynamoDbToFirehose/lambda_function.py
5 3 2
def handler()
in functions/CreateS3BucketNotification/lambda_function.py
2 1 2
def delete_notification()
in functions/CreateS3BucketNotification/lambda_function.py
2 1 1
def update_manifest_file()
in functions/CreateManifestFileInS3/lambda_function.py
2 1 2
def handler()
in functions/CreateManifestFileInS3/lambda_function.py
2 1 2