aws-samples / devsecops-cicd
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 29 units with 356 lines of code in units (8.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (92 lines of code)
    • 4 medium size units (126 lines of code)
    • 4 small units (47 lines of code)
    • 20 very small units (91 lines of code)
0% | 25% | 35% | 13% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 65% | 29% | 0% | 4%
java0% | 0% | 39% | 21% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda-functions0% | 65% | 29% | 0% | 4%
workshop/workshop-java-repo-vulnerable/src/main/java/com0% | 0% | 49% | 13% | 36%
workshop/workshop-java-repo/src/main/java/org0% | 0% | 0% | 52% | 47%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def process_message()
in lambda-functions/import_findings_security_hub.py
92 21 1
def import_finding_to_sh()
in lambda-functions/securityhub.py
42 2 17
private List processEventsInBucket()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/shipmentEvents/handlers/EventHandler.java
34 8 3
private void processShipmentUpdates()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/shipmentEvents/handlers/EventHandler.java
27 5 1
public void pathTraversal1()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/shipmentEvents/handlers/EventHandler.java
23 5 1
private boolean isValidFile()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/shipmentEvents/handlers/EventHandler.java
12 4 1
private static String loadIndex()
in workshop/workshop-java-repo/src/main/java/org/example/Application.java
12 3 0
public void handle()
in workshop/workshop-java-repo/src/main/java/org/example/Application.java
12 2 4
public String Input()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/handlingformsubmission/GreetingController.java
11 2 2
public String handleRequest()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/shipmentEvents/handlers/EventHandler.java
10 2 2
private String decode()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/shipmentEvents/handlers/EventHandler.java
8 2 2
def lambda_handler()
in lambda-functions/import_findings_security_hub.py
7 2 2
private void deleteProcessedFiles()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/shipmentEvents/handlers/EventHandler.java
7 2 1
public static void main()
in workshop/workshop-java-repo/src/main/java/org/example/Application.java
7 1 1
private static String getStackTrace()
in workshop/workshop-java-repo/src/main/java/org/example/Application.java
6 1 1
public String helloForm()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/handlingformsubmission/GreetingController.java
4 1 1
public String greetingSubmit()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/handlingformsubmission/GreetingController.java
4 1 2
public String index()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/handlingformsubmission/GreetingController.java
4 1 1
public void header()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/handlingformsubmission/GreetingController.java
4 1 2
public static AmazonS3 getS3Client()
in workshop/workshop-java-repo-vulnerable/src/main/java/com/shipmentEvents/util/S3ClientUtil.java
3 1 0