aws-samples / aws-deeplens-recipes
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 57 units with 853 lines of code in units (10.1% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (215 lines of code)
    • 11 medium size units (305 lines of code)
    • 12 small units (192 lines of code)
    • 31 very small units (141 lines of code)
0% | 25% | 35% | 22% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 25% | 35% | 22% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
static/code/coffee-counter0% | 62% | 30% | 4% | 2%
static/code/worker-safety0% | 14% | 31% | 36% | 16%
static/code/trash-sorter0% | 0% | 49% | 17% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def greengrass_infinite_infer_run()
in static/code/coffee-counter/deeplens_inference_function.py
82 9 0
def detect_faces()
in static/code/coffee-counter/face_function.py
75 9 3
def greengrass_infinite_infer_run()
in static/code/worker-safety/deeplens-lambda/lambda_function.py
58 24 0
def main()
in static/code/coffee-counter/app/application.py
44 7 0
def lambda_handler()
in static/code/coffee-counter/face_function.py
33 5 2
def infinite_infer_run()
in static/code/trash-sorter/deeplens-trash-lambda/lambda_function.py
31 10 0
def matchPersonsAndHats()
in static/code/worker-safety/cloud-lambda.py
30 9 2
def invoke()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/Lambda.py
29 13 2
def invoke()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/Lambda.py
29 13 2
def lambda_handler()
in static/code/worker-safety/cloud-lambda.py
23 1 2
def _shadow_op()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/IoTDataPlane.py
22 4 4
def _shadow_op()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/IoTDataPlane.py
22 4 4
def mock()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/utils/testing.py
21 4 1
def mock()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/utils/testing.py
21 4 1
def getBoundingBoxCoordinates()
in static/code/worker-safety/cloud-lambda.py
20 1 3
def push_to_s3()
in static/code/worker-safety/deeplens-lambda/lambda_function.py
20 2 1
def _invoke_internal()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/Lambda.py
19 4 5
def _invoke_internal()
in static/code/trash-sorter/deeplens-trash-lambda/greengrasssdk/Lambda.py
19 4 5
def localTest()
in static/code/worker-safety/cloud-lambda.py
18 1 0
def publish()
in static/code/worker-safety/deeplens-lambda/greengrasssdk/IoTDataPlane.py
17 1 2