aws-samples / aws-twitterbot-workshop
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 23 units with 272 lines of code in units (62.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (61 lines of code)
    • 9 small units (127 lines of code)
    • 12 very small units (84 lines of code)
0% | 0% | 22% | 46% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 22% | 46% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Bot2/ImageUpdate/hello_world0% | 0% | 31% | 21% | 46%
Bot2/Poller0% | 0% | 33% | 35% | 30%
Bot1/instrumented_file0% | 0% | 0% | 100% | 0%
Bot1/hello_world0% | 0% | 0% | 76% | 23%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def process_messages()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
35 8 2
def lambda_handler()
in Bot2/Poller/twitterPoller.py
26 6 2
def retweet()
in Bot1/instrumented_file/twitterRetweet.py
16 5 3
def lambda_handler()
in Bot1/instrumented_file/twitterRetweet.py
16 2 2
def retweet()
in Bot1/hello_world/twitterRetweet.py
15 5 3
def lambda_handler()
in Bot1/hello_world/twitterRetweet.py
15 2 2
def defineMaxID()
in Bot2/Poller/twitterPoller.py
14 2 0
def build_send_sqs_message()
in Bot2/Poller/twitterPoller.py
14 1 4
def authenticate_twitter()
in Bot1/instrumented_file/twitterRetweet.py
13 1 0
def lambda_handler()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
13 3 2
def get_face_boxes()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
11 2 2
def configureSearch()
in Bot2/Poller/twitterPoller.py
10 2 1
def authenticate_twitter()
in Bot1/hello_world/twitterRetweet.py
9 1 0
def addidtolist()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
9 2 2
def authenticate_twitter()
in Bot2/Poller/twitterPoller.py
8 1 0
def authenticate_twitter()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
8 1 0
def updateImage()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
8 2 2
def tweetImage()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
7 1 2
def idinlist()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
7 3 2
def get_faces()
in Bot2/ImageUpdate/hello_world/twitterUpdateImage.py
6 2 1