microsoft / powerbi-powershell
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 352 units with 3,772 lines of code in units (38.7% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (398 lines of code)
    • 46 medium size units (1,415 lines of code)
    • 78 small units (1,105 lines of code)
    • 222 very small units (854 lines of code)
0% | 10% | 37% | 29% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 10% | 37% | 29% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Modules/Profile0% | 40% | 35% | 19% | 5%
src/Modules/Reports0% | 27% | 42% | 18% | 11%
src/Common/Commands.Common0% | 13% | 31% | 30% | 24%
src/Modules/Data0% | 10% | 53% | 10% | 25%
src/Common/Common.Api0% | 0% | 23% | 43% | 33%
src/Common/Common.Authentication0% | 0% | 57% | 30% | 12%
src/Modules/Workspaces0% | 0% | 53% | 26% | 20%
src/Modules/Admin0% | 0% | 46% | 31% | 21%
src/Modules/Capacities0% | 0% | 0% | 94% | 5%
src/Common/Common.Abstractions0% | 0% | 0% | 41% | 58%
src/Common/Common.Client0% | 0% | 0% | 36% | 63%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public override void ExecuteCmdlet()
in src/Modules/Profile/Commands.Profile/ConnectPowerBIServiceAccount.cs
87 11 0
private async Task InvokeRestMethod()
in src/Modules/Profile/Commands.Profile/InvokePowerBIRestMethod.cs
83 15 3
public PowerBISettings()
in src/Common/Commands.Common/PowerBISettings.cs
75 10 3
public override void ExecuteCmdlet()
in src/Modules/Data/Commands.Data/GetPowerBIDataset.cs
51 12 0
public override void ExecuteCmdlet()
in src/Modules/Reports/Commands.Reports/GetPowerBIDashboard.cs
51 12 0
public override void ExecuteCmdlet()
in src/Modules/Reports/Commands.Reports/GetPowerBIReport.cs
51 12 0
protected virtual string ResolveFilePath()
in src/Common/Commands.Common/PowerBICmdlet.cs
50 11 2
public override void ExecuteCmdlet()
in src/Modules/Data/Commands.Data/GetPowerBIDataflow.cs
50 12 0
public override void ExecuteCmdlet()
in src/Modules/Reports/Commands.Reports/GetPowerBIImport.cs
49 11 0
private async Task HandleAuthentication()
in src/Common/Common.Authentication/WindowsAuthenticationFactory.cs
48 9 6
public override void ExecuteCmdlet()
in src/Modules/Profile/Commands.Profile/InvokePowerBIRestMethod.cs
48 10 0
public override void ExecuteCmdlet()
in src/Modules/Workspaces/Commands.Workspaces/GetPowerBIWorkspace.cs
47 20 0
public override void ExecuteCmdlet()
in src/Modules/Data/Commands.Data/ExportPowerBIDataflow.cs
44 8 0
protected virtual void Dispose()
in src/Common/Common.Api/PowerBIApiClient.cs
40 10 1
public override void ExecuteCmdlet()
in src/Modules/Data/Commands.Data/GetPowerBITable.cs
36 7 0
private IList ExecuteCmdletHelper()
in src/Modules/Admin/Commands.Admin/GetPowerBIActivityEvent.cs
34 6 2
private void ExecuteCmdletWithAll()
in src/Modules/Workspaces/Commands.Workspaces/GetPowerBIWorkspace.cs
34 7 0
private static Assembly RedirectAssemblyLoad()
in src/Common/Commands.Common/PowerBICmdlet.cs
33 8 2
public void FlushMessages()
in src/Common/Commands.Common/PowerBILogger.cs
32 8 0
public async Task Authenticate()
in src/Common/Common.Authentication/ServicePrincipalAuthenticationFactory.cs
32 5 5