Skip to content

Commit 048b6c9

Browse files
authored
Fix various analyzer errors (#9697)
1 parent 2b82e13 commit 048b6c9

21 files changed

Lines changed: 20 additions & 144 deletions

File tree

src/HotChocolate/Adapters/src/Adapters.Mcp/Directives/McpToolAnnotationsAttribute.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using HotChocolate.Adapters.Mcp.Extensions;
32
using HotChocolate.Types;
43
using HotChocolate.Types.Descriptors;
54

src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/CoreIntegrationTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Text.Json;
22
using HotChocolate.Adapters.Mcp.Diagnostics;
3-
using HotChocolate.Adapters.Mcp.Extensions;
43
using HotChocolate.Adapters.Mcp.Storage;
54
using HotChocolate.Execution.Configuration;
65
using HotChocolate.Language;

src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/FusionIntegrationTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Buffers;
22
using System.Text.Json;
33
using HotChocolate.Adapters.Mcp.Diagnostics;
4-
using HotChocolate.Adapters.Mcp.Extensions;
54
using HotChocolate.Adapters.Mcp.Storage;
65
using HotChocolate.Buffers;
76
using HotChocolate.Execution;

src/HotChocolate/Adapters/test/Adapters.Mcp.Tests/Handlers/CallToolHandlerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using HotChocolate.Adapters.Mcp.Extensions;
21
using HotChocolate.Adapters.Mcp.Storage;
32
using HotChocolate.Execution;
43
using HotChocolate.Language;

src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using HotChocolate.Execution;
44
using HotChocolate.Types;
55
using Microsoft.AspNetCore.Builder;
6-
using Microsoft.AspNetCore.Routing;
76
using Microsoft.Extensions.DependencyInjection;
87
using Microsoft.Extensions.DependencyInjection.Extensions;
98

src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSemanticNonNullSchemaMiddlewareTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using HotChocolate.Execution;
44
using HotChocolate.Types;
55
using Microsoft.AspNetCore.Builder;
6-
using Microsoft.AspNetCore.Routing;
76
using Microsoft.Extensions.DependencyInjection;
87
using Microsoft.Extensions.DependencyInjection.Extensions;
98

src/HotChocolate/Core/src/Types.Abstractions/Serialization/SchemaFormatterOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public sealed class SchemaFormatterOptions
4040

4141
/// <summary>
4242
/// Controls whether directive definitions and applied directives whose
43-
/// definition has <see cref="HotChocolate.Types.IDirectiveDefinition.IsPublic"/>
43+
/// definition has <see cref="Types.IDirectiveDefinition.IsPublic"/>
4444
/// set to <c>false</c> are included in the output.
4545
/// Default: <c>true</c>.
4646
/// </summary>

src/HotChocolate/Diagnostics/src/Diagnostics.Core/Spans/ExecuteRequestSpanBase.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ protected override void OnComplete()
4141
EnrichServerAttributes();
4242

4343
string? operationTypeValue = null;
44-
string? operationName = null;
45-
if (TryGetOperationInfo(out var operationType, out operationName))
44+
if (TryGetOperationInfo(out var operationType, out var operationName))
4645
{
4746
operationTypeValue = GraphQL.Operation.TypeValues[operationType];
4847
Activity.DisplayName = operationTypeValue;
@@ -103,18 +102,18 @@ private void EnrichServerAttributes()
103102
}
104103

105104
if (!string.IsNullOrEmpty(request.Host.Host)
106-
&& Activity.GetTagItem(SemanticConventions.Server.Address) is null)
105+
&& Activity.GetTagItem(Server.Address) is null)
107106
{
108-
Activity.SetTag(SemanticConventions.Server.Address, request.Host.Host);
107+
Activity.SetTag(Server.Address, request.Host.Host);
109108
}
110109

111110
if (request.Host.Port is { } port
112-
&& Activity.GetTagItem(SemanticConventions.Server.Port) is null)
111+
&& Activity.GetTagItem(Server.Port) is null)
113112
{
114113
var defaultPort = request.IsHttps ? 443 : 80;
115114
if (port != defaultPort)
116115
{
117-
Activity.SetTag(SemanticConventions.Server.Port, port);
116+
Activity.SetTag(Server.Port, port);
118117
}
119118
}
120119
}

src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Extensions/OperationPlanRequestOverridesExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using HotChocolate.Features;
21
using HotChocolate.Fusion.Execution;
32

43
// ReSharper disable once CheckNamespace

src/HotChocolate/Fusion/src/Fusion.Execution/Planning/OperationPlanner.Defer.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,7 @@ ScopeState ScopeStateFor(ParentPlanContext scope)
240240
return enclosingState;
241241
}
242242

243-
if (rootScopeState is null)
244-
{
245-
rootScopeState = new ScopeState(scope.ParentSteps, scope.ParentInternalOperation);
246-
}
243+
rootScopeState ??= new ScopeState(scope.ParentSteps, scope.ParentInternalOperation);
247244
return rootScopeState;
248245
}
249246

@@ -578,8 +575,8 @@ private static bool TryLocateInternalSelectionSetAtPath(
578575
var promotedStep = providerStep with
579576
{
580577
Id = newParentStepId,
581-
Dependents = ImmutableHashSet<int>.Empty,
582-
ParentDependencies = ImmutableHashSet<ParentStepRef>.Empty,
578+
Dependents = [],
579+
ParentDependencies = [],
583580
SelectionSets = SelectionSetIndexer.CreateIdSet(providerStep.Definition.SelectionSet, index),
584581
RootSelectionSetId = index.GetId(providerStep.Definition.SelectionSet)
585582
};

0 commit comments

Comments
 (0)