Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vb2ae
Copy link
Member

@vb2ae vb2ae commented Dec 18, 2024

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:

Code maintainability improvements:

Miscellaneous:

closes #952 #954 #955 #956 #957

- 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.
@vb2ae vb2ae requested a review from Copilot December 18, 2024 22:47
@vb2ae vb2ae linked an issue Dec 18, 2024 that may be closed by this pull request
1 task
Copy link

@Copilot Copilot AI left a 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");

@vb2ae vb2ae requested a review from Copilot December 18, 2024 22:58

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.

@vb2ae vb2ae requested a review from KasperSK December 23, 2024 02:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
1 participant