aws-samples / sagemaker-run-notebook
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 208 units with 2,915 lines of code in units (58.0% of code).
    • 1 very long units (244 lines of code)
    • 3 long units (196 lines of code)
    • 38 medium size units (1,124 lines of code)
    • 51 small units (753 lines of code)
    • 115 very small units (598 lines of code)
8% | 6% | 38% | 25% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py13% | 2% | 36% | 25% | 21%
ts0% | 39% | 30% | 13% | 16%
tsx0% | 6% | 44% | 28% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sagemaker_run_notebook20% | 0% | 41% | 20% | 17%
labextension/src0% | 100% | 0% | 0% | 0%
labextension/src/components0% | 6% | 45% | 29% | 18%
sagemaker_run_notebook/container0% | 81% | 0% | 0% | 18%
ROOT0% | 0% | 27% | 45% | 27%
sagemaker_run_notebook/server_extension0% | 0% | 27% | 35% | 36%
labextension/src/models0% | 0% | 41% | 27% | 30%
container0% | 0% | 100% | 0% | 0%
labextension/src/util0% | 0% | 100% | 0% | 0%
labextension/src/widgets0% | 0% | 0% | 0% | 100%
labextension/src/style0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def cli_argparser()
in sagemaker_run_notebook/cli.py
244 1 0
function activate()
in labextension/src/index.ts
87 7 6
render()
in labextension/src/components/RunDetailsDialog.tsx
55 4 0
def run_notebook()
in sagemaker_run_notebook/container/execute.py
54 12 0
def describe_run()
in sagemaker_run_notebook/run_notebook.py
45 8 2
render()
in labextension/src/components/ParameterEditor.tsx
43 3 0
def run_notebook()
in sagemaker_run_notebook/cli.py
39 8 1
def local_notebook()
in sagemaker_run_notebook/cli.py
39 5 1
def create_infrastructure()
in sagemaker_run_notebook/create_infrastructure.py
39 8 3
def create_lambda()
in sagemaker_run_notebook/run_notebook.py
38 9 2
private deleteRule()
in labextension/src/components/RuleList.tsx
37 4 1
def run_notebook()
in container/execute.py
36 7 0
def get_cluster_info()
in sagemaker_run_notebook/emr.py
35 6 2
def run()
in setupbase.py
33 13 1
33 15 1
def create_lambda_role()
in sagemaker_run_notebook/run_notebook.py
33 1 2
private computeNewJSON()
in labextension/src/components/ParameterEditor.tsx
33 6 1
function openResult()
in labextension/src/components/RunList.tsx
33 3 3
def log_stream()
in sagemaker_run_notebook/container_build.py
32 6 4
private renderRunParameters()
in labextension/src/components/SchedulePanel.tsx
32 1 0