microsoft / fhir-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 2,326 units with 32,639 lines of code in units (59.4% of code).
    • 16 very long units (2,382 lines of code)
    • 75 long units (4,916 lines of code)
    • 323 medium size units (9,730 lines of code)
    • 488 small units (7,254 lines of code)
    • 1,424 very small units (8,357 lines of code)
7% | 15% | 29% | 22% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs7% | 15% | 29% | 21% | 25%
js0% | 0% | 9% | 58% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Microsoft.Health.Fhir.SqlServer11% | 17% | 27% | 20% | 22%
src/Microsoft.Health.Fhir.Core5% | 12% | 26% | 20% | 33%
src/Microsoft.Health.Fhir.Shared.Core9% | 11% | 36% | 24% | 17%
src/Microsoft.Health.Fhir.CosmosDb6% | 13% | 33% | 25% | 19%
src/Microsoft.Health.Fhir.Shared.Api5% | 24% | 26% | 23% | 20%
src/Microsoft.Health.Fhir.Api7% | 14% | 37% | 20% | 20%
src/Microsoft.Health.TaskManagement0% | 27% | 39% | 0% | 33%
src/Microsoft.Health.Fhir.Azure0% | 5% | 49% | 24% | 20%
src/Microsoft.Health.Fhir.Shared.Web0% | 18% | 15% | 40% | 25%
src/Microsoft.Health.Extensions.Xunit0% | 0% | 27% | 17% | 55%
tools/FhirAnalyzer0% | 0% | 85% | 0% | 14%
src/Microsoft.Health.Fhir.Shared.Client0% | 0% | 12% | 37% | 49%
src/Microsoft.Health.Fhir.R4.Api0% | 0% | 0% | 100% | 0%
src/Microsoft.Health.Fhir.R5.Api0% | 0% | 0% | 100% | 0%
src/Microsoft.Health.Fhir.Stu3.Api0% | 0% | 0% | 0% | 100%
src/Microsoft.Health.Fhir.R4.Core0% | 0% | 0% | 0% | 100%
src/Microsoft.Health.Fhir.R5.Core0% | 0% | 0% | 0% | 100%
src/Microsoft.Health.Fhir.Stu3.Core0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public SearchOptions Create()
in src/Microsoft.Health.Fhir.Shared.Core/Features/Search/SearchOptionsFactory.cs
290 57 4
private async Task SearchImpl()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/SqlServerSearchService.cs
214 32 4
public override void OnActionExecuted()
in src/Microsoft.Health.Fhir.Shared.Api/Features/Filters/OperationOutcomeExceptionFilterAttribute.cs
193 54 1
public static IFhirServerBuilder AddSqlServer()
in src/Microsoft.Health.Fhir.SqlServer/Registration/FhirServerBuilderSqlServerRegistrationExtensions.cs
154 1 2
public override object VisitSqlRoot()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/Expressions/Visitors/QueryGenerators/SqlQueryGenerator.cs
151 27 2
private void HandleTableKindInclude()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/Expressions/Visitors/QueryGenerators/SqlQueryGenerator.cs
146 29 4
private static List ValidateAndGetFlattenedList()
in src/Microsoft.Health.Fhir.Core/Features/Definition/SearchParameterDefinitionBuilder.cs
142 24 3
private static IFhirServerBuilder AddCosmosDbPersistence()
in src/Microsoft.Health.Fhir.CosmosDb/Registration/FhirServerBuilderCosmosDbRegistrationExtensions.cs
137 4 2
public async Task ExecuteAsync()
in src/Microsoft.Health.Fhir.Core/Features/Operations/Import/ImportOrchestratorTask.cs
132 15 0
public async Task Token()
in src/Microsoft.Health.Fhir.Api/Controllers/AadSmartOnFhirProxyController.cs
131 18 1
public async Task ExecuteAsync()
in src/Microsoft.Health.Fhir.Core/Features/Operations/Import/ImportProcessingTask.cs
121 16 0
public async Task UpsertAsync()
in src/Microsoft.Health.Fhir.CosmosDb/Features/Storage/CosmosFhirDataStore.cs
121 21 5
public async Task ExecuteAsync()
in src/Microsoft.Health.Fhir.Core/Features/Operations/Export/ExportJobTask.cs
117 18 3
private async Task InitializeBase()
in src/Microsoft.Health.Fhir.SqlServer/Features/Storage/SqlServerFhirModel.cs
117 9 1
private async Task ImportInternalAsync()
in src/Microsoft.Health.Fhir.SqlServer/Features/Operations/Import/SqlResourceBulkImporter.cs
115 11 4
private Expression Build()
in src/Microsoft.Health.Fhir.Core/Features/Search/Expressions/Parsers/SearchParameterExpressionParser.cs
101 13 4
public async Task Serialize()
in src/Microsoft.Health.Fhir.Shared.Api/Features/Resources/Bundle/BundleSerializer.cs
99 17 3
public async Task SearchHistoryAsync()
in src/Microsoft.Health.Fhir.Core/Features/Search/SearchService.cs
91 16 8
private async Task ProcessJob()
in src/Microsoft.Health.Fhir.Core/Features/Operations/Reindex/ReindexJobTask.cs
90 14 0
public override async Task WriteResponseBodyAsync()
in src/Microsoft.Health.Fhir.Shared.Api/Features/Formatters/FhirJsonOutputFormatter.cs
87 16 2