microsoft / inventory-hub-java-on-azure
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 112 units with 798 lines of code in units (53.6% of code).
    • 1 very long units (117 lines of code)
    • 1 long units (55 lines of code)
    • 3 medium size units (86 lines of code)
    • 15 small units (215 lines of code)
    • 92 very small units (325 lines of code)
14% | 6% | 10% | 26% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java17% | 8% | 9% | 23% | 41%
js0% | 0% | 19% | 43% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
function-apps/Update-Product-Inventory/src/main/java/org/inventory/hub100% | 0% | 0% | 0% | 0%
dashboard-web-app/src/main/java/org/inventory/hub/controller0% | 34% | 37% | 16% | 11%
dashboard-web-app/src/main/resources/static0% | 0% | 37% | 35% | 27%
dashboard-web-app/src/main/resources/static/Scripts0% | 0% | 0% | 52% | 47%
dashboard-web-app/src/main/java/org/inventory/hub/event0% | 0% | 0% | 17% | 82%
dashboard-web-app/src/main/java/org/inventory/hub/model0% | 0% | 0% | 20% | 79%
function-apps/Point-Of-Transaction/src/main/java/org/inventory/hub0% | 0% | 0% | 100% | 0%
function-apps/Append-Transaction/src/main/java/org/inventory/hub0% | 0% | 0% | 50% | 50%
function-apps/Notify-Inventory/src/main/java/org/inventory/hub0% | 0% | 0% | 100% | 0%
dashboard-web-app/src/main/java/org/inventory/hub0% | 0% | 0% | 48% | 51%
dashboard-web-app/src/main/java/org/inventory/hub/security0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public void update()
in function-apps/Update-Product-Inventory/src/main/java/org/inventory/hub/UpdateProductInventory.java
117 15 5
public ResponseEntity getProducts()
in dashboard-web-app/src/main/java/org/inventory/hub/controller/ProductsInventoryController.java
55 8 0
public ResponseEntity getLocations()
in dashboard-web-app/src/main/java/org/inventory/hub/controller/ProductsInventoryController.java
35 5 0
async function showTable()
in dashboard-web-app/src/main/resources/static/app.js
26 1 0
public ResponseEntity getProduct()
in dashboard-web-app/src/main/java/org/inventory/hub/controller/ProductsInventoryController.java
25 3 1
$scope.fetchProductsAndEvents = function()
in dashboard-web-app/src/main/resources/static/Scripts/homeCtrl.js
20 1 0
public void sell()
in function-apps/Point-Of-Transaction/src/main/java/org/inventory/hub/POT.java
19 2 2
public void update()
in function-apps/Append-Transaction/src/main/java/org/inventory/hub/AppendTransaction.java
16 1 5
public ResponseEntity getTransactions()
in dashboard-web-app/src/main/java/org/inventory/hub/controller/TransactionsController.java
15 3 0
public String toString()
in dashboard-web-app/src/main/java/org/inventory/hub/event/Transaction.java
15 3 0
public void notifyInventoryUpdate()
in function-apps/Notify-Inventory/src/main/java/org/inventory/hub/NotifyInventoryUpdate.java
15 1 6
public void receiveTransaction()
in dashboard-web-app/src/main/java/org/inventory/hub/InventoryHub.java
14 2 1
function connect()
in dashboard-web-app/src/main/resources/static/app.js
14 1 0
public boolean equals()
in dashboard-web-app/src/main/java/org/inventory/hub/model/Location.java
13 6 1
public boolean equals()
in dashboard-web-app/src/main/java/org/inventory/hub/model/ProductsInventory.java
13 6 1
protected void configure()
in dashboard-web-app/src/main/java/org/inventory/hub/security/WebSecurityConfiguration.java
13 2 1
$scope.fetchUsername = function()
in dashboard-web-app/src/main/resources/static/Scripts/homeCtrl.js
13 2 0
public String currentUsername()
in dashboard-web-app/src/main/java/org/inventory/hub/controller/SecurityController.java
12 2 1
public void addFirst()
in dashboard-web-app/src/main/java/org/inventory/hub/event/TransactionsFIFO.java
12 3 1
function setConnected()
in dashboard-web-app/src/main/resources/static/app.js
11 2 1