Severity: Info
File: src/Servy.Manager/Views/MainWindow.xaml.cs, lines 259 and 268
GetPerformanceVm() and GetConsoleVm() declare type pattern variables whose names match the type exactly (PerformanceView PerformanceView, ConsoleView ConsoleView). This is valid C# but hurts readability and shadows the type identifier within the expression:
private PerformanceViewModel? GetPerformanceVm()
=> PerformanceTab.Content is PerformanceView PerformanceView ? PerformanceView.DataContext as PerformanceViewModel : null;
private ConsoleViewModel? GetConsoleVm()
=> ConsoleTab.Content is ConsoleView ConsoleView ? ConsoleView.DataContext as ConsoleViewModel : null;
The sibling methods GetLogsVm (line 288) use a lowercase logsView which reads cleanly — these two are inconsistent with the rest of the file.
Suggested fix
Use a distinct lowercase name for the pattern variable:
private PerformanceViewModel? GetPerformanceVm()
=> PerformanceTab.Content is PerformanceView perfView ? perfView.DataContext as PerformanceViewModel : null;
private ConsoleViewModel? GetConsoleVm()
=> ConsoleTab.Content is ConsoleView consoleView ? consoleView.DataContext as ConsoleViewModel : null;
Severity: Info
File:
src/Servy.Manager/Views/MainWindow.xaml.cs, lines 259 and 268GetPerformanceVm()andGetConsoleVm()declare type pattern variables whose names match the type exactly (PerformanceView PerformanceView,ConsoleView ConsoleView). This is valid C# but hurts readability and shadows the type identifier within the expression:The sibling methods
GetLogsVm(line 288) use a lowercaselogsViewwhich reads cleanly — these two are inconsistent with the rest of the file.Suggested fix
Use a distinct lowercase name for the pattern variable: