FP: S2325 triggers for WPF events - Sonar IDE

I am encountering this false positive FP: S2325 triggers for WPF events on Sonar IDE for Rider in disconnected mode. It does not appear to be triggering on the server side analysis. Thanks.

Otherwise, please provide:

  • Operating system: Windows 11
  • IDE name and flavor/env: Rider

Hi,

Can you share what version of SonarQube for IDE you’re seeing this in?

 
Thx,
Ann

Version 11.4.0.82618

Some of these issues seem to have disappeared, I was seeing them when the precommit checks ran but when I checked again today most on my various UI components have disappeared. I am still seeing them on App.xaml Application level events such as Startup and Exit.

Thanks.

Hi,

Thanks for the version. Could you also share a verbose log from IDE startup to the error?

 
Thx,
Ann

See attached. Also this particular instance of the issue does seem to trigger on the server side analysis. Thanks.
sonar_fp_s2325_wpf.txt (25.9 KB)

Hey Greg, thanks for reporting this, we’re looking into it. Could you please provide a very basic reproducer? That would help us :folded_hands:

1 Like

See below. Thanks.

WpfAppS2325.zip (2.9 KB)

Thank you for the reproducer. We were able to reproduce the issue, and we are further investigating internally. We will come back to you as soon as we have more information. Thank you for your patience!

1 Like

Hi @groogiam ,
Thanks for the great reproducer!

I can confirm this is a FP in the dotnet analyzer.
The previous fix was targeted to only apply to types that derive from FrameworkElement.

I’ve added a ticket to fix this issue to our backlog and a repro to our codebase.

When I ran a scan of the reproducer project on my local, it correctly propagated to the server.

I would guess that this is probably due to running in disconnected mode and

  • configured exclusions
  • or the issue being marked as accepted on the server

Are you able to confirm either of these?
Thanks

@alexander.meseldzija

I double checked and it is showing on the server. I might have gotten confused because it did not show as a new issue. When I searched for S2325 these are on my server runs.

The do not appear in with the latest Sonar IDE in disconnected mode.