aws-solutions / discovering-hot-topics-using-machine-learning
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 231 units with 3,396 lines of code in units (45.1% of code).
    • 3 very long units (715 lines of code)
    • 5 long units (334 lines of code)
    • 28 medium size units (804 lines of code)
    • 56 small units (855 lines of code)
    • 139 very small units (688 lines of code)
21% | 9% | 23% | 25% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts56% | 22% | 9% | 5% | 6%
py0% | 2% | 30% | 37% | 29%
js0% | 0% | 41% | 36% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/lib100% | 0% | 0% | 0% | 0%
source/lib/topic-analysis-workflow100% | 0% | 0% | 0% | 0%
source/lib/ingestion34% | 40% | 11% | 5% | 8%
source/lib/solution-helper0% | 73% | 0% | 22% | 3%
source/lib/text-analysis-workflow0% | 66% | 0% | 0% | 33%
source/lambda/capture_news_feed0% | 13% | 32% | 39% | 13%
source/lambda/quicksight-custom-resources0% | 0% | 18% | 38% | 43%
source/lambda/ingestion-youtube0% | 0% | 38% | 33% | 27%
source/lambda/ingestion-producer0% | 0% | 56% | 32% | 10%
source/lambda/wf_publish_topic_model0% | 0% | 43% | 51% | 4%
source/lambda/firehose_topic_proxy0% | 0% | 84% | 0% | 15%
source/lib/visualization0% | 0% | 88% | 0% | 11%
source/lambda/wf-detect-moderation-labels0% | 0% | 55% | 35% | 9%
source/lambda/solution_helper0% | 0% | 81% | 0% | 18%
source/lambda/wf-submit-topic-model0% | 0% | 56% | 43% | 0%
source/lib/awsnodejs-lambda-layer0% | 0% | 63% | 36% | 0%
source/lambda/wf-extract-text-in-image0% | 0% | 0% | 78% | 21%
source/lib/aspects0% | 0% | 0% | 76% | 23%
source/lambda/layers0% | 0% | 0% | 27% | 72%
source/lambda/wf-translate-text0% | 0% | 0% | 28% | 71%
source/lambda/wf-detect-language0% | 0% | 0% | 0% | 100%
source/lambda/wf-analyze-text0% | 0% | 0% | 0% | 100%
source/lib/quicksight-custom-resources0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/lib/discovering-hot-topics-stack.ts
356 5 3
constructor()
in source/lib/topic-analysis-workflow/topic-orchestration-construct.ts
222 9 3
constructor()
in source/lib/ingestion/youtube-comments-stacks.ts
137 2 3
constructor()
in source/lib/ingestion/newscatcher-stack.ts
94 2 3
constructor()
in source/lib/ingestion/twitter-search-stack.ts
66 2 3
constructor()
in source/lib/solution-helper/solution-helper-construct.ts
61 1 3
constructor()
in source/lib/text-analysis-workflow/callback-task-construct.ts
61 3 3
def create_and_publish_record()
in source/lambda/capture_news_feed/util/newscatcher_helper.py
52 16 5
def __init__()
in source/lambda/quicksight-custom-resources/util/quicksight_application.py
46 4 2
protected getColumns()
in source/lib/visualization/youtubecomments-table-construct.ts
45 1 0
async emptyBucket()
in source/lambda/wf-detect-moderation-labels/util/extract-image.js
41 7 2
def custom_resource()
in source/lambda/solution_helper/lambda_function.py
39 7 2
async emptyBucket()
in source/lambda/wf-submit-topic-model/util/extract-records.js
35 6 1
def search_comments()
in source/lambda/ingestion-youtube/util/comment.py
35 11 1
def is_file_available()
in source/lambda/wf_publish_topic_model/lambda_function.py
31 9 3
constructor()
in source/lib/awsnodejs-lambda-layer/layer.ts
30 6 3
def try_parsing_published_date()
in source/lambda/capture_news_feed/util/newscatcher_helper.py
30 6 1
async searchTweets()
in source/lambda/ingestion-producer/util/twitter-client.js
29 5 2
def process_create_request()
in source/lambda/quicksight-custom-resources/lambda_function.py
29 8 1
def process_response()
in source/lambda/ingestion-youtube/util/video.py
29 5 2