False negative: csharpsquid:S2325 - tiny exception

Good morning,

The interface IExternalCommand from RevitAPI does not accept static property without an instance.

Please consider adding it to the the Exception list.

Please provide feedback if reporting issues on niche API as RevitAPI is relevant for the product development. I want to support Sonar Community but do not wish to clutter the board.

Thanks, have an amazing day!

Hi,

Can you give your context for this? I.e. are you on SonarQube Cloud? SonarQube for IDE (flavor and version)? SonarQube self-managed (flavor and version)?

 
Thx,
Ann

Hi Ann,

I am using SonarQube Cloud. I think the issue is independent of the environement.
I just wanted to know if such feedback is relevant or is it too niche subject.

Thanks for the reply :slight_smile:

Hi,

Thanks for your context. I needed to make sure you were seeing this in a current version.

I’ve flagged this for the language experts.

 
Ann

1 Like

Thank you, I will be more careful in the future.

Hi @GregorRutaAIBob,

Thanks for the report — the feedback is absolutely relevant, even for niche APIs.

We investigated a potential root cause: the RevitAPI assembly is likely compiled without nullable reference types (#nullable disable), which could cause our analyzer to fail to recognize your method as an interface implementation. We added regression tests covering all combinations of nullable context between the assembly defining the interface and the assembly containing the implementation — all pass correctly with current versions of the analyzer.

We were unable to reproduce the false positive in our test environment. Could you share:

  • Which version of the RevitAPI NuGet package you are referencing (or the DLL version if referencing directly)
  • The verbose scanner logs. Add /d:"sonar.verbose=true" to the BEGIN step:
dotnet sonarscanner begin /k:"MyProject" /d:"sonar.verbose=true"

or for Azure Pipelines:

- task: SonarCloudPrepare@3
    inputs:
      extraProperties: |
        sonar.verbose=true

Note that most relevant logging happens during the END step (SonarCloudAnalyze / Run Code Analysis).

This will help us pinpoint the actual root cause.

1 Like

Thank you so much! I will reactivate the thread when I run into the issue again.
The PR has been merged nearly a month ago.