microsoft / fhir-server
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 2,326 units with 32,639 lines of code in units (59.4% of code).
    • 2 very complex units (483 lines of code)
    • 6 complex units (746 lines of code)
    • 67 medium complex units (4,510 lines of code)
    • 135 simple units (4,663 lines of code)
    • 2,116 very simple units (22,237 lines of code)
1% | 2% | 13% | 14% | 68%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
cs1% | 2% | 13% | 14% | 67%
js0% | 0% | 0% | 7% | 92%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/Microsoft.Health.Fhir.Shared.Core9% | 2% | 10% | 19% | 58%
src/Microsoft.Health.Fhir.Shared.Api5% | 0% | 11% | 10% | 72%
src/Microsoft.Health.Fhir.SqlServer0% | 7% | 13% | 15% | 62%
src/Microsoft.Health.Fhir.Core0% | <1% | 16% | 12% | 70%
src/Microsoft.Health.Fhir.CosmosDb0% | 0% | 13% | 16% | 69%
src/Microsoft.Health.Fhir.Api0% | 0% | 21% | 13% | 64%
tools/FhirAnalyzer0% | 0% | 85% | 0% | 14%
src/Microsoft.Health.TaskManagement0% | 0% | 0% | 66% | 33%
src/Microsoft.Health.Fhir.Azure0% | 0% | 0% | 9% | 90%
src/Microsoft.Health.Extensions.Xunit0% | 0% | 0% | 27% | 72%
src/Microsoft.Health.Fhir.Shared.Web0% | 0% | 0% | 15% | 84%
src/Microsoft.Health.Fhir.Shared.Client0% | 0% | 0% | 0% | 100%
src/Microsoft.Health.Fhir.R4.Api0% | 0% | 0% | 0% | 100%
src/Microsoft.Health.Fhir.R5.Api0% | 0% | 0% | 0% | 100%
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%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public SearchOptions Create()
in src/Microsoft.Health.Fhir.Shared.Core/Features/Search/SearchOptionsFactory.cs
290 57 4
public override void OnActionExecuted()
in src/Microsoft.Health.Fhir.Shared.Api/Features/Filters/OperationOutcomeExceptionFilterAttribute.cs
193 54 1
private async Task SearchImpl()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/SqlServerSearchService.cs
214 32 4
private void HandleTableKindInclude()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/Expressions/Visitors/QueryGenerators/SqlQueryGenerator.cs
146 29 4
private async Task RunExportSearch()
in src/Microsoft.Health.Fhir.Core/Features/Operations/Export/ExportJobTask.cs
71 27 4
public override object VisitSqlRoot()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/Expressions/Visitors/QueryGenerators/SqlQueryGenerator.cs
151 27 2
public async Task SearchAsync()
in src/Microsoft.Health.Fhir.Shared.Core/Features/Operations/Everything/PatientEverythingService.cs
85 26 7
public void AppendHash()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/HashingSqlQueryParameterManager.cs
79 26 1
private void HandleTableKindChain()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/Expressions/Visitors/QueryGenerators/SqlQueryGenerator.cs
80 25 3
private static List ValidateAndGetFlattenedList()
in src/Microsoft.Health.Fhir.Core/Features/Definition/SearchParameterDefinitionBuilder.cs
142 24 3
protected static SearchParameterQueryGeneratorContext VisitSimpleString()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/Expressions/Visitors/QueryGenerators/SearchParameterQueryGenerator.cs
66 23 4
public async Task UpsertAsync()
in src/Microsoft.Health.Fhir.CosmosDb/Features/Storage/CosmosFhirDataStore.cs
121 21 5
private static EnumerableReturnType Visit()
in src/Microsoft.Health.Fhir.Shared.Core/Features/Search/Parameters/SearchParameterToTypeResolver.cs
70 21 2
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/Export/ExportJobTask.cs
117 18 3
public override Expression VisitSqlRoot()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/Expressions/Visitors/PartitionEliminationRewriter.cs
84 18 2
public override Expression VisitSqlRoot()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/Expressions/Visitors/SortRewriter.cs
82 18 2
public override async Task SearchAsync()
in src/Microsoft.Health.Fhir.SqlServer/Features/Search/SqlServerSearchService.cs
62 18 2
private async Task SearchWithFilter()
in src/Microsoft.Health.Fhir.Core/Features/Operations/Export/ExportJobTask.cs
74 17 8
private async Task RunExportCompartmentSearch()
in src/Microsoft.Health.Fhir.Core/Features/Operations/Export/ExportJobTask.cs
64 17 6