aws-samples / sagemaker-studio-auto-shutdown-extension
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 53 units with 666 lines of code in units (44.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (57 lines of code)
    • 6 medium size units (209 lines of code)
    • 16 small units (238 lines of code)
    • 30 very small units (162 lines of code)
0% | 8% | 31% | 35% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 10% | 22% | 43% | 22%
ts0% | 0% | 93% | 0% | 6%
tsx0% | 0% | 52% | 0% | 47%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
auto-installer/lambda0% | 69% | 0% | 30% | 0%
ROOT0% | 0% | 26% | 47% | 26%
labextension/src0% | 0% | 93% | 0% | 6%
labextension/src/components0% | 0% | 52% | 0% | 47%
extension-checker0% | 0% | 100% | 0% | 0%
sagemaker_studio_autoshutdown0% | 0% | 0% | 60% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run_commands()
in auto-installer/lambda/main.py
57 7 2
activate: async()
in labextension/src/index.ts
45 5 5
private renderViewButtons()
in labextension/src/components/AutoShutDownPanel.tsx
40 1 0
def lambda_handler()
in extension-checker/ext_checker.py
34 7 2
def run()
in setup.py
33 13 1
33 15 1
def which()
in setup.py
24 16 3
20 6 3
18 9 2
def is_idle()
in sagemaker_studio_autoshutdown/idle_checker.py
18 2 3
17 10 3
def _get_files()
in setup.py
17 10 2
16 5 1
def check_notebook()
in sagemaker_studio_autoshutdown/idle_checker.py
16 6 2
15 5 3
14 6 1
def __init__()
in sagemaker_studio_autoshutdown/idle_checker.py
14 2 1
def get_domain_id()
in auto-installer/lambda/main.py
13 4 0
13 9 2
13 5 2