aws-samples / amazon-codeguru-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 13 units with 131 lines of code in units (77.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (31 lines of code)
    • 4 small units (54 lines of code)
    • 8 very small units (46 lines of code)
0% | 0% | 23% | 41% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 0% | 23% | 41% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
java0% | 0% | 24% | 42% | 33%
java/com/shipmentEvents/util0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 13 longest units
Unit# linesMcCabe index# params
public void pathTraversal2()
in src/main/java/Main.java
31 8 1
public void pathTraversal1()
in src/main/java/Main.java
20 5 1
public static void reEncrypt1()
in src/main/java/Main.java
12 1 0
public static void main()
in src/main/java/Main.java
11 1 1
public static void run1()
in src/main/java/Main.java
11 3 0
public static void run2()
in src/main/java/Main.java
10 3 0
public static void reEncrypt2()
in src/main/java/Main.java
8 1 0
private String decode()
in src/main/java/Main.java
8 2 2
static AWSCredentials getCreds()
in src/main/java/Main.java
5 1 0
public static void createCookie2()
in src/main/java/Main.java
5 1 1
public static void createCookie1()
in src/main/java/Main.java
4 1 1
public static AmazonS3 getS3Client()
in src/main/java/com/shipmentEvents/util/S3ClientUtil.java
3 1 0
static AWSCredentials getCreds()
in src/main/java/Main.java
3 1 2