Thank you for reporting this. I couldn’t reproduce the issue with the latest version of our analyzer. Note that we made many changes to S2589 in the latest releases. Versions 9.8 and 9.9, from late August to early September, reworked the rule significantly. Therefore, it is essential to know which version of the analyzer was used during the analysis. Can you tell which version of the analyzer you are using?
I’m using the SonarLint plugin for Visual Studio. Version 7.3.0.77872. I’m not sure how to tell which version of the analyzer this plugin uses though. Thanks.
This version of SonarLint embeds version 9.8 of the scanner. The current version is 9.12. The rule was changed a couple of times during that period. I would propose to wait for the next release of the SonarLint plugin and see if the issues persist. If so, please ping me here.