Severity: Warning
Files:
src/Servy.Manager/ViewModels/PerformanceViewModel.cs, lines 263–291
src/Servy.Manager/ViewModels/ConsoleViewModel.cs, lines 459–483
src/Servy.Manager/ViewModels/DependenciesViewModel.cs, lines 260–284
Description:
Identical pattern triplicated: Interlocked.CompareExchange guard, _timer?.Stop(), try/finally restart, InitTimer, StartMonitoring, StopMonitoring, and Cleanup. Changes to the tick lifecycle logic must be applied in three places.
Suggested fix:
Extract abstract MonitoringViewModelBase : ViewModelBase with the shared plumbing and an abstract OnTickAsync() method.
Severity: Warning
Files:
src/Servy.Manager/ViewModels/PerformanceViewModel.cs, lines 263–291src/Servy.Manager/ViewModels/ConsoleViewModel.cs, lines 459–483src/Servy.Manager/ViewModels/DependenciesViewModel.cs, lines 260–284Description:
Identical pattern triplicated:
Interlocked.CompareExchangeguard,_timer?.Stop(),try/finallyrestart,InitTimer,StartMonitoring,StopMonitoring, andCleanup. Changes to the tick lifecycle logic must be applied in three places.Suggested fix:
Extract
abstract MonitoringViewModelBase : ViewModelBasewith the shared plumbing and an abstractOnTickAsync()method.