-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
952 fix code scanning alert useless assignment to local variable #953
base: master
Are you sure you want to change the base?
952 fix code scanning alert useless assignment to local variable #953
Conversation
- Remove extraneous character from copyright comment. - Improve null `visualElementNode` exception message. - Simplify hex color parsing logic: - Strip `#` earlier in the process. - Parse `a`, `r`, `g`, and `b` more concisely. - Remove redundant initialization of `a`, `r`, `g`, and `b`. - Simplify `startPosition` calculation with ternary operator. - Streamline parsing of `r`, `g`, and `b` values.
The variable `keys` was assigned the value of `this.Keys` but was not used anywhere in the code. This change removes the unnecessary line, simplifying the code without altering its functionality.
Refactored `BeginOnUIThread` in `MauiPlatformProvider.cs` to discard the result of `dispatcher.RunAsync` using the discard operator `_`. Reformatted `XamlPlatformProvider.cs` to place opening braces `{` on new lines for namespace, class, constructor, and several methods. Updated `BeginOnUIThread` to use the discard operator `_`. Improved indentation and formatting in various methods for better readability.
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/Caliburn.Micro.Platform/Platforms/uap/AppManifestHelper.cs:88
- [nitpick] The error message 'This does not appear to be a proper hex color number' could be more specific. Consider providing the invalid hex value in the message for better debugging.
throw new ArgumentException("This does not appear to be a proper hex color number");
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
This pull request includes several changes to improve code readability and maintainability across multiple files by reformatting code and removing unnecessary variables.
Code readability improvements:
src/Caliburn.Micro.Platform/XamlPlatformProvider.cs
: Reformatted the class to follow consistent brace placement and spacing conventions. This includes moving opening braces to a new line and ensuring proper spacing around operators and keywords. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Code maintainability improvements:
src/Caliburn.Micro.Platform/Platforms/Maui/Windows/MauiPlatformProvider.cs
: Removed the unused variabledummy
in theBeginOnUIThread
method and replaced it with a discard_
.src/Caliburn.Micro.Platform/Platforms/Xamarin.Forms/HttpUtility.cs
: Removed the redundant variablekeys
in theToString
method.src/Caliburn.Micro.Platform/Platforms/uap/AppManifestHelper.cs
: Simplified theToColor
method by removing redundant variable declarations and consolidating the logic for parsing hex color values.Miscellaneous:
src/Caliburn.Micro.Platform/Platforms/uap/AppManifestHelper.cs
: Fixed a minor formatting issue in the file header comment.closes #952 #954 #955 #956 #957