aws-samples / aws-service-catalog-preventive-control
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 65 units with 1,744 lines of code in units (28.2% of code).
    • 2 very long units (348 lines of code)
    • 7 long units (482 lines of code)
    • 18 medium size units (530 lines of code)
    • 17 small units (263 lines of code)
    • 21 very small units (121 lines of code)
19% | 27% | 30% | 15% | 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% | 27% | 30% | 15% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT87% | 0% | 12% | 0% | 0%
resource-compliance-lambda87% | 0% | 12% | 0% | 0%
resource-selector-lambda0% | 48% | 20% | 20% | 10%
control-tower-account-factory/src0% | 16% | 51% | 23% | 8%
deployment-lambda0% | 87% | 0% | 0% | 12%
product-selector-lambda0% | 71% | 28% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
174 2 2
def lambda_handler()
in resource-compliance-lambda/handler.py
174 2 2
def getSpotPrice()
in resource-selector-lambda/handler.py
90 10 1
def lambda_handler()
in resource-selector-lambda/handler.py
84 5 2
def deployProduct()
in deployment-lambda/handler.py
74 2 1
def __process_configuration()
in control-tower-account-factory/src/handler.py
63 34 1
def lambda_handler()
in product-selector-lambda/handler.py
59 1 2
def __init__()
in resource-selector-lambda/handler.py
58 47 2
def __baseline_products()
in control-tower-account-factory/src/handler.py
54 25 3
def _get_product_id()
in control-tower-account-factory/src/common.py
49 13 4
def _update_product_constraint()
in control-tower-account-factory/src/common.py
48 16 5
def __update_product()
in control-tower-account-factory/src/handler.py
39 3 2
def __provision_product()
in control-tower-account-factory/src/handler.py
37 3 2
def __add_lambda_to_portfolio_principal()
in control-tower-account-factory/src/common.py
35 13 2
def lambda_handler()
in control-tower-account-factory/src/handler.py
34 21 2
def __get_provision_status()
in control-tower-account-factory/src/handler.py
27 5 2
def getImage()
in resource-selector-lambda/handler.py
26 19 2
def getSecurityGroup()
in resource-selector-lambda/handler.py
25 19 3
def __get_account_list()
in control-tower-account-factory/src/handler.py
24 9 3
def __get_product_provision_list()
in control-tower-account-factory/src/handler.py
24 6 2