False-negative Async suffix reported when the character 'a' or 'A' is in front of the 'Async' suffix

Please provide

  • Operating system: Windows 10.0.19045 Build 19045
  • Visual Studio version: Version 17.8.3
  • SonarLint plugin version: 7.5.0.82292
  • Programming language you’re coding in: C#
  • Is connected mode used: Yes
    • Connected to SonarCloud (and which version): Unsure how to check this version.

And a thorough description of the problem / question:
Sonar lint incorrectly flags async functions where the character ‘A’ or ‘a’ precedes the ‘Async’ suffix as not having the ‘Async’ suffix.

Minimum example with two async functions, both with the Async suffix, and both with either ‘a’ or ‘A’ as the last character before ‘Async’.

  private async Task TestLlamaAsync ()
  {
      await TestAAsync();
  }

  private async Task TestAAsync()
  {
      await TestLlamaAsync();
  }

This code results in the following incorrectly flagged Async suffix warning.
image

Hello @OddMathisenNOV,

I wasn’t able to reproduce the issue on our side. Did you use any special Unicode characters in your method name, like

You may use a tool like this (external tool)

to test the Unicode representation of your method’s name.

Best Martin

We did not use any unicode character intentionally. It should be normal ascii.
I ran the code through the tool, and none of the code points start with anything other than “U+00xx” at the very least.

U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0070 U+0072 U+0069 U+0076 U+0061 U+0074 U+0065 U+0020 U+0061 U+0073 U+0079 U+006E U+0063 U+0020 U+0054 U+0061 U+0073 U+006B U+0020 U+0054 U+0065 U+0073 U+0074 U+004C U+006C U+0061 U+006D U+0061 U+0041 U+0073 U+0079 U+006E U+0063 U+0028 U+0029 U+000A U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+007B U+000A U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0061 U+0077 U+0061 U+0069 U+0074 U+0020 U+0054 U+0065 U+0073 U+0074 U+0041 U+0041 U+0073 U+0079 U+006E U+0063 U+0028 U+0029 U+003B U+000A U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+007D U+000A U+000A U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0070 U+0072 U+0069 U+0076 U+0061 U+0074 U+0065 U+0020 U+0061 U+0073 U+0079 U+006E U+0063 U+0020 U+0054 U+0061 U+0073 U+006B U+0020 U+0054 U+0065 U+0073 U+0074 U+0041 U+0041 U+0073 U+0079 U+006E U+0063 U+0028 U+0029 U+000A U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+007B U+000A U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0061 U+0077 U+0061 U+0069 U+0074 U+0020 U+0054 U+0065 U+0073 U+0074 U+004C U+006C U+0061 U+006D U+0061 U+0041 U+0073 U+0079 U+006E U+0063 U+0028 U+0029 U+003B U+000A U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+0020 U+007D

This issue is still not reproducible for me. I created S4261: Simplify name comparrission by martin-strecker-sonarsource · Pull Request #8586 · SonarSource/sonar-dotnet · GitHub which improves the text comparison and may also fix the issue reported.

The PR with the change in the naming comparison was released in version 9.18 of our analyzer. This version will be included in the next upcoming releases of SonarLint and SonarQube. @OddMathisenNOV can you try the new version once the release of SonarLint/SonarQube is done?

1 Like

The exact same issue was reported before and we were not able to re-produce it on our side back in the day:

Will do.
Do note that my version of the SonarLint extension does not correspond to the 10.4 version of SonarQube (Currently at 7.5.0.83110). Is there any reference to which version of SonarQube corresponds to which version of the SonarLint 2022 extension in VisualStudio?
If not, will it just be the next minor update, so 7.6.x?

I don’t understand your version numbers:

  • In your first post, you mentioned that you are in connected mode to SonarCloud, but now you mention SonarQube
  • There is no SonarQube 10.4 release. The latest version is 10.3

Do you use SonarQube or SonarCloud? Depending on which, I can tell what version of the analyzer you are likely using. The fix will be part of the SonarQube 10.4 release, which is scheduled for the near future. SonarCloud uses version 9.19 of the analyzer as of now.

Please keep in mind that SonarLint comes with its own version of the analyzer, but when used in connected mode, it downloads the analyzer from the server (this is to make sure the same version is used in SonarLint and CI).

We are using SonarCloud. I do not understand how the different versions map up and was basing the 10.4 version on the 9.18 release notes, assuming this would somehow translate to SonarCloud and, in turn, the connected linter.

If SonarCloud is on v9.19 of the analyzers and our linter is in connected mode, we should not have this issue, correct?

I have a different issue where our SonarLint in connected mode does not sync with the configured Quality Profiles, Unable to sync SonarLint rules from SonarCloud, which might be why this is still an issue for us.