awslabs / sagemaker-explaining-credit-decisions
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 419 units with 4,202 lines of code in units (64.0% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (366 lines of code)
    • 38 medium size units (1,052 lines of code)
    • 99 small units (1,469 lines of code)
    • 276 very small units (1,315 lines of code)
0% | 8% | 25% | 34% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 25% | 34% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sagemaker_notebook_instance/containers0% | 24% | 22% | 29% | 24%
sagemaker_studio/containers0% | 24% | 22% | 29% | 24%
sagemaker/containers0% | 24% | 22% | 29% | 24%
sagemaker_notebook_instance/package0% | 0% | 28% | 40% | 31%
sagemaker_studio/package0% | 0% | 28% | 40% | 31%
sagemaker/package0% | 0% | 25% | 41% | 32%
cloudformation/solution-assistant0% | 0% | 21% | 37% | 40%
sagemaker0% | 0% | 35% | 33% | 30%
sagemaker_notebook_instance0% | 0% | 37% | 34% | 28%
sagemaker_studio0% | 0% | 37% | 34% | 28%
glue0% | 0% | 13% | 21% | 64%
sagemaker_studio/notebooks0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def parse_args()
in sagemaker_notebook_instance/containers/model/src/training.py
64 1 1
def parse_args()
in sagemaker_studio/containers/model/src/training.py
64 1 1
def parse_args()
in sagemaker/containers/model/src/training.py
64 1 1
def show()
in sagemaker_notebook_instance/containers/dashboard/src/pages/local_page.py
58 6 1
def show()
in sagemaker_studio/containers/dashboard/src/pages/local_page.py
58 6 1
def show()
in sagemaker/containers/dashboard/src/pages/local_page.py
58 6 1
def predict_fn()
in sagemaker_notebook_instance/containers/model/src/explaining.py
39 14 2
def create_report_html()
in sagemaker_notebook_instance/package/package/reports/reports.py
39 1 2
def predict_fn()
in sagemaker_studio/containers/model/src/explaining.py
39 14 2
def create_report_html()
in sagemaker_studio/package/package/reports/reports.py
39 1 2
def predict_fn()
in sagemaker/containers/model/src/explaining.py
39 14 2
def create_report_html()
in sagemaker/package/package/reports/reports.py
39 1 2
def _set_figure()
in sagemaker_notebook_instance/package/package/visuals.py
34 1 1
def _set_figure()
in sagemaker_studio/package/package/visuals.py
34 1 1
def _set_figure()
in sagemaker/package/package/visuals.py
34 1 1
def log_stream()
in sagemaker_notebook_instance/package/package/sagemaker/logs.py
32 6 4
def log_stream()
in sagemaker_studio/package/package/sagemaker/logs.py
32 6 4
def train_fn()
in sagemaker_notebook_instance/containers/model/src/training.py
28 1 1
def train_fn()
in sagemaker_studio/containers/model/src/training.py
28 1 1
def train_fn()
in sagemaker/containers/model/src/training.py
28 1 1