Skip to content

Commit 768a9cf

Browse files
authored
Removed unused private members (#8385)
1 parent 235c538 commit 768a9cf

File tree

18 files changed

+39
-54
lines changed

18 files changed

+39
-54
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ dotnet_diagnostic.IDE0005.severity = warning
175175
dotnet_diagnostic.IDE0028.severity = warning
176176
# Order modifiers.
177177
dotnet_diagnostic.IDE0036.severity = warning
178+
# Remove unused private member.
179+
dotnet_diagnostic.IDE0051.severity = warning
180+
dotnet_diagnostic.RCS1213.severity = none
181+
# Remove unread private member.
182+
dotnet_diagnostic.IDE0052.severity = warning
178183
# Formatting rule.
179184
dotnet_diagnostic.IDE0055.severity = warning
180185
# Use range operator.

src/HotChocolate/Core/src/Execution.Projections/SelectionExpressionBuilder.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace HotChocolate.Execution.Projections;
1111

1212
internal sealed class SelectionExpressionBuilder
1313
{
14-
private static readonly NullabilityInfoContext s_nullabilityInfoContext = new();
1514
private static readonly HashSet<Type> s_runtimeLeafTypes =
1615
[
1716
typeof(string),

src/HotChocolate/Core/src/Execution/Serialization/MultiPartResultFormatter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ private static class MessageHelper
194194
private static ReadOnlySpan<byte> ContentType => "Content-Type: application/json; charset=utf-8\r\n\r\n"u8;
195195
private static ReadOnlySpan<byte> Start => "\r\n---\r\n"u8;
196196
private static ReadOnlySpan<byte> End => "\r\n-----\r\n"u8;
197-
private static ReadOnlySpan<byte> CrLf => "\r\n"u8;
198197

199198
public static void WriteNext(IBufferWriter<byte> writer)
200199
{

src/HotChocolate/Core/src/Types/Utilities/NullableHelper.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ public static bool IsParameterNullable(ParameterInfo parameter) =>
4040
return GetContext(attribute);
4141
}
4242

43-
private bool? GetContext(ParameterInfo parameter)
44-
{
45-
var attribute = GetNullableContextAttribute(parameter);
46-
return GetContext(attribute, GetContext(parameter.Member));
47-
}
48-
4943
private bool? GetContext(NullableContextAttribute? attribute)
5044
{
5145
return GetContext(attribute, _context);
@@ -106,10 +100,6 @@ public static bool IsParameterNullable(ParameterInfo parameter) =>
106100
MemberInfo member) =>
107101
GetNullableContextAttribute(member.GetCustomAttributesData());
108102

109-
private static NullableContextAttribute? GetNullableContextAttribute(
110-
ParameterInfo member) =>
111-
GetNullableContextAttribute(member.GetCustomAttributesData());
112-
113103
private static NullableContextAttribute? GetNullableContextAttribute(
114104
Assembly assembly) =>
115105
GetNullableContextAttribute(assembly.GetCustomAttributesData());

src/HotChocolate/Core/test/Types.Tests/Configuration/TypeTrimmerTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace HotChocolate.Configuration;
77
public class TypeTrimmerTests
88
{
99
[Fact]
10-
private void RemoveUnusedTypes()
10+
public void RemoveUnusedTypes()
1111
{
1212
// arrange
1313
// act
@@ -45,7 +45,7 @@ private void RemoveUnusedTypes()
4545
}
4646

4747
[Fact]
48-
private void Interface_Implementors_Correctly_Detected()
48+
public void Interface_Implementors_Correctly_Detected()
4949
{
5050
// arrange
5151
// act
@@ -74,7 +74,7 @@ private void Interface_Implementors_Correctly_Detected()
7474
}
7575

7676
[Fact]
77-
private void Interface_Implementors_Correctly_Detected_2()
77+
public void Interface_Implementors_Correctly_Detected_2()
7878
{
7979
// arrange
8080
// act
@@ -103,7 +103,7 @@ private void Interface_Implementors_Correctly_Detected_2()
103103
}
104104

105105
[Fact]
106-
private void Union_Set_Is_Correctly_Detected()
106+
public void Union_Set_Is_Correctly_Detected()
107107
{
108108
// arrange
109109
// act
@@ -130,7 +130,7 @@ private void Union_Set_Is_Correctly_Detected()
130130
}
131131

132132
[Fact]
133-
private void Unused_TypeSystem_Directives_Are_Removed()
133+
public void Unused_TypeSystem_Directives_Are_Removed()
134134
{
135135
// arrange
136136
// act
@@ -166,7 +166,7 @@ private void Unused_TypeSystem_Directives_Are_Removed()
166166
}
167167

168168
[Fact]
169-
private void Executable_Directives_Are_Never_Removed()
169+
public void Executable_Directives_Are_Never_Removed()
170170
{
171171
// arrange
172172
// act
@@ -198,7 +198,7 @@ private void Executable_Directives_Are_Never_Removed()
198198
}
199199

200200
[Fact]
201-
private void Executable_Directives_Are_Never_Removed_2()
201+
public void Executable_Directives_Are_Never_Removed_2()
202202
{
203203
// arrange
204204
// act
@@ -230,7 +230,7 @@ private void Executable_Directives_Are_Never_Removed_2()
230230
}
231231

232232
[Fact]
233-
private void Executable_Directives_Should_Be_Visited()
233+
public void Executable_Directives_Should_Be_Visited()
234234
{
235235
// arrange
236236
// act

src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/SchemaIntegrationTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ namespace HotChocolate.CostAnalysis;
66

77
public sealed class SchemaIntegrationTests
88
{
9-
private readonly CostSyntaxRewriter _costSyntaxRewriter = new();
10-
119
[Fact]
1210
public async Task Rewrite_DefaultWeights_RemovesCostDirectives()
1311
{

src/HotChocolate/Data/test/Data.Filters.InMemory.Tests/FilterVisitorTestBase.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ namespace HotChocolate.Data.Filters;
66

77
public class FilterVisitorTestBase
88
{
9-
private readonly object _lock = new();
10-
119
private Func<IResolverContext, IEnumerable<TResult>> BuildResolver<TResult>(
1210
params TResult[] results)
1311
{

src/HotChocolate/Fusion-vnext/src/Fusion.Execution/Execution/QueryExecutor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public async ValueTask QueryAsync(
4949
// assemble the result
5050
}
5151

52+
#pragma warning disable IDE0051 // Remove unused private members -- WIP
5253
private static void AssembleResult(
54+
#pragma warning restore IDE0051 // Remove unused private members
5355
OperationPlanContext context)
5456
{
5557
var path = Path.Root;
@@ -95,7 +97,9 @@ private static void AssembleResult(
9597
jsonWriter.Flush();
9698
}
9799

100+
#pragma warning disable IDE0051 // Remove unused private members -- WIP
98101
private void WriteFieldValue(
102+
#pragma warning restore IDE0051 // Remove unused private members
99103
OperationPlanContext context,
100104
Utf8JsonWriter writer,
101105
IComplexTypeDefinition type,

src/HotChocolate/Language/test/Language.Tests/Parser/BlockStringTokenReaderTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace HotChocolate.Language;
55
public class BlockStringTokenReaderTests
66
{
77
[Fact]
8-
private void ReadToken()
8+
public void ReadToken()
99
{
1010
// arrange
1111
var source = Encoding.UTF8.GetBytes(
@@ -32,7 +32,7 @@ private void ReadToken()
3232
}
3333

3434
[Fact]
35-
private void ReadToken_WithEscapedTrippleQuote1_EscapeIsReplacedWithActualQuotes()
35+
public void ReadToken_WithEscapedTrippleQuote1_EscapeIsReplacedWithActualQuotes()
3636
{
3737
// arrange
3838
var source = Encoding.UTF8.GetBytes(
@@ -55,7 +55,7 @@ private void ReadToken_WithEscapedTrippleQuote1_EscapeIsReplacedWithActualQuotes
5555
}
5656

5757
[Fact]
58-
private void ReadToken_WithEscapedTrippleQuote2_EscapeIsReplacedWithActualQuotes()
58+
public void ReadToken_WithEscapedTrippleQuote2_EscapeIsReplacedWithActualQuotes()
5959
{
6060
// arrange
6161
var source = Encoding.UTF8.GetBytes(
@@ -78,7 +78,7 @@ private void ReadToken_WithEscapedTrippleQuote2_EscapeIsReplacedWithActualQuotes
7878
}
7979

8080
[Fact]
81-
private void ReadToken_WithLeadingBlanks_BlanksAreRemoved()
81+
public void ReadToken_WithLeadingBlanks_BlanksAreRemoved()
8282
{
8383
// arrange
8484
var source = Encoding.UTF8.GetBytes(
@@ -102,7 +102,7 @@ private void ReadToken_WithLeadingBlanks_BlanksAreRemoved()
102102
}
103103

104104
[Fact]
105-
private void ReadToken_WithTrailingBlanks_BlanksAreRemoved()
105+
public void ReadToken_WithTrailingBlanks_BlanksAreRemoved()
106106
{
107107
// arrange
108108
var source = Encoding.UTF8.GetBytes(
@@ -126,7 +126,7 @@ private void ReadToken_WithTrailingBlanks_BlanksAreRemoved()
126126
}
127127

128128
[Fact]
129-
private void ReadToken_SingleLine_ParsesCorrectly()
129+
public void ReadToken_SingleLine_ParsesCorrectly()
130130
{
131131
// arrange
132132
var source = Encoding.UTF8.GetBytes(
@@ -146,7 +146,7 @@ private void ReadToken_SingleLine_ParsesCorrectly()
146146
}
147147

148148
[Fact]
149-
private void UnescapeEmpty()
149+
public void UnescapeEmpty()
150150
{
151151
// arrange
152152
var source = Encoding.UTF8.GetBytes("\"\"");
@@ -163,7 +163,7 @@ private void UnescapeEmpty()
163163
}
164164

165165
[Fact]
166-
private void UnescapeString()
166+
public void UnescapeString()
167167
{
168168
// arrange
169169
var source = Encoding.UTF8.GetBytes("\"abc\"");
@@ -181,7 +181,7 @@ private void UnescapeString()
181181
}
182182

183183
[Fact]
184-
private void UnexpectedSyntaxException()
184+
public void UnexpectedSyntaxException()
185185
{
186186
// arrange
187187
var source = new byte[] { 187 };
@@ -204,7 +204,7 @@ private void UnexpectedSyntaxException()
204204
}
205205

206206
[Fact]
207-
private void NoDigitAfterZeroException()
207+
public void NoDigitAfterZeroException()
208208
{
209209
// arrange
210210
var source = Encoding.UTF8.GetBytes("01");
@@ -227,7 +227,7 @@ private void NoDigitAfterZeroException()
227227
}
228228

229229
[Fact]
230-
private void InvalidDigit()
230+
public void InvalidDigit()
231231
{
232232
// arrange
233233
var source = Encoding.UTF8.GetBytes("123.F");
@@ -250,7 +250,7 @@ private void InvalidDigit()
250250
}
251251

252252
[Fact]
253-
private void Zero()
253+
public void Zero()
254254
{
255255
// arrange
256256
var source = Encoding.UTF8.GetBytes("0 ");

src/HotChocolate/Language/test/Language.Tests/Parser/CommentTokenReaderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class CommentTokenReaderTests
1010
[InlineData(" \n# my comment foo bar")]
1111
[InlineData(" \n# my comment foo bar\n ")]
1212
[Theory]
13-
private void ReadToken(string sourceText)
13+
public void ReadToken(string sourceText)
1414
{
1515
// arrange
1616
var source = Encoding.UTF8.GetBytes(sourceText);
@@ -25,7 +25,7 @@ private void ReadToken(string sourceText)
2525
}
2626

2727
[Fact]
28-
private void EmptyComment()
28+
public void EmptyComment()
2929
{
3030
// arrange
3131
var source = Encoding.UTF8.GetBytes("#\n");

0 commit comments

Comments
 (0)