aws-samples / aws-modernization-with-snyk-security
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 6 units with 409 lines of code in units (24.4% of code).
    • 1 very long units (252 lines of code)
    • 1 long units (87 lines of code)
    • 1 medium size units (36 lines of code)
    • 2 small units (27 lines of code)
    • 1 very small units (7 lines of code)
61% | 21% | 8% | 6% | 1%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py61% | 21% | 8% | 6% | 1%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
workshop-resources/cdk/snyk-codesuite-cdk/cdk_stack_deploy87% | 0% | 12% | 0% | 0%
workshop-resources/cdk/snyk-codesuite-cdk/cdk_snyk_construct0% | 100% | 0% | 0% | 0%
workshop-resources/scripts0% | 0% | 0% | 79% | 20%
Alternative Visuals
Longest Units
Top 6 longest units
Unit# linesMcCabe index# params
def __init__()
in workshop-resources/cdk/snyk-codesuite-cdk/cdk_stack_deploy/cdk_snyk_codeartifact_stack.py
252 2 4
def __init__()
in workshop-resources/cdk/snyk-codesuite-cdk/cdk_snyk_construct/cdk_snyk_construct_stack.py
87 1 5
def __init__()
in workshop-resources/cdk/snyk-codesuite-cdk/cdk_stack_deploy/cdk_snyk_stack.py
36 1 4
def pipinstall()
in workshop-resources/scripts/pip_install.py
14 7 0
def getVersion()
in workshop-resources/scripts/list_repos.py
13 2 1
def getPackages()
in workshop-resources/scripts/list_repos.py
7 1 0