aws-samples / alexa-web-information-service-api-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 101 units with 1,382 lines of code in units (67.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (58 lines of code)
    • 18 medium size units (544 lines of code)
    • 32 small units (502 lines of code)
    • 50 very small units (278 lines of code)
0% | 4% | 39% | 36% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 8% | 35% | 38% | 16%
cs0% | 0% | 51% | 26% | 21%
py0% | 0% | 78% | 0% | 21%
js0% | 0% | 76% | 20% | 3%
php0% | 0% | 16% | 62% | 20%
pl0% | 0% | 46% | 0% | 53%
rb0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
java/src0% | 9% | 35% | 38% | 16%
dotnet0% | 0% | 59% | 21% | 18%
python0% | 0% | 78% | 0% | 21%
javascript0% | 0% | 76% | 20% | 3%
php0% | 0% | 24% | 53% | 21%
legacy/perl0% | 0% | 46% | 0% | 53%
legacy/java0% | 0% | 39% | 45% | 15%
legacy/php0% | 0% | 0% | 80% | 19%
legacy/dotnet0% | 0% | 0% | 61% | 38%
legacy/ruby0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
String httpPost()
in java/src/main/java/com/alexa/awisapi/AuthHttpClient.java
58 14 2
45 2 0
private RespondToAuthChallengeRequest userSrpAuthRequest()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
43 3 2
function login()
in javascript/urlinfo.js
40 2 2
def refresh_credentials()
in python/awis.py
36 1 1
def parse_options()
in python/awis.py
35 19 1
35 3 2
sub compose_url()
in legacy/perl/urlinfo.pl
33 3 0
private void deriveKey()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
32 7 4
boolean SignUpUser()
in java/src/main/java/com/alexa/awisapi/CognitoHelper.java
29 2 4
public static void main()
in legacy/java/UrlInfo.java
28 2 1
27 7 0
private static boolean ValidateUser()
in java/src/main/java/com/alexa/awisapi/AWIS.java
26 5 1
function getCredentials()
in javascript/urlinfo.js
24 3 1
public CognitoHelper()
in java/src/main/java/com/alexa/awisapi/CognitoHelper.java
23 4 0
private static void callAWIS()
in java/src/main/java/com/alexa/awisapi/AWIS.java
23 1 1
String PerformSRPAuthentication()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
22 3 2
public static String makeRequest()
in java/src/main/java/com/alexa/awisapi/AWIS.java
22 3 5
21 2 1
private void init()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
20 4 2