aws-samples / ci-cd-servicecatalog-ams
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 18 units with 768 lines of code in units (88.5% of code).
    • 3 very long units (382 lines of code)
    • 3 long units (173 lines of code)
    • 5 medium size units (129 lines of code)
    • 4 small units (59 lines of code)
    • 3 very small units (25 lines of code)
49% | 22% | 16% | 7% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts66% | 27% | 6% | 0% | 0%
py31% | 16% | 28% | 16% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/pipeline100% | 0% | 0% | 0% | 0%
lib/iam45% | 44% | 9% | 0% | 0%
src36% | 18% | 25% | 14% | 5%
lib/asset0% | 0% | 50% | 31% | 18%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
constructor()
in lib/pipeline/s3SourceAction.ts
153 1 3
constructor()
in lib/iam/sclaunch.ts
117 1 3
def createProduct()
in src/servicecatalog.py
112 11 2
constructor()
in lib/iam/snowrole.ts
63 1 3
def __init__()
in src/servicecatalog.py
59 3 1
constructor()
in lib/iam/iam.ts
51 1 3
def deployStack()
in src/servicecatalog.py
29 5 1
def uploadArtifact()
in src/servicecatalog.py
28 2 1
constructor()
in lib/iam/lambda_role.ts
25 1 3
def send()
in lib/asset/index.py
24 3 6
def checkIfPortFolioExist()
in src/servicecatalog.py
23 4 1
def checkProvisionProductStatus()
in src/servicecatalog.py
17 7 2
16 5 3
def uploadtoS3()
in lib/asset/index.py
15 2 4
def checkVersion()
in src/servicecatalog.py
11 3 2
def lambda_handler()
in lib/asset/index.py
9 2 2
def provisionProduct()
in src/servicecatalog.py
8 1 2
def update_provisioned_product()
in src/servicecatalog.py
8 1 4