Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions StyleCop.Analyzers.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1000" Action="None" />
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1200" Action="None" />
<Rule Id="SA1305" Action="Warning" />
<Rule Id="SA1309" Action="None" />
<Rule Id="SA1412" Action="Warning" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,5 +373,8 @@
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1200" Action="None" />
<Rule Id="SA1309" Action="None" />
<Rule Id="SA1310" Action="None" />
</Rules>
</RuleSet>
1 change: 1 addition & 0 deletions src/CLI/Monai.Deploy.WorkflowManager.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

<ItemGroup>
<AdditionalFiles Include="..\.sonarlint\project-monai_monai-deploy-workflow-manager\CSharp\SonarLint.xml" Link="SonarLint.xml" />
<AdditionalFiles Include="..\..\stylecop.json" />
</ItemGroup>

<PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Common/Extensions/TaskDispatchEventExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static class TaskDispatchEventExtension
{
public static string? GetTaskPluginArgumentsParameter(this TaskDispatchEvent taskDispatchEvent, string key)
{
if (!taskDispatchEvent.TaskPluginArguments.TryGetValue(key, out string? value))
if (!taskDispatchEvent.TaskPluginArguments.TryGetValue(key, out var value))
{
return null;
}
Expand All @@ -33,10 +33,10 @@ public static class TaskDispatchEventExtension

public static T? GetTaskPluginArgumentsParameter<T>(this TaskDispatchEvent taskDispatchEvent, string key)
{
taskDispatchEvent.TaskPluginArguments.TryGetValue(key, out string? value);
taskDispatchEvent.TaskPluginArguments.TryGetValue(key, out var value);
if (string.IsNullOrWhiteSpace(value))
{
return default(T);
return default;
}
return JsonConvert.DeserializeObject<T>(value);
}
Expand Down
1 change: 1 addition & 0 deletions src/Common/Monai.Deploy.WorkflowManager.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

<ItemGroup>
<AdditionalFiles Include="..\.sonarlint\project-monai_monai-deploy-workflow-manager\CSharp\SonarLint.xml" Link="SonarLint.xml" />
<AdditionalFiles Include="..\..\stylecop.json" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<CodeAnalysisRuleSet>..\.sonarlint\project-monai_monai-deploy-workflow-managercsharp.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\.sonarlint\project-monai_monai-deploy-workflow-manager\CSharp\SonarLint.xml" Link="SonarLint.xml" />
<AdditionalFiles Include="..\..\stylecop.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Monai.Deploy.WorkflowManager.Configuration</RootNamespace>
<CodeAnalysisRuleSet></CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>..\.sonarlint\project-monai_monai-deploy-workflow-managercsharp.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\.sonarlint\project-monai_monai-deploy-workflow-manager\CSharp\SonarLint.xml" Link="SonarLint.xml" />
<AdditionalFiles Include="..\..\stylecop.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Models/Artifact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models
public class Artifact
{
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
public string Name { get; set; } = string.Empty;

[JsonProperty(PropertyName = "value")]
public string Value { get; set; }
public string Value { get; set; } = string.Empty;

[JsonProperty(PropertyName = "mandatory")]
public bool Mandatory { get; set; } = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/Models/ArtifactMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models
public class ArtifactMap
{
[JsonProperty(PropertyName = "input")]
public Artifact[] Input { get; set; }
public Artifact[] Input { get; set; } = System.Array.Empty<Artifact>();

[JsonProperty(PropertyName = "output")]
public Artifact[] Output { get; set; }
public Artifact[] Output { get; set; } = System.Array.Empty<Artifact>();
}
}
33 changes: 0 additions & 33 deletions src/Contracts/Models/DicomTags.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/Contracts/Models/DicomValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models
public class DicomValue
{
[JsonProperty(PropertyName = "vr")]
public string Vr { get; set; }
public string Vr { get; set; } = string.Empty;

[JsonProperty(PropertyName = "Value")]
public object[] Value { get; set; }
public object[] Value { get; set; } = System.Array.Empty<object>();
}
}
35 changes: 0 additions & 35 deletions src/Contracts/Models/Evaluator.cs

This file was deleted.

54 changes: 0 additions & 54 deletions src/Contracts/Models/ExecutionContext.cs

This file was deleted.

6 changes: 3 additions & 3 deletions src/Contracts/Models/InformaticsGateway.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models
public class InformaticsGateway
{
[JsonProperty(PropertyName = "ae_title")]
public string AeTitle { get; set; }
public string AeTitle { get; set; } = string.Empty;

[JsonProperty(PropertyName = "data_origins")]
public string[] DataOrigins { get; set; }
public string[] DataOrigins { get; set; } = System.Array.Empty<string>();

[JsonProperty(PropertyName = "export_destinations")]
public string[] ExportDestinations { get; set; }
public string[] ExportDestinations { get; set; } = System.Array.Empty<string>();
}
}
10 changes: 5 additions & 5 deletions src/Contracts/Models/PatientDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models
public class PatientDetails
{
[JsonProperty(PropertyName = "patient_id")]
public string PatientId { get; set; }
public string PatientId { get; set; } = string.Empty;

[JsonProperty(PropertyName = "patient_name")]
public string PatientName { get; set; }
public string PatientName { get; set; } = string.Empty;

[JsonProperty(PropertyName = "patient_sex")]
public string PatientSex { get; set; }
public string PatientSex { get; set; } = string.Empty;

[JsonProperty(PropertyName = "patient_dob")]
public DateTime? PatientDob { get; set; }

[JsonProperty(PropertyName = "patient_age")]
public string PatientAge { get; set; }
public string PatientAge { get; set; } = string.Empty;

[JsonProperty(PropertyName = "patient_hospital_id")]
public string PatientHospitalId { get; set; }
public string PatientHospitalId { get; set; } = string.Empty;
}
}
6 changes: 2 additions & 4 deletions src/Contracts/Models/TaskDestination.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models
public class TaskDestination
{
[JsonProperty(PropertyName = "name")]
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public string Name { get; set; }
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public string Name { get; set; } = string.Empty;

[JsonProperty(PropertyName = "conditions")]
public string Conditions { get; set; } = "";
public string Conditions { get; set; } = string.Empty;
}
}
22 changes: 11 additions & 11 deletions src/Contracts/Models/TaskExecution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models
public class TaskExecution
{
[JsonProperty(PropertyName = "execution_id")]
public string ExecutionId { get; set; }
public string ExecutionId { get; set; } = string.Empty;

[JsonProperty(PropertyName = "task_type")]
public string TaskType { get; set; }
public string TaskType { get; set; } = string.Empty;

[JsonProperty(PropertyName = "task_start_time")]
public DateTime? TaskStartTime { get; set; }

[JsonProperty(PropertyName = "execution_stats")]
public Dictionary<string, string> ExecutionStats { get; set; }
public Dictionary<string, string> ExecutionStats { get; set; } = new Dictionary<string, string>();

[JsonProperty(PropertyName = "task_plugin_arguments")]
public Dictionary<string, string> TaskPluginArguments { get; set; }
public Dictionary<string, string> TaskPluginArguments { get; set; } = new Dictionary<string, string>();

[JsonProperty(PropertyName = "task_id")]
public string TaskId { get; set; }
public string TaskId { get; set; } = string.Empty;

[JsonProperty(PropertyName = "previous_task_id")]
public string PreviousTaskId { get; set; }
public string PreviousTaskId { get; set; } = string.Empty;

[JsonProperty(PropertyName = "status")]
public TaskExecutionStatus Status { get; set; }
Expand All @@ -51,18 +51,18 @@ public class TaskExecution
public FailureReason Reason { get; set; }

[JsonProperty(PropertyName = "input_artifacts")]
public Dictionary<string, string> InputArtifacts { get; set; }
public Dictionary<string, string> InputArtifacts { get; set; } = new Dictionary<string, string>();

[JsonProperty(PropertyName = "output_artifacts")]
public Dictionary<string, string> OutputArtifacts { get; set; }
public Dictionary<string, string> OutputArtifacts { get; set; } = new Dictionary<string, string>();

[JsonProperty(PropertyName = "output_directory")]
public string OutputDirectory { get; set; }
public string OutputDirectory { get; set; } = string.Empty;

[JsonProperty(PropertyName = "result")]
public Dictionary<string, object> ResultMetadata { get; set; }
public Dictionary<string, object> ResultMetadata { get; set; } = new Dictionary<string, object>();

[JsonProperty(PropertyName = "input_parameters")]
public Dictionary<string, object> InputParameters { get; set; }
public Dictionary<string, object> InputParameters { get; set; } = new Dictionary<string, object>();
}
}
29 changes: 0 additions & 29 deletions src/Contracts/Models/TaskPluginArguments.cs

This file was deleted.

Loading