aws-samples / chip-wafer-classification-deep-learning
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 48 units with 626 lines of code in units (16.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (113 lines of code)
    • 7 medium size units (181 lines of code)
    • 11 small units (161 lines of code)
    • 28 very small units (171 lines of code)
0% | 18% | 28% | 25% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 20% | 24% | 22% | 32%
js0% | 16% | 32% | 28% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
notebooks0% | 47% | 0% | 26% | 26%
frontend/src/containers0% | 23% | 19% | 34% | 22%
frontend/src0% | 0% | 69% | 13% | 16%
lambda-rpi-inference0% | 0% | 58% | 25% | 16%
pytorch_code/classifier0% | 0% | 40% | 0% | 59%
deploy_code0% | 0% | 0% | 48% | 51%
frontend/src/components0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in notebooks/classify_mxnet.py
57 4 5
renderAll()
in frontend/src/containers/Home.js
56 1 0
def greengrass_object_classification_run()
in lambda-rpi-inference/greengrassObjectClassification.py
44 1 1
renderDetailCard()
in frontend/src/containers/Home.js
26 2 3
def _train()
in pytorch_code/classifier/classifier.py
24 5 1
constructor()
in frontend/src/containers/Home.js
22 1 1
export default function register()
in frontend/src/registerServiceWorker.js
22 5 0
function checkValidServiceWorker()
in frontend/src/registerServiceWorker.js
22 3 1
function registerValidSW()
in frontend/src/registerServiceWorker.js
21 3 1
renderImgCard()
in frontend/src/containers/Home.js
20 2 4
def transform_fn()
in notebooks/classify_mxnet.py
20 4 4
def predict()
in lambda-rpi-inference/greengrassObjectClassification.py
19 2 2
async componentDidMount()
in frontend/src/containers/Home.js
14 3 0
async updateImgList()
in frontend/src/containers/Home.js
13 3 4
handleImgPrev()
in frontend/src/containers/Home.js
13 2 0
handleImgNext()
in frontend/src/containers/Home.js
13 2 0
async componentDidMount()
in frontend/src/App.js
13 4 0
def create_endpoint_cfg()
in deploy_code/deploy.py
13 1 3
def get_train_data()
in notebooks/classify_mxnet.py
12 1 2
getimages()
in frontend/src/containers/Home.js
11 2 4