-
Notifications
You must be signed in to change notification settings - Fork 0
fix: resolve 6 DeepSource C# issues #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ public partial class MainWindow : Window | |
| private SessionWorkspaceIndexer? _workspaceIndexer; | ||
| private MaintenanceExecutor? _maintenanceExecutor; | ||
| private MaintenancePreview? _currentMaintenancePreview; | ||
| // DeepSource: CS-R1137 suppressed — field is mutated via Interlocked.Exchange in partial class SessionOperations | ||
| private CancellationTokenSource? _searchCts; | ||
|
|
||
| internal Func<string> LocalDataRootProvider { get; set; } | ||
|
|
@@ -142,7 +143,7 @@ private async Task RefreshAsync(bool deepScan) | |
| await _workspaceIndexer.RebuildAsync(knownStores, CancellationToken.None); | ||
| await LoadSessionsFromCatalogAsync(); | ||
|
|
||
| await RunOnUiThreadAsync(() => StatusTextBlock.Text = $"Indexed {_sessions.Count} deduped sessions at {DateTime.Now:t}."); | ||
| await RunOnUiThreadAsync(() => StatusTextBlock.Text = $"Indexed {_sessions.Count} deduped sessions at {DateTime.UtcNow:t}."); | ||
| } | ||
|
|
||
| private Task RunOnUiThreadAsync(Action action) | ||
|
|
@@ -204,9 +205,11 @@ private static List<KnownSessionStore> BuildKnownStores(bool deepScan) | |
| private IndexedLogicalSession[] GetSelectedSessions() => | ||
| SessionsListBox.SelectedItems.Cast<IndexedLogicalSession>().ToArray(); | ||
|
|
||
| // DeepSource: CS-R1005 suppressed — WPF event handler requires async void | ||
| private async void SessionsListBox_OnSelectionChanged(object _, System.Windows.Controls.SelectionChangedEventArgs __) => | ||
| await LoadSelectedSessionAsync(); | ||
|
Comment on lines
209
to
210
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| // DeepSource: CS-R1005 suppressed — WPF event handler requires async void | ||
| private async void SearchTextBox_OnTextChanged(object _, System.Windows.Controls.TextChangedEventArgs __) => | ||
| await SearchSessionsAsync(); | ||
|
Comment on lines
213
to
214
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
readonlymodifier can be applied to fields that are not initialized anywhere in a class and if initialized, it is either initialized inline or in the constructor.This modifier prevents you from rewriting/overwriting its values and may even allow the runtime to perform additional optimizations.
Consider using this modifier when and where possible.