aws-samples / amazon-location-samples
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 66 units with 817 lines of code in units (14.3% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (166 lines of code)
    • 8 medium size units (203 lines of code)
    • 17 small units (244 lines of code)
    • 38 very small units (204 lines of code)
0% | 20% | 24% | 29% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 64% | 14% | 16% | 4%
js0% | 13% | 28% | 34% | 24%
swift0% | 0% | 30% | 29% | 40%
tsx0% | 0% | 0% | 48% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
maplibre-js-react-iot-asset-tracking0% | 17% | 27% | 39% | 16%
geocode-udf-lambda-redshift0% | 68% | 31% | 0% | 0%
geocode-udf-lambda-aurora0% | 80% | 0% | 19% | 0%
maplibre-native-ios0% | 0% | 40% | 16% | 44%
amazon-location-helpers0% | 0% | 43% | 0% | 56%
tracking-ios0% | 0% | 31% | 34% | 33%
aurora-udfs0% | 0% | 0% | 63% | 36%
tangram-es-ios0% | 0% | 0% | 46% | 53%
react-map-gl-amplify-marker-tooltip-example0% | 0% | 0% | 76% | 23%
tangram-js0% | 0% | 0% | 100% | 0%
maplibre-gl-js-react-amplify0% | 0% | 0% | 0% | 100%
maplibre-gl-js-vue-amplify0% | 0% | 0% | 0% | 100%
leaflet-vue-amplify0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function build()
in maplibre-js-react-iot-asset-tracking/scripts/build.js
60 11 1
def geocode_address()
in geocode-udf-lambda-redshift/Lambda/geocode.py
53 11 5
def geocode_address()
in geocode-udf-lambda-aurora/Lambda/geocode.py
53 11 5
func offlineStorage()
in maplibre-native-ios/Amazon Location Service Demo/AWSSignatureV4Delegate.swift
30 4 3
async function createRequestTransformer()
in amazon-location-helpers/index.js
28 6 4
function getModules()
in maplibre-js-react-iot-asset-tracking/config/modules.js
27 7 0
func locationManagerDidChangeAuthorization()
in tracking-ios/TrackingSample/LocationManagement.swift
26 6 1
function getClientEnvironment()
in maplibre-js-react-iot-asset-tracking/config/env.js
25 2 1
def lambda_handler()
in geocode-udf-lambda-redshift/Lambda/lambda_function.py
24 3 2
function getAdditionalModulePaths()
in maplibre-js-react-iot-asset-tracking/config/modules.js
22 5 1
function transformRequest()
in maplibre-js-react-iot-asset-tracking/src/LocationMap.js
21 6 2
_redraw()
in maplibre-js-react-iot-asset-tracking/src/PolylineOverlay.js
20 4 6
function validateKeyAndCerts()
in maplibre-js-react-iot-asset-tracking/config/getHttpsConfig.js
19 3 4
module.exports = function()
in maplibre-js-react-iot-asset-tracking/config/webpackDevServer.config.js
18 2 2
async function getAssetPositions()
in maplibre-js-react-iot-asset-tracking/src/LocationMap.js
18 2 0
func onTrackingEvent()
in tracking-ios/TrackingSample/LocationManagement.swift
15 6 1
function getHttpsConfig()
in maplibre-js-react-iot-asset-tracking/config/getHttpsConfig.js
15 4 0
func locationManager()
in tracking-ios/TrackingSample/LocationManagement.swift
14 4 2
def lambda_handler()
in aurora-udfs/search-place-index-for-text/lambda_function.py
14 5 2
async function signedFetch()
in tangram-js/sw.js
13 1 1