aws-samples / aws-photosharing-example
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 323 units with 2,251 lines of code in units (44.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (65 lines of code)
    • 10 medium size units (294 lines of code)
    • 48 small units (678 lines of code)
    • 264 very small units (1,214 lines of code)
0% | 2% | 13% | 30% | 53%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 2% | 13% | 29% | 53%
js0% | 0% | 0% | 40% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/main0% | 2% | 13% | 29% | 53%
WebContent/resources0% | 0% | 0% | 40% | 60%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public Media uploadPictureToS3()
in src/main/java/com/amazon/photosharing/facade/ContentFacade.java
65 8 5
public synchronized ListResponse list()
in src/main/java/com/amazon/photosharing/iface/ServiceFacade.java
43 9 1
public void validate()
in src/main/java/com/amazon/photosharing/view/ShareController.java
36 9 0
public boolean validateToken()
in src/main/java/com/amazon/photosharing/facade/TokenFacade.java
33 6 1
private Predicate getFilterPredicate()
in src/main/java/com/amazon/photosharing/iface/ServiceFacade.java
32 10 4
public Response uploadPictureToS3()
in src/main/java/com/amazon/photosharing/rest/ContentService.java
28 5 2
public List shareWithUsers()
in src/main/java/com/amazon/photosharing/facade/ShareFacade.java
26 7 2
public List shareWithUsers()
in src/main/java/com/amazon/photosharing/facade/ShareFacade.java
26 7 2
public boolean validateToken()
in src/main/java/com/amazon/photosharing/utils/TokenGenerator.java
24 5 3
public void deleteAlbums()
in src/main/java/com/amazon/photosharing/facade/AlbumFacade.java
24 6 2
public void run()
in src/main/java/com/amazon/photosharing/facade/ContentFacade.java
22 3 0
private List getSort()
in src/main/java/com/amazon/photosharing/iface/ServiceFacade.java
20 7 3
public Album storeAlbum()
in src/main/java/com/amazon/photosharing/facade/AlbumFacade.java
20 4 2
public boolean login()
in src/main/java/com/amazon/photosharing/facade/UserFacade.java
20 3 3
private void streamS3Content()
in src/main/java/com/amazon/photosharing/servlets/PrivateMediaServlet.java
20 5 4
public void removeMedia()
in src/main/java/com/amazon/photosharing/facade/AlbumFacade.java
19 5 3
public Share validateSharePermissions()
in src/main/java/com/amazon/photosharing/facade/ShareFacade.java
19 7 2
public static String getPasswordHash()
in src/main/java/com/amazon/photosharing/utils/Security.java
18 7 2
public User register()
in src/main/java/com/amazon/photosharing/facade/UserFacade.java
18 3 1
public UserResult()
in src/main/java/com/amazon/photosharing/rest/vo/UserResult.java
17 5 1