aws-samples / graviton2-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 39 units with 763 lines of code in units (51.6% of code).
    • 1 very long units (117 lines of code)
    • 3 long units (176 lines of code)
    • 10 medium size units (268 lines of code)
    • 10 small units (150 lines of code)
    • 15 very small units (52 lines of code)
15% | 23% | 35% | 19% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py19% | 29% | 41% | 6% | 2%
java0% | 0% | 18% | 69% | 12%
lua0% | 0% | 0% | 44% | 55%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
graviton2/cs_graviton42% | 45% | 12% | 0% | 0%
graviton2/elasticsearch_graviton0% | 100% | 0% | 0% | 0%
graviton2/rds_graviton0% | 0% | 100% | 0% | 0%
scripts0% | 0% | 40% | 34% | 25%
src/main/java/com0% | 0% | 18% | 69% | 12%
graviton2/elasticsearch_graviton/lambdas0% | 0% | 100% | 0% | 0%
graviton2/vpc_base0% | 0% | 100% | 0% | 0%
ROOT0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in graviton2/cs_graviton/pipeline_graviton2.py
117 2 5
def __init__()
in graviton2/cs_graviton/pipeline_netcore_graviton2.py
64 1 5
def __init__()
in graviton2/cs_graviton/ecs_graviton2.py
61 1 5
def __init__()
in graviton2/elasticsearch_graviton/es.py
51 1 5
def __init__()
in graviton2/cs_graviton/eks_graviton2.py
34 2 5
def __init__()
in graviton2/rds_graviton/rds_restore.py
29 1 5
def main()
in scripts/elasticsearch-search.py
29 4 2
def __init__()
in graviton2/rds_graviton/rds_mysql_5.py
28 1 5
def __init__()
in graviton2/rds_graviton/rds_mysql_8.py
28 1 5
def main()
in scripts/elasticsearch-generate-data.py
28 5 1
private void initializeData()
in src/main/java/com/company/example/web/bookshop/VertxBookShopREST.java
24 1 0
def handler()
in graviton2/elasticsearch_graviton/lambdas/insert_into_index.py
24 4 2
def __init__()
in graviton2/rds_graviton/rds2.py
23 1 5
def __init__()
in graviton2/vpc_base/vpc.py
21 1 4
private void handleListCartItems()
in src/main/java/com/company/example/web/bookshop/VertxBookShopREST.java
19 4 1
lua
done = function()
in scripts/runner.lua
19 3 3
def process_file()
in scripts/plot_results.py
17 3 2
private void handleAddBook()
in src/main/java/com/company/example/web/bookshop/VertxBookShopREST.java
15 3 1
private void handleAddCart()
in src/main/java/com/company/example/web/bookshop/VertxBookShopREST.java
15 3 1
private void handleGetBook()
in src/main/java/com/company/example/web/bookshop/VertxBookShopREST.java
14 3 1