microsoft / GenStudio
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 71 units with 905 lines of code in units (20.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 12 medium size units (334 lines of code)
    • 23 small units (355 lines of code)
    • 36 very small units (216 lines of code)
0% | 0% | 36% | 39% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 64% | 20% | 15%
py0% | 0% | 22% | 48% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
website/src0% | 0% | 64% | 20% | 15%
api/ImageSimilarity0% | 0% | 23% | 66% | 10%
api/BigGAN0% | 0% | 40% | 26% | 32%
utilities/gan-inversion0% | 0% | 68% | 0% | 31%
utilities0% | 0% | 0% | 40% | 60%
utilities/thumbnail-creation0% | 0% | 0% | 86% | 13%
api/ProGAN0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function firstTimeGenImage()
in website/src/MapPage/map.js
42 5 1
def inversion()
in utilities/gan-inversion/02_invert_images.py
41 7 1
function registerValidSW()
in website/src/serviceWorker.js
33 8 2
def load_model()
in api/ImageSimilarity/deployment/app.py
32 2 0
function populateImageSeeds()
in website/src/MapPage/map.js
30 3 1
function touchHandler()
in website/src/MapPage/map.js
25 6 1
def imgrid()
in api/BigGAN/deployment/app.py
23 4 3
function checkValidServiceWorker()
in website/src/serviceWorker.js
23 4 2
export function register()
in website/src/serviceWorker.js
22 5 1
def sample_with_category()
in api/BigGAN/deployment/app.py
21 4 6
def getImage()
in api/ImageSimilarity/deployment/app.py
21 5 2
function getGenImage()
in website/src/MapPage/map.js
21 3 2
def generateMatchUrlBatch()
in api/ImageSimilarity/deployment/app.py
20 5 0
def sample()
in utilities/transition video.py
20 4 6
def FindSimilarImages()
in api/ImageSimilarity/deployment/app.py
19 4 0
def run()
in utilities/transition video.py
19 3 4
def sample_with_labels()
in api/BigGAN/deployment/app.py
18 3 6
def generateMatchUrl()
in api/ImageSimilarity/deployment/app.py
18 4 0
function updatePOI()
in website/src/MapPage/map.js
18 2 1
def preprocessInputBatch()
in api/ImageSimilarity/deployment/app.py
17 2 1