-
Notifications
You must be signed in to change notification settings - Fork 80
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
Java - Rules "Avoid returning a JPA Entity in a RestController" #138
Conversation
|
||
methods.stream().filter(methodTree -> { | ||
var returnType = methods.get(0).returnType().symbolType(); | ||
var parametrizedTypes = returnType.typeArguments(); |
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.
typo: parameterized is missing an e
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.
thx fixed
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.
Also replaced the methods.get(0) by methodTree
This feature should not be merge before final rule ID is know and updated in code |
Kudos, SonarCloud Quality Gate passed! |
For now, can we just add a ruleID with a number not already used and add the rule un rules.md file ? |
This PR has been automatically marked as stale because it has no activity for 30 days. |
Hi @MP-Aubay @rducasse |
This PR has been automatically marked as stale because it has no activity for 30 days. |
to discuss in core-team :
for me, rule not acceptable like that. |
Hello, I agree that we don't have enough elements to validate and add this rule in the plugin. |
Hi @MP-Aubay, @natixis-caen, @SebastienSurier, @rducasse sorry but with implementation is that situation, we can't accept this implementation because :
We keep this proposition to measure it when we will have a tool to measure it. |
Team : 2 millions
Rule ID incoming (green-code-initiative/creedengo-challenge#58)
Rule description :
Using persistence Entity in the return of a Rest controler is not energy efficient.
This use induces a multiples unnecessary SQL calls, multiple unused fields serialization, and thus unnecessary calculations by the CPU, RAM usage and network usage.