aws-samples / amazon-sagemaker-immersion-day
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 18 units with 157 lines of code in units (29.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (39 lines of code)
    • 1 small units (13 lines of code)
    • 16 very small units (105 lines of code)
0% | 0% | 24% | 8% | 66%
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% | 24% | 8% | 66%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 28% | 9% | 62%
ML Pipelines scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
39 12 3
def model()
in mnist-2.py
13 1 4
def get_session()
in ML Pipelines scripts/pipeline.py
10 1 2
def arg_check()
in util-cell-enumerate.py
10 4 1
def preprocess_handler()
in preprocessor.py
9 1 1
def renumber_code_cell()
in util-cell-enumerate.py
9 5 1
def main()
in util-cell-enumerate.py
9 2 0
def get_pipeline()
in ML Pipelines scripts/pipeline.py
8 1 7
def _parse_args()
in mnist-2.py
8 2 0
def parse()
in util-cell-enumerate.py
8 2 1
8 2 0
def renumber()
in util-cell-enumerate.py
5 2 1
4 1 1
4 1 1
4 1 1
4 1 1
3 1 0
def postprocess_handler()
in postprocessor.py
2 1 0