microsoft / Reporting-Services
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 74 units with 1,662 lines of code in units (10.1% of code).
    • 2 very long units (357 lines of code)
    • 2 long units (153 lines of code)
    • 29 medium size units (813 lines of code)
    • 12 small units (165 lines of code)
    • 29 very small units (174 lines of code)
21% | 9% | 48% | 9% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs23% | 10% | 47% | 9% | 9%
tsx0% | 0% | 83% | 0% | 16%
ts0% | 0% | 50% | 19% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
CustomSecuritySample201625% | 12% | 44% | 8% | 8%
CustomSecuritySample21% | 7% | 49% | 11% | 9%
APISamples/typescript/src0% | 0% | 65% | 10% | 23%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private static void InitializeMaps()
in CustomSecuritySample2016/Authorization.cs
203 8 0
private static void InitializeMaps()
in CustomSecuritySample/Authorization.cs
154 24 0
public StringCollection GetPermissions()
in CustomSecuritySample2016/Authorization.cs
97 34 4
public StringCollection GetPermissions()
in CustomSecuritySample/Authorization.cs
56 18 4
async uploadFileAsync()
in APISamples/typescript/src/api.ts
43 13 1
render()
in APISamples/typescript/src/home.tsx
37 2 0
internal static bool VerifyPassword()
in CustomSecuritySample/AuthenticationUtilities.cs
37 2 2
internal static bool VerifyPassword()
in CustomSecuritySample2016/AuthenticationUtilities.cs
37 2 2
private void ServerBtnLogon_Click()
in CustomSecuritySample/Logon.aspx.cs
35 4 2
private void ServerBtnLogon_Click()
in CustomSecuritySample2016/Logon.aspx.cs
35 4 2
internal static void StoreAccountDetails()
in CustomSecuritySample/AuthenticationUtilities.cs
32 5 3
internal static void StoreAccountDetails()
in CustomSecuritySample2016/AuthenticationUtilities.cs
32 5 3
public static bool VerifyUser()
in CustomSecuritySample/AuthenticationExtension.cs
30 3 1
public static bool VerifyUser()
in CustomSecuritySample2016/AuthenticationExtension.cs
30 3 1
render()
in APISamples/typescript/src/navbar.tsx
27 2 0
public bool CheckAccess()
in CustomSecuritySample/Authorization.cs
25 6 4
public bool CheckAccess()
in CustomSecuritySample/Authorization.cs
25 6 4
public bool CheckAccess()
in CustomSecuritySample/Authorization.cs
25 6 4
public bool CheckAccess()
in CustomSecuritySample/Authorization.cs
25 6 4
public bool CheckAccess()
in CustomSecuritySample2016/Authorization.cs
25 6 4