microsoft / Dynamics-365-Fraud-Protection-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 253 units with 4,408 lines of code in units (40.2% of code).
    • 8 very long units (1,323 lines of code)
    • 10 long units (722 lines of code)
    • 27 medium size units (811 lines of code)
    • 49 small units (704 lines of code)
    • 159 very small units (848 lines of code)
30% | 16% | 18% | 15% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs32% | 15% | 17% | 15% | 19%
php17% | 23% | 22% | 18% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Infrastructure/Data69% | 0% | 7% | 12% | 10%
src/Infrastructure/Identity92% | 0% | 0% | 4% | 2%
src/Web/Controllers9% | 41% | 17% | 18% | 12%
eCommerce platforms/Adobe Magento/src17% | 23% | 22% | 18% | 18%
src/Web0% | 0% | 79% | 0% | 20%
src/Web/Services0% | 0% | 52% | 28% | 19%
src/ApplicationCore/Services0% | 0% | 38% | 30% | 30%
src/Infrastructure/Services0% | 0% | 32% | 9% | 57%
src/Web/Middleware0% | 0% | 76% | 23% | 0%
src/Web/Areas0% | 0% | 38% | 34% | 27%
src/ApplicationCore/Entities0% | 0% | 24% | 14% | 60%
src/Web/Extensions0% | 0% | 0% | 27% | 72%
src/Infrastructure/Extensions0% | 0% | 0% | 51% | 48%
src/Infrastructure/Utilities0% | 0% | 0% | 77% | 22%
src/ApplicationCore/Exceptions0% | 0% | 0% | 0% | 100%
src/ApplicationCore/Specifications0% | 0% | 0% | 0% | 100%
src/Web/ViewComponents0% | 0% | 0% | 0% | 100%
src/Web/ViewModels0% | 0% | 0% | 0% | 100%
src/Infrastructure/Logging0% | 0% | 0% | 0% | 100%
src/Web/Views0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected override void Up()
in src/Infrastructure/Identity/Migrations/20180916091145_Initial.cs
193 1 1
protected override void BuildTargetModel()
in src/Infrastructure/Data/Migrations/20190302011807_Initial.Designer.cs
189 1 1
protected override void BuildModel()
in src/Infrastructure/Data/Migrations/CatalogContextModelSnapshot.cs
189 1 1
protected override void BuildTargetModel()
in src/Infrastructure/Identity/Migrations/20180916091145_Initial.Designer.cs
171 1 1
protected override void BuildModel()
in src/Infrastructure/Identity/Migrations/AppIdentityDbContextModelSnapshot.cs
171 1 1
protected override void Up()
in src/Infrastructure/Data/Migrations/20190302011807_Initial.cs
169 1 1
private Purchase SetupPurchase()
in src/Web/Controllers/BasketController.cs
132 7 2
public function saveOrderAction()
in eCommerce platforms/Adobe Magento/src/code/local/Microsoft/Dfp/controllers/Checkout/OnepageController.php
109 18 0
private async Task RegisterUser()
in src/Web/Controllers/AccountController.cs
93 13 3
private function generatePurchasePayload()
in eCommerce platforms/Adobe Magento/src/code/local/Microsoft/Dfp/controllers/Checkout/OnepageController.php
82 6 2
private async Task SignInUser()
in src/Web/Controllers/AccountController.cs
82 5 3
public async Task Index()
in src/Web/Controllers/ManageController.cs
78 4 1
public async Task LabelOrder()
in src/Web/Controllers/OrderController.cs
71 11 7
public async Task ManagePaymentInstrument()
in src/Web/Controllers/ManageController.cs
70 3 1
private function generateUpdateAccountPayload()
in eCommerce platforms/Adobe Magento/src/code/local/Microsoft/Dfp/Model/Observer.php
63 4 1
private async Task ApproveOrRejectPurchase()
in src/Web/Controllers/BasketController.cs
62 9 5
public async Task Checkout()
in src/Web/Controllers/BasketController.cs
61 2 1
private SignUp CreateSignupEvent()
in src/Web/Controllers/AccountController.cs
60 1 1
private function GetPaymentInstrumentDetails()
in eCommerce platforms/Adobe Magento/src/code/local/Microsoft/Dfp/controllers/Checkout/OnepageController.php
42 4 1
public static void ConfigureExceptionHandler()
in src/Web/Middleware/ExceptionHandlingMiddleware.cs
42 2 1