aws-samples / alexa-top-sites-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 35 units with 410 lines of code in units (56.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (100 lines of code)
    • 13 small units (195 lines of code)
    • 19 very small units (115 lines of code)
0% | 0% | 24% | 47% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
pl0% | 0% | 51% | 0% | 48%
py0% | 0% | 75% | 0% | 24%
java0% | 0% | 25% | 54% | 19%
php0% | 0% | 0% | 71% | 28%
cs0% | 0% | 0% | 100% | 0%
js0% | 0% | 0% | 100% | 0%
rb0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
legacy/perl0% | 0% | 51% | 0% | 48%
python0% | 0% | 75% | 0% | 24%
legacy/java0% | 0% | 41% | 43% | 14%
legacy/php0% | 0% | 0% | 70% | 29%
java/src/main/java/com/alexa/atsapi0% | 0% | 0% | 72% | 27%
php0% | 0% | 0% | 72% | 27%
dotnet0% | 0% | 0% | 100% | 0%
javascript0% | 0% | 0% | 100% | 0%
legacy/ruby0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
sub compose_url()
in legacy/perl/topsites.pl
35 3 0
def parse_options()
in python/topsites.py
34 20 1
public static void main()
in legacy/java/TopSites.java
31 3 1
public static String makeRequest()
in java/src/main/java/com/alexa/atsapi/ATS.java
20 3 2
public static String makeRequest()
in legacy/java/TopSites.java
20 5 3
public function getTopSites()
in legacy/php/topsites.php
16 1 0
protected function buildHeaders()
in legacy/php/topsites.php
16 4 1
15 2 0
protected function buildQueryParams()
in legacy/php/topsites.php
15 2 0
protected function makeRequest()
in legacy/php/topsites.php
15 1 2
public static void main()
in java/src/main/java/com/alexa/atsapi/ATS.java
14 4 1
function callATS()
in javascript/topsites.js
14 1 2
14 1 1
public TopSites()
in legacy/java/TopSites.java
12 1 3
12 1 1
static void Main()
in dotnet/Program.cs
12 2 1
sub generate_timestamp()
in legacy/perl/topsites.pl
10 1 0
private static void callATS()
in java/src/main/java/com/alexa/atsapi/ATS.java
9 1 1
def sortQueryString()
in python/topsites.py
8 2 1
sub signing_key()
in legacy/perl/topsites.pl
8 1 0