Skip to main content

Split variable declarations into their own statements (Sonar)


ImportanceReview GuidanceRequires Scanning Tool
LOWMerge Without ReviewYes (Sonar)

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:

-   int i = 0, limit = 10;
+ int i = 0;
+ int limit = 10;

while (i < limit){


Why is this codemod marked as Merge Without Review?

There is no functional difference after the change, but the source code will be easier to understand.