This change fixes "Multiple variables should not be declared on the same line" (id = java:S1659) identified by Sonar.
Details
This change splits variable assignments onto their own lines. Manysourcesbelieve it is easier to review code where the variables are separate statements on their own individual line.
Our changes look something like this:
- int i = 0, limit = 10;
+ int i = 0;
+ int limit = 10;
while (i < limit){
More reading
* [https://rules.sonarsource.com/java/RSPEC-1659/](https://rules.sonarsource.com/java/RSPEC-1659/)
* [https://wiki.sei.cmu.edu/confluence/display/java/DCL52-J.+Do+not+declare+more+than+one+variable+per+declaration](https://wiki.sei.cmu.edu/confluence/display/java/DCL52-J.+Do+not+declare+more+than+one+variable+per+declaration)
I have additional improvements ready for this repo! If you want to see them, leave the comment:
Remediation
This change fixes "Multiple variables should not be declared on the same line" (id = java:S1659) identified by Sonar.
Details
This change splits variable assignments onto their own lines. Many sources believe it is easier to review code where the variables are separate statements on their own individual line.
Our changes look something like this:
More reading
* [https://rules.sonarsource.com/java/RSPEC-1659/](https://rules.sonarsource.com/java/RSPEC-1659/) * [https://wiki.sei.cmu.edu/confluence/display/java/DCL52-J.+Do+not+declare+more+than+one+variable+per+declaration](https://wiki.sei.cmu.edu/confluence/display/java/DCL52-J.+Do+not+declare+more+than+one+variable+per+declaration)I have additional improvements ready for this repo! If you want to see them, leave the comment:
... and I will open a new PR right away!
š§š¤ Powered by Pixeebot
Feedback | Community | Docs | Codemod ID: sonar:java/declare-variable-on-separate-line-s1659