aws-samples / aws-photo-to-sketch
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 498 lines of code in units (57.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 6 medium size units (171 lines of code)
    • 8 small units (110 lines of code)
    • 33 very small units (166 lines of code)
0% | 10% | 34% | 22% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 22% | 49% | 9% | 18%
swift0% | 0% | 21% | 32% | 45%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/lambda0% | 50% | 49% | 0% | 0%
application/PhotoToSketch/PhotoToSketch/EffectApplyScreen0% | 0% | 21% | 51% | 26%
src/src0% | 0% | 47% | 16% | 36%
src/lambda-inference0% | 0% | 52% | 18% | 29%
application/PhotoToSketch/PhotoToSketch/CameraScreen0% | 0% | 33% | 0% | 66%
application/PhotoToSketch/PhotoToSketch/Helpers0% | 0% | 0% | 45% | 54%
application/PhotoToSketch/PhotoToSketch0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def create_lambda_role()
in src/lambda/iam_helper.py
51 3 1
def inference()
in src/src/predictor.py
32 2 0
def lambda_handler()
in src/lambda-inference/app.py
32 1 2
func applyEffect()
in application/PhotoToSketch/PhotoToSketch/EffectApplyScreen/EffectApplyViewController.swift
32 1 1
def lambda_handler()
in src/lambda/create_endpoint.py
26 1 2
func checkRecordState()
in application/PhotoToSketch/PhotoToSketch/CameraScreen/CameraViewController.swift
25 5 0
def lambda_handler()
in src/lambda/create_model.py
24 1 2
func collectionView()
in application/PhotoToSketch/PhotoToSketch/EffectApplyScreen/EffectApplyViewController.swift
20 4 2
func checkIntensityView()
in application/PhotoToSketch/PhotoToSketch/EffectApplyScreen/EffectApplyViewController.swift
19 3 0
func asImage()
in application/PhotoToSketch/PhotoToSketch/EffectApplyScreen/EffectApplyViewController.swift
14 2 0
func rotate()
in application/PhotoToSketch/PhotoToSketch/EffectApplyScreen/EffectApplyViewController.swift
13 1 1
def load_img()
in src/src/predictor.py
11 1 1
def load_img()
in src/lambda-inference/app.py
11 1 1
func collectionView()
in application/PhotoToSketch/PhotoToSketch/EffectApplyScreen/EffectApplyViewController.swift
11 4 3
func topViewController()
in application/PhotoToSketch/PhotoToSketch/Helpers/PhotoToSketchLoader.swift
11 3 0
func handleDenied()
in application/PhotoToSketch/PhotoToSketch/CameraScreen/CameraViewController.swift
10 1 0
func photoOutput()
in application/PhotoToSketch/PhotoToSketch/CameraScreen/CameraViewController.swift
10 2 3
func cameraWithPosition()
in application/PhotoToSketch/PhotoToSketch/CameraScreen/CameraViewController.swift
9 3 1
func imagePickerController()
in application/PhotoToSketch/PhotoToSketch/CameraScreen/CameraViewController.swift
9 2 2
func scrollViewDidScroll()
in application/PhotoToSketch/PhotoToSketch/EffectApplyScreen/EffectApplyViewController.swift
8 2 1