Return more than just the [] for S1197

SQ 8.6.

Rule java:S1197 (and probably variants in other languages) says to attach brackets to the type rather than the identifier, e.g., use “Foo[] bar;” rather than “Foo bar[];

The textRange dict returned using the web_api (e.g., issues/search) gives the range of only the actual brackets (so textrange.endOffset == textrange.startOffset+1 ALWAYS, assuming no space between the brackets. So in the example above, startOffset is the index of the [ and endOffset is the index of the ]. It would be more useful, for scripting purposes, to have the entire string included, e.g., startOffset is the index of the F and endOffset is the index of the ].

Hi Mister Pi,

Thank you for your message.

I created a ticket to highlight the variable as well.

Regards,
Richard

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.