Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/api v152 #264

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Feature/api v152 #264

wants to merge 7 commits into from

Conversation

stashjones
Copy link
Contributor

No description provided.

[Get("/organizations/{organizationId}/floorPlans/autoLocate/devices")]
Task<FloorPlansAutoLocateDevices> GetOrganizationFloorPlansAutoLocateDevicesAsync(
string organizationId,
CancellationToken cancellationToken = default);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codacy found a critical Error Prone issue: Use the overloading mechanism instead of the optional parameters.

The issue identified by the SonarC# linter is related to the use of optional parameters in the method signature. The linter suggests that instead of using optional parameters, which can lead to ambiguity and make the method less clear, it is better to use method overloading to provide different versions of the method for different parameter sets.

To resolve this issue, you can create an overloaded version of the GetOrganizationFloorPlansAutoLocateDevicesAsync method without the cancellationToken parameter. The original method can then call this overloaded version, providing a default value for the cancellationToken.

Here’s the suggested one-line change to implement the overload:

Suggested change
CancellationToken cancellationToken = default);
Task<FloorPlansAutoLocateDevices> GetOrganizationFloorPlansAutoLocateDevicesAsync(string organizationId);

This change would require you to implement the overload in the same class, ensuring that the original method still functions as intended.


This comment was generated by an experimental AI tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant