SonarQube appears to be incorrectly detecting S3655

Screenshot added for context and because I can no longer see the original analysis to copy/paste from it (I didn’t find this forum until after screenshotting it and fixing the issue).

I suspect the analysis tool has no way of knowing that the method votMatchingResult.strongestRequestedMatch() always returns the same object.

I suspect that if you put that in a variable before the isEmpty check and use the same variable for the get() then sonarQube will stop complaining as it will be able to identify that the check has been done on the object.

Kind regards

2 Likes

Thanks, you are correct, adding in local variables has removed the warning :slight_smile: