Skip to content

Fix S3963 FP: Static constructor with conditional and no static filed initialization #6343

@teo-tsirpanis

Description

@teo-tsirpanis

Description

I have a class with no static fields whose static constructor does some stuff, yet S3963 gets triggered.

Repro steps

https://github.com/TileDB-Inc/TileDB-CSharp/blob/b5a5966adbd551c161b1ed80fa8e07a7f7275111/tests/TileDB.CSharp.Test/TestUtil.cs#L8-L14

Expected behavior

No warnings.

Actual behavior

S3963 appears.

Known workarounds

Suppress it.

Related information

  • SonarAnalyzer.CSharp version: 8.48.0.56517
  • Visual Studio version: 17.4

Metadata

Metadata

Labels

False PositiveRule IS triggered when it shouldn't be.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions