-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Description
Description of the new feature / enhancement
Following on from #35155 [Mouse Without Borders] - refactoring "Common" classes there's a fair number of legacy lint / quality issues in the Mouse Without Borders codebase that were pragmatically carried over like-for-like during the original port of Mouse Without Borders into PowerToys in order to avoid introducing new bugs.
There are currently about 500 warnings in the Mouse Without Borders projects. None of these are critical build-breaking problems, but they clutter the codebase and make it slightly harder to maintain. Addressing some of these issues will clean up the codebase, reduce the number of IDE warnings in the project and make it easier to maintain in future.
I have capacity to address some of these issues if there is appetite for the work...
Examples
Properties with explicit backing fields
A number of properties have explicit backing fields that could be converted to automatic properties:
private static string lastDragDropFile;
internal static string LastDragDropFile
{
get => Clipboard.lastDragDropFile;
set => Clipboard.lastDragDropFile = value;
}
->
internal static string LastDragDropFile
{
get;
set;
}
Exposed fields
Fields could be exposed as properties and the casing fixed to reduce warning pragmas.
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
internal static long clipboardCopiedTime;
#pragma warning restore SA1307
internal static long ClipboardCopiedTime
{
get;
set;
}
Unused code
There's a bunch of unused code that can be removed:
as well as other instances such as MyKnownBitmap that only has a single reference which is an explicit default constructor that itself has zero references.
Unnecessary using directives
Other
There's a bunch of other warnings IDE#### warnings and non-functional linting issues that can be addressed at the same time.
Scenario when this would be used?
These are non functional changes that will only really involve small localised areas of code.
The changes will reduce clutter in the codebase and reduce the number of IDE warnings.
Supporting information
No response