-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: main
Are you sure you want to change the base?
Feature/api v152 #264
Conversation
[Get("/organizations/{organizationId}/floorPlans/autoLocate/devices")] | ||
Task<FloorPlansAutoLocateDevices> GetOrganizationFloorPlansAutoLocateDevicesAsync( | ||
string organizationId, | ||
CancellationToken cancellationToken = default); |
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.
❌ 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:
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.
No description provided.