Skip to content

Commit 0c5c03d

Browse files
committed
Fix IDE0052 Private member can be removed as the value assigned to it is never read
1 parent 8509390 commit 0c5c03d

5 files changed

Lines changed: 3 additions & 6 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/PartialElementDocumentationSummaryBase.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ namespace StyleCop.Analyzers.DocumentationRules
2121
/// </summary>
2222
internal abstract class PartialElementDocumentationSummaryBase : DiagnosticAnalyzer
2323
{
24-
private static readonly XElement EmptyElement = new XElement("empty");
25-
2624
private readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> typeDeclarationAction;
2725
private readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> methodDeclarationAction;
2826

StyleCop.Analyzers/StyleCop.Analyzers/Helpers/FileHeader.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace StyleCop.Analyzers.Helpers
1212
internal class FileHeader
1313
{
1414
private readonly int fileHeaderStart;
15-
private readonly int fileHeaderEnd;
1615

1716
/// <summary>
1817
/// Initializes a new instance of the <see cref="FileHeader"/> class.
@@ -24,7 +23,6 @@ internal FileHeader(string copyrightText, int fileHeaderStart, int fileHeaderEnd
2423
{
2524
this.CopyrightText = copyrightText;
2625
this.fileHeaderStart = fileHeaderStart;
27-
this.fileHeaderEnd = fileHeaderEnd;
2826
}
2927

3028
/// <summary>

StyleCop.Analyzers/StyleCop.Analyzers/LightJson/JsonObject.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,10 @@ public KeyValuePair[] Keys
217217
[DebuggerDisplay("{value.ToString(),nq}", Name = "{key}", Type = "JsonValue({Type})")]
218218
public class KeyValuePair
219219
{
220+
#pragma warning disable IDE0052 // Remove unread private members
220221
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
221222
private readonly string key;
223+
#pragma warning restore IDE0052 // Remove unread private members
222224

223225
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
224226
private readonly JsonValue value;

StyleCop.Analyzers/StyleCop.Analyzers/NamingRules/SA1303ConstFieldNamesMustBeginWithUpperCaseLetter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public override void Initialize(AnalysisContext context)
5151
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);
5252
context.EnableConcurrentExecution();
5353

54-
context.RegisterSymbolAction(Analyzer.HandleFieldDeclaration, SymbolKind.Field);
54+
context.RegisterSymbolAction(FieldDeclarationAction, SymbolKind.Field);
5555
}
5656

5757
private static class Analyzer

StyleCop.Analyzers/StyleCop.Analyzers/ReadabilityRules/SA1130UseLambdaSyntax.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ internal class SA1130UseLambdaSyntax : DiagnosticAnalyzer
2727
private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(ReadabilityResources.SA1130MessageFormat), ReadabilityResources.ResourceManager, typeof(ReadabilityResources));
2828
private static readonly LocalizableString Description = new LocalizableResourceString(nameof(ReadabilityResources.SA1130Description), ReadabilityResources.ResourceManager, typeof(ReadabilityResources));
2929
private static readonly string HelpLink = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1130.md";
30-
private static readonly ParameterListSyntax EmptyParameterList = SyntaxFactory.ParameterList();
3130

3231
private static readonly DiagnosticDescriptor Descriptor =
3332
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.ReadabilityRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);

0 commit comments

Comments
 (0)