microsoft / fhir-server
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 8% duplication:
    • 32,636 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,771 duplicated lines
  • 312 duplicates
system8% (2,771 lines)
Duplication per Extension
cs5% (1,645 lines)
yml42% (922 lines)
js61% (174 lines)
ps13% (18 lines)
shproj25% (12 lines)
Duplication per Component (primary)
src/Microsoft.Health.Fhir.SqlServer12% (792 lines)
build46% (535 lines)
build/jobs37% (387 lines)
src/Microsoft.Health.Fhir.Core3% (371 lines)
src/Microsoft.Health.Fhir.CosmosDb7% (295 lines)
src/Microsoft.Health.Fhir.Shared.Core5% (137 lines)
src/Microsoft.Health.Fhir.Shared.Api3% (96 lines)
src/Microsoft.Health.Fhir.Api3% (61 lines)
src/Microsoft.Health.Fhir.Azure3% (26 lines)
release/scripts3% (18 lines)
src/Microsoft.Health.Fhir.Shared.Client3% (12 lines)
src/Microsoft.Health.Fhir.R4.Api73% (11 lines)
src/Microsoft.Health.Fhir.R5.Api73% (11 lines)
src/Microsoft.Health.Fhir.Stu3.Api53% (7 lines)
src/Microsoft.Health.Fhir.R4.Core31% (6 lines)
src/Microsoft.Health.Fhir.R5.Core31% (6 lines)
ROOT0% (0 lines)
src/Microsoft.Health.Extensions.Xunit0% (0 lines)
src/Microsoft.Health.Fhir.R4.Client0% (0 lines)
src/Microsoft.Health.Fhir.R5.Client0% (0 lines)
src/Microsoft.Health.Fhir.Shared.Web0% (0 lines)
src/Microsoft.Health.Fhir.Stu3.Client0% (0 lines)
src/Microsoft.Health.Fhir.Stu3.Core0% (0 lines)
src/Microsoft.Health.Fhir.ValueSets0% (0 lines)
src/Microsoft.Health.TaskManagement0% (0 lines)
tools/FhirAnalyzer0% (0 lines)
tools/PowerShell0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 312 duplicates...
Size#FoldersFilesLinesCode
87 x 2 src/Microsoft.Health.Fhi...dures/AcquireExportJobs
src/Microsoft.Health.Fhi...ures/AcquireReindexJobs
acquireExportJobs.js
acquireReindexJobs.js
10:137 (97%)
10:137 (97%)
view
34 x 2 src/Microsoft.Health.Fhi...Server/Features/Storage
src/Microsoft.Health.Fhi...Server/Features/Storage
SqlServerTaskConsumer.cs
SqlServerTaskConsumer.cs
52:96 (20%)
165:209 (20%)
view
34 x 2 build
build
ci-pipeline.yml
pr-pipeline.yml
23:58 (18%)
30:66 (9%)
view
32 x 2 build/jobs
build/jobs
run-export-tests.yml
run-export-tests.yml
9:46 (18%)
107:144 (18%)
view
30 x 2 src/Microsoft.Health.Fhi...Server/Features/Storage
src/Microsoft.Health.Fhi...Server/Features/Storage
SqlServerTaskManager.cs
SqlServerTaskManager.cs
96:132 (26%)
144:180 (26%)
view
29 x 2 build/jobs
build/jobs
e2e-tests.yml
run-export-tests.yml
10:43 (25%)
16:49 (16%)
view
26 x 2 build/jobs
build/jobs
e2e-tests.yml
run-export-tests.yml
10:40 (22%)
114:144 (15%)
view
23 x 2 build/jobs
build/jobs
run-export-tests.yml
run-export-tests.yml
82:104 (13%)
180:202 (13%)
view
22 x 2 src/Microsoft.Health.Fhi...torage/TvpRowGeneration
src/Microsoft.Health.Fhi...torage/TvpRowGeneration
BulkCompositeSearchParameterRowGenera...
CompositeSearchParameterRowGenerator.cs
29:79 (75%)
29:79 (75%)
view
20 x 2 src/Microsoft.Health.Fhi...isitors/QueryGenerators
src/Microsoft.Health.Fhi...isitors/QueryGenerators
SqlQueryGenerator.cs
SqlQueryGenerator.cs
871:907 (3%)
912:948 (3%)
view
17 x 2 build/jobs
build/jobs
e2e-tests.yml
run-export-tests.yml
113:129 (14%)
84:100 (9%)
view
17 x 2 build/jobs
build/jobs
e2e-tests.yml
run-export-tests.yml
113:129 (14%)
182:198 (9%)
view
17 x 2 build/jobs
build/jobs
run-export-tests.yml
run-export-tests.yml
48:72 (9%)
146:170 (9%)
view
16 x 2 build
build
ci-deploy.yml
ci-pipeline.yml
6:23 (10%)
4:21 (8%)
view
16 x 2 src/Microsoft.Health.Fhi...Server/Features/Storage
src/Microsoft.Health.Fhi...Server/Features/Storage
SqlServerTaskConsumer.cs
SqlServerTaskConsumer.cs
52:71 (9%)
222:241 (9%)
view
16 x 2 src/Microsoft.Health.Fhi...Server/Features/Storage
src/Microsoft.Health.Fhi...Server/Features/Storage
SqlServerTaskConsumer.cs
SqlServerTaskManager.cs
76:96 (9%)
169:189 (14%)
view
16 x 2 src/Microsoft.Health.Fhir.Core/Extensions
src/Microsoft.Health.Fhi...tures/Search/Converters
TypedElementExtensions.cs
TypedElementExtensions.cs
1:42 (84%)
1:42 (100%)
view
16 x 2 src/Microsoft.Health.Fhi...Server/Features/Storage
src/Microsoft.Health.Fhi...Server/Features/Storage
SqlServerTaskConsumer.cs
SqlServerTaskConsumer.cs
165:184 (9%)
222:241 (9%)
view
16 x 2 src/Microsoft.Health.Fhi...Server/Features/Storage
src/Microsoft.Health.Fhi...Server/Features/Storage
SqlServerTaskConsumer.cs
SqlServerTaskManager.cs
189:209 (9%)
169:189 (14%)
view
15 x 2 build/jobs
build/jobs
cleanup-resourcegroup-aad.yml
cleanup.yml
1:16 (100%)
1:16 (48%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 29 unit duplicates...
Size#FoldersFilesLinesCode
34 x 2 src/Microsoft.Health.Fhi...dures/AcquireExportJobs
src/Microsoft.Health.Fhi...ures/AcquireReindexJobs
acquireExportJobs.js
acquireReindexJobs.js
67:107 
67:107 
view
14 x 2 src/Microsoft.Health.Fhi...dures/AcquireExportJobs
src/Microsoft.Health.Fhi...ures/AcquireReindexJobs
acquireExportJobs.js
acquireReindexJobs.js
86:101 
86:101 
view
13 x 2 src/Microsoft.Health.Fhir.Core/Extensions
src/Microsoft.Health.Fhi...tures/Search/Converters
TypedElementExtensions.cs
TypedElementExtensions.cs
17:33 
17:33 
view
21 x 2 src/Microsoft.Health.Fhi...dures/AcquireExportJobs
src/Microsoft.Health.Fhi...ures/AcquireReindexJobs
acquireExportJobs.js
acquireReindexJobs.js
40:65 
40:65 
view
12 x 2 src/Microsoft.Health.Fhi...atures/Resources/Create
src/Microsoft.Health.Fhi...atures/Resources/Upsert
ConditionalCreateResourceHandler.cs
ConditionalUpsertResourceHandler.cs
26:39 
30:43 
view
12 x 2 src/Microsoft.Health.Fhi...torage/TvpRowGeneration
src/Microsoft.Health.Fhi...torage/TvpRowGeneration
BulkCompartmentAssignmentV1RowGenerat...
CompartmentAssignmentV1RowGenerator.cs
98:112 
82:96 
view
11 x 2 src/Microsoft.Health.Fhi...atures/Resources/Bundle
src/Microsoft.Health.Fhi...atures/Resources/Bundle
BundleHandler.cs
BundleHandler.cs
13:24 
13:24 
view
10 x 2 src/Microsoft.Health.Fhi...torage/TvpRowGeneration
src/Microsoft.Health.Fhi...torage/TvpRowGeneration
BulkCompositeSearchParameterRowGenera...
CompositeSearchParameterRowGenerator.cs
29:40 
29:40 
view
9 x 6 src/Microsoft.Health.Fhi...ions/ConvertData/Models
src/Microsoft.Health.Fhi...ions/ConvertData/Models
src/Microsoft.Health.Fhi...ions/ConvertData/Models
src/Microsoft.Health.Fhi...ions/ConvertData/Models
src/Microsoft.Health.Fhi...ions/ConvertData/Models
src/Microsoft.Health.Fhi...ions/ConvertData/Models
ContainerRegistryNotAuthorizedExcepti...
ConvertDataFailedException.cs
ConvertDataTimeoutException.cs
ConvertDataUnhandledException.cs
FetchTemplateCollectionFailedExceptio...
TemplateCollectionErrorException.cs
25:35 
25:35 
14:24 
14:24 
14:24 
14:24 
view
8 x 2 src/Microsoft.Health.Fhir.Api/Features/Exceptions
src/Microsoft.Health.Fhir.Api/Features/Exceptions
BundleEntryLimitExceededException.cs
ProvenanceHeaderException.cs
14:23 
14:23 
view
8 x 3 src/Microsoft.Health.Fhi...re/Features/Compartment
src/Microsoft.Health.Fhi...ed.Core/Features/Search
src/Microsoft.Health.Fhi...ed.Core/Features/Search
SearchCompartmentHandler.cs
SearchResourceHandler.cs
SearchResourceHistoryHandler.cs
33:42 
33:42 
24:33 
view
8 x 2 src/Microsoft.Health.Fhi...re/Features/Conformance
src/Microsoft.Health.Fhi...re/Features/Conformance
ConformanceProviderExtensions.cs
ConformanceProviderExtensions.cs
25:33 
35:43 
view
8 x 4 src/Microsoft.Health.Fhi...ions/ConvertData/Models
src/Microsoft.Health.Fhi...ions/ConvertData/Models
src/Microsoft.Health.Fhi...ions/ConvertData/Models
src/Microsoft.Health.Fhi...ions/ConvertData/Models
ContainerRegistryNotAuthorizedExcepti...
ContainerRegistryNotConfiguredExcepti...
ContainerRegistryNotFoundException.cs
ConvertDataFailedException.cs
14:23 
14:23 
14:23 
14:23 
view
8 x 2 src/Microsoft.Health.Fhi...atures/Resources/Delete
src/Microsoft.Health.Fhi.../Features/Resources/Get
DeleteResourceHandler.cs
GetResourceHandler.cs
23:31 
23:31 
view
8 x 2 src/Microsoft.Health.Fhi...torage/TvpRowGeneration
src/Microsoft.Health.Fhi...torage/TvpRowGeneration
BulkSearchParameterRowGenerator.cs
SearchParameterRowGenerator.cs
75:85 
59:69 
view
7 x 2 src/Microsoft.Health.Fhir.Core/Extensions
src/Microsoft.Health.Fhi...tures/Search/Converters
TypedElementExtensions.cs
TypedElementExtensions.cs
35:43 
35:43 
view
7 x 3 src/Microsoft.Health.Fhi...tures/Operations/Export
src/Microsoft.Health.Fhi...tures/Operations/Export
src/Microsoft.Health.Fhi...tures/Operations/Export
AnonymizationConfigurationFetchExcept...
FailedToAnonymizeResourceException.cs
FailedToParseAnonymizationConfigurati...
18:25 
18:25 
18:25 
view
7 x 3 src/Microsoft.Health.Fhi...tures/Operations/Export
src/Microsoft.Health.Fhi...tures/Operations/Export
src/Microsoft.Health.Fhi...tures/Operations/Export
AnonymizationConfigurationFetchExcept...
FailedToAnonymizeResourceException.cs
FailedToParseAnonymizationConfigurati...
27:34 
27:34 
27:34 
view
7 x 2 src/Microsoft.Health.Fhi...tures/Operations/Import
src/Microsoft.Health.Fhi...tures/Operations/Import
ImportOrchestratorTask.cs
ImportProcessingTask.cs
543:550 
259:266 
view
7 x 2 src/Microsoft.Health.Fhi...tures/Search/Converters
src/Microsoft.Health.Fhi...tures/Search/Converters
OidToUriSearchValueConverter.cs
UriToUriSearchValueConverter.cs
22:30 
22:30 
view