Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S1694 FP: Cconstructors and fields #9504

Merged

Conversation

zsolt-kolbay-sonarsource
Copy link
Contributor

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource commented Jul 4, 2024

Fixes #9494

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource force-pushed the Zsolt/Fix-S1694-FP-fields-and-methods branch 2 times, most recently from 130a17e to eb8ec58 Compare July 4, 2024 10:52
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource force-pushed the Zsolt/Fix-S1694-FP-fields-and-methods branch from eb8ec58 to 2ae8d67 Compare July 4, 2024 11:24
{
"Id": "S1694",
"Message": "Convert this \u0027abstract\u0027 class to an interface.",
"Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Dispatch/Mailbox.cs#L554",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FP: the class has fields, it cannot be converted to an interface.

{
"Id": "S1694",
"Message": "Convert this \u0027abstract\u0027 class to an interface.",
"Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka/Pattern/BackoffOptions.cs#L77",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FP: the class cannot be converted to an interface, because in .NET Standard 2.0 interfaces cannot have members with internal visibility.

{
"Id": "S1694",
"Message": "Convert this \u0027abstract\u0027 class to an interface.",
"Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/akka.net/src/core/Akka.Remote/FailureDetector.cs#L17",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FP: the class cannot be converted to an interface, because in .NET Standard 2.0 interfaces cannot have readonly static fields.

Copy link
Contributor

@Tim-Pohlmann Tim-Pohlmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with the expectation that the behavior related to #9421 will be reverted, as discussed directly.

Copy link

sonarqubecloud bot commented Jul 5, 2024

Copy link

sonarqubecloud bot commented Jul 5, 2024

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource changed the title Fix S1694 FP: Protected abstract methods, constructors and fields Fix S1694 FP: Cconstructors and fields Jul 5, 2024
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource merged commit 362c774 into master Jul 5, 2024
26 checks passed
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource deleted the Zsolt/Fix-S1694-FP-fields-and-methods branch July 5, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix S1694 FP: Abstract class with field or constructor
2 participants