aws-samples / aws-service-catalog-reference-architectures
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 91 units with 1,389 lines of code in units (8.7% of code).
    • 1 very long units (159 lines of code)
    • 6 long units (447 lines of code)
    • 7 medium size units (231 lines of code)
    • 20 small units (273 lines of code)
    • 57 very small units (279 lines of code)
11% | 32% | 16% | 19% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py12% | 34% | 18% | 16% | 18%
c0% | 0% | 0% | 83% | 16%
cs0% | 0% | 0% | 29% | 70%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
security33% | 49% | 6% | 8% | 2%
bulkprovision0% | 32% | 30% | 15% | 22%
labs0% | 0% | 0% | 51% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def create_s3_destination()
in security/guardduty/index.py
159 5 1
def enable_gd_member()
in security/guardduty/index.py
92 14 4
def create_kms_key()
in security/guardduty/index.py
92 2 2
def HandleFailed()
in bulkprovision/bulkmonitor/__init__.py
82 29 1
def ProvisionProducts()
in bulkprovision/bulkexecute/__init__.py
66 17 1
def Run()
in bulkprovision/bulkmonitor/__init__.py
64 21 1
def handler()
in security/guardduty/index.py
51 16 2
def TerminateProducts()
in bulkprovision/bulkexecute/__init__.py
50 12 1
def RemoveEntries()
in bulkprovision/bulkmonitor/__init__.py
36 7 2
def lambda_handler()
in bulkprovision/lambda_email.py
33 5 2
def enable_gd_master()
in security/guardduty/index.py
33 8 1
def sendemail()
in bulkprovision/lambda_email.py
32 2 1
def handler()
in bulkprovision/lambda_startSF.py
25 4 2
def UploadCSV()
in bulkprovision/bulkexecute/__init__.py
22 3 1
def lambdaLoops()
in bulkprovision/testlambdas.py
19 7 0
def _dodotprod()
in labs/CalcAPI/remotetest.py
18 3 1
def cfnresponse()
in bulkprovision/common/__init__.py
17 3 6
def _getrandom()
in labs/CalcAPI/remotetest.py
15 4 2
def updateItem()
in bulkprovision/common/__init__.py
14 4 7
def monitor()
in bulkprovision/test.py
14 4 0