microsoft / dicom-server
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 1,073 units with 12,875 lines of code in units (40.1% of code).
    • 1 very long units (136 lines of code)
    • 15 long units (944 lines of code)
    • 140 medium size units (4,154 lines of code)
    • 244 small units (3,524 lines of code)
    • 673 very small units (4,117 lines of code)
1% | 7% | 32% | 27% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs1% | 6% | 32% | 27% | 32%
js0% | 95% | 0% | 0% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Microsoft.Health.Dicom.Core2% | 3% | 21% | 31% | 40%
converter/dicom-cast0% | 7% | 36% | 29% | 25%
src/Microsoft.Health.Dicom.Api0% | 9% | 34% | 22% | 33%
tools/scale-testing0% | 17% | 28% | 32% | 21%
src/Microsoft.Health.Dicom.SqlServer0% | 5% | 57% | 13% | 23%
tools/dicom-web-electron0% | 95% | 0% | 0% | 4%
src/Microsoft.Health.Dicom.Operations0% | 21% | 25% | 26% | 26%
src/Microsoft.Health.Dicom.Client0% | 0% | 26% | 28% | 44%
src/Microsoft.Health.Dicom.Blob0% | 0% | 29% | 53% | 16%
src/Microsoft.Health.Dicom.Operations.Client0% | 0% | 26% | 57% | 15%
src/Microsoft.Health.Dicom.Web0% | 0% | 0% | 35% | 64%
src/Microsoft.Health.Dicom.Functions0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public void Load()
in src/Microsoft.Health.Dicom.Core/Modules/ServiceModule.cs
136 2 1
async function createWindow()
in tools/dicom-web-electron/main.js
93 8 0
public static async Task Main()
in tools/scale-testing/PersonInstanceGenerator/Program.cs
81 6 1
public static bool CanTranscodeDataset()
in src/Microsoft.Health.Dicom.Core/Features/Retrieve/DicomDatasetExtensions.cs
74 51 2
public async Task ProcessAsync()
in converter/dicom-cast/src/Microsoft.Health.DicomCast.Core/Features/Worker/FhirTransaction/FhirTransactionPipeline.cs
68 12 2
public async Task ProcessAsync()
in converter/dicom-cast/src/Microsoft.Health.DicomCast.Core/Features/Worker/ChangeFeedProcessor.cs
65 12 2
private void AppendExtendedQueryTagTables()
in src/Microsoft.Health.Dicom.SqlServer/Features/Query/SqlQueryGenerator.cs
63 12 0
private IActionResult MapExceptionToResult()
in src/Microsoft.Health.Dicom.Api/Features/Exceptions/ExceptionHandlingMiddleware.cs
59 19 1
public async Task CleanupDeletedInstancesAsync()
in src/Microsoft.Health.Dicom.Core/Features/Delete/DeleteService.cs
58 6 1
public static DicomFile GenerateDicomFile()
in tools/scale-testing/Common/DicomImageGenerator.cs
58 8 11
public async Task PrepareRequestAsync()
in converter/dicom-cast/src/Microsoft.Health.DicomCast.Core/Features/Worker/FhirTransaction/EndpointPipelineStep.cs
57 3 2
public static IDicomServerBuilder AddDicomServer()
in src/Microsoft.Health.Dicom.Api/Registration/DicomServerServiceCollectionExtensions.cs
56 1 3
public async Task ReindexInstancesAsync()
in src/Microsoft.Health.Dicom.Operations/Indexing/ReindexDurableFunction.Orchestration.cs
56 5 2
public void Load()
in src/Microsoft.Health.Dicom.Api/Modules/SecurityModule.cs
53 3 1
private async Task ProcessDicomInstanceEntryAsync()
in src/Microsoft.Health.Dicom.Core/Features/Store/StoreService.cs
52 8 2
public override async Task BeginCreateInstanceIndexAsync()
in src/Microsoft.Health.Dicom.SqlServer/Features/Store/SqlIndexDataStoreV6.cs
51 4 4
private static void RegisterPipeline()
in converter/dicom-cast/src/Microsoft.Health.DicomCast.Core/Modules/WorkerModule.cs
50 1 1
private void AppendFilterTable()
in src/Microsoft.Health.Dicom.SqlServer/Features/Query/SqlQueryGenerator.cs
50 6 1
public override async Task BeginCreateInstanceIndexAsync()
in src/Microsoft.Health.Dicom.SqlServer/Features/Store/SqlIndexDataStoreV3.cs
50 4 4
public override async Task BeginCreateInstanceIndexAsync()
in src/Microsoft.Health.Dicom.SqlServer/Features/Store/SqlIndexDataStoreV5.cs
50 4 4