-
Notifications
You must be signed in to change notification settings - Fork 30
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
SONARJAVA-5288 Create rule S7186: Methods returning "Page" or "Slice" must take "Pageable" as an input parameter #4620
Conversation
rules/S7186/java/rule.adoc
Outdated
The conventional approach to paginating data in Spring is to use the `Pageable` interface to control pagination and to store the query results into a `Page` or `Slice`. | ||
If a query method in a `Repository` returns a `Page` or `Slice` without taking a `Pageable` as an input, it raises a runtime exception. | ||
|
||
This rule raises an issue on query methods that return a `Page` or `Slice` without taking a `Pageable` as an input. |
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.
By query methods you mean methods inside a class extending spring repository interfaces? Maybe we should be clearer on this
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.
👍
Quality Gate passed for 'rspec-tools'Issues Measures |
Quality Gate passed for 'rspec-frontend'Issues Measures |
You can preview this rule here (updated a few minutes after each push).
Review
A dedicated reviewer checked the rule description successfully for: