aws-samples / sagemaker-model-monitor-bring-your-own-container
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 40 units with 359 lines of code in units (85.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (25 lines of code)
    • 12 small units (166 lines of code)
    • 27 very small units (168 lines of code)
0% | 0% | 6% | 46% | 46%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 6% | 46% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 10% | 47% | 42%
ROOT0% | 0% | 0% | 39% | 61%
script0% | 0% | 0% | 75% | 25%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def compute_drift()
in src/drift_detector.py
25 5 2
def main()
in src/drift_detector.py
20 2 3
16 3 3
15 3 1
14 3 1
14 5 3
def push()
in docker_utils.py
14 4 3
def _check_output()
in docker_utils.py
14 4 3
def __plot_top_k_drifts()
in src/drift_visualizer.py
12 3 4
def compute_accuracy_with_drift()
in src/drift_detector.py
12 2 3
12 5 2
def input_fn()
in script/inference.py
12 2 2
def _execute()
in docker_utils.py
11 4 2
def compute_drift_multiple_inst()
in src/drift_detector.py
10 5 2
10 2 2
def cum_sum_prob()
in src/utils.py
9 3 1
def _ecr_login()
in docker_utils.py
9 1 2
8 2 2
def auto_impute_df()
in src/utils.py
8 5 1
def get_column_types()
in src/utils.py
8 4 1