There are a false positive issue reported for java rule squid:S4248 in case of used constant. See the example below.
-
text.split(" "); //nothing reported
-
text.split(CONSTANT); //issue reported
There are a false positive issue reported for java rule squid:S4248 in case of used constant. See the example below.
text.split(" "); //nothing reported
text.split(CONSTANT); //issue reported
hello @Tomas_Lestyan,
while I understand that this is FP strictly speaking, however wouldn’t you agree that it makes sense to create a static instance of java.util.regex.Pattern
and use Pattern.split
method instead?
Hi Tomáš,
I have created a ticket SONARJAVA-3276 to improve the rule S4248.
Thanks for the feedback!