Skip to content

Commit c0ea350

Browse files
committed
chore: Upgrade SA
1 parent 3f1ca07 commit c0ea350

14 files changed

+22
-19
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<!-- Shared code analyzers used for all projects in the solution -->
77
<ItemGroup Condition="!$(MSBuildProjectName.EndsWith('samples'))">
88
<GlobalPackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" IncludeAssets="Runtime;Build;Native;contentFiles;Analyzers"/>
9-
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" PrivateAssets="All" IncludeAssets="Runtime;Build;Native;contentFiles;Analyzers"/>
9+
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.5.0.109200" PrivateAssets="All" IncludeAssets="Runtime;Build;Native;contentFiles;Analyzers"/>
1010
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
1111
<PackageVersion Include="Meziantou.Polyfill" Version="1.0.42" />
1212
</ItemGroup>
@@ -28,7 +28,7 @@
2828

2929
<ItemGroup Label="System.Text.Json Vulnerability">
3030
<!-- Due to a CVE in System.Text.Json we explicitly reference the latest version of System.Text.Json -->
31-
<PackageVersion Include="System.Text.Json" Version="9.0.0"/>
31+
<PackageVersion Include="System.Text.Json" Version="9.0.1"/>
3232
</ItemGroup>
3333

3434
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">

tests/bunit.testassets/BlazorE2E/AddRemoveChildComponents.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Child components follow.
1010

1111
@code {
1212
int numAdded = 0;
13-
List<string> currentChildrenMessages = new List<string>();
13+
private readonly List<string> currentChildrenMessages = new List<string>();
1414

1515
void AddChild()
1616
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="cool_beans" data-tab="@TabId">@TabId</div>
22

33
@code {
4-
string TabId = "17";
4+
private readonly string TabId = "17";
55
}

tests/bunit.testassets/BlazorE2E/DuplicateAttributesComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</div>
1414

1515
@functions {
16-
Dictionary<string, object> elementValues = new Dictionary<string, object>
16+
private readonly Dictionary<string, object> elementValues = new Dictionary<string, object>
1717
{
1818
{ "bool", true },
1919
{ "string", "middle-value" },

tests/bunit.testassets/BlazorE2E/KeyPressEventComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Type here: <input @onkeypress=OnKeyPressed />
99
</ul>
1010

1111
@code {
12-
List<string> keysPressed = new List<string>();
12+
private readonly List<string> keysPressed = new List<string>();
1313

1414
void OnKeyPressed(KeyboardEventArgs eventArgs)
1515
{

tests/bunit.testassets/BlazorE2E/MarkupBlockComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#nullable disable
2929
bool changeOutput;
3030

31-
string myMarkup = "<p class='markup-string-value'>This is a <em>markup string</em>.</p>";
31+
private readonly string myMarkup = "<p class='markup-string-value'>This is a <em>markup string</em>.</p>";
3232

3333
void EmitMarkupBlock(RenderTreeBuilder builder)
3434
{

tests/bunit.testassets/BlazorE2E/MovingCheckboxesComponent.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141

4242
@code {
4343
#nullable disable
44-
List<TodoItem> items = new List<TodoItem>
44+
private readonly List<TodoItem> items = new List<TodoItem>
4545
{
4646
new TodoItem { Text = "Alpha" },
4747
new TodoItem { Text = "Beta" },
4848
new TodoItem { Text = "Gamma", IsDone = true },
4949
new TodoItem { Text = "Delta", IsDone = true },
5050
};
5151

52-
class TodoItem
52+
private sealed class TodoItem
5353
{
5454
public bool IsDone { get; set; }
5555
public string Text { get; set; }

tests/bunit.testassets/BlazorE2E/OrderedList.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77
@foreach (var item in Items)
88
{
9-
@Template(new Context { Index = index++, Item = item, });
9+
@Template(new Context { Index = index++, Item = item, })
1010
}
1111
</ol>
1212

tests/bunit.testassets/SampleComponents/AsyncRenderChangesProperty.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<button id="tick" @onclick="Tick">Tick</button>
22
<button id="tock" @onclick="Tock">Tock</button>
33
@code {
4-
private TaskCompletionSource<object?> _tcs = new TaskCompletionSource<object?>();
4+
private readonly TaskCompletionSource<object?> _tcs = new TaskCompletionSource<object?>();
55
public int Counter;
66

77
private Task Tick()

tests/bunit.testassets/SampleComponents/InvokeAsyncInsideContinueWith.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
{
2323
registeredTask = task;
2424
delegatedTask = task == null ? null : DelegateTo(task);
25-
RenderWhenDone();
25+
_ = RenderWhenDone();
2626
}
2727

2828
base.OnParametersSet();
2929
}
3030

31-
private async void RenderWhenDone()
31+
private async Task RenderWhenDone()
3232
{
3333
var task = delegatedTask;
3434
if (task != null)
@@ -44,7 +44,7 @@
4444

4545
private static async Task<object?> DelegateTo(Task task)
4646
{
47-
await task;//.ConfigureAwait(false);
47+
await task;
4848
return null;
4949
}
5050
}

0 commit comments

Comments
 (0)