Skip to content

[Improvements] Multiple files — Magic numbers without named constants (batch) #522

@Christophe-Rogiers

Description

@Christophe-Rogiers

Severity: Info

Description:
Several magic numbers appear as bare literals without named constants, making their purpose opaque:

File Line Value Purpose
LogTailer.cs 105 500 Log batch flush threshold
ConsoleViewModel.cs 257 300 Keystroke debounce delay (ms)
ServiceManager.cs 600 500 SCM poll interval during uninstall (ms)
MainViewModel.cs 758 8 Max bulk-operation parallelism cap
ResourceHelper.cs 20 20 Resource staleness delta (minutes)
ServiceManager.cs 27–28 60/30 SCM stop/start poll timeouts (overlap with AppConfig defaults)

Suggested fix:
Extract each to a named constant (e.g., private const int LogBatchSize = 500;), either in the containing class or in AppConfig for cross-cutting values. Add brief comments explaining the rationale for each threshold.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions