aws-samples / cognito-device-grant-flow
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 23 units with 677 lines of code in units (83.5% of code).
    • 2 very long units (333 lines of code)
    • 2 long units (124 lines of code)
    • 2 medium size units (89 lines of code)
    • 5 small units (63 lines of code)
    • 12 very small units (68 lines of code)
49% | 18% | 13% | 9% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js49% | 18% | 13% | 9% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Modules49% | 18% | 13% | 9% | 10%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function requestJWTs()
in Modules/token-path.js
197 21 2
function requestUserCodeProcessing()
in Modules/device-path.js
136 13 2
function processPostRequest()
in Modules/token-path.js
64 22 2
function processAuthZCodeCallback()
in Modules/callback-path.js
60 5 2
function requestSetOfCodes()
in Modules/token-path.js
48 2 2
function processAllow()
in Modules/authorization-path.js
41 2 4
function requestUI()
in Modules/device-path.js
18 2 2
function randomString()
in Modules/common.js
12 8 2
11 1 3
11 1 1
function returnSlowDownError()
in Modules/common.js
11 1 1
function returnHTMLError()
in Modules/common.js
8 1 3
8 1 1
function returnJSONSuccess()
in Modules/common.js
8 1 2
function returnHTMLSuccess()
in Modules/common.js
8 1 2
function returnJSONError()
in Modules/common.js
7 1 2
function generateCookieVal()
in Modules/common.js
6 1 0
function base64UrlDecode()
in Modules/common.js
6 2 1
function base6UurlEncode()
in Modules/common.js
4 1 1
interval: parseInt()
in Modules/token-path.js
4 3 1