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 S2094 FP: type specifications, attributes and conditional compilation #6784

Merged
merged 5 commits into from Feb 24, 2023

Conversation

zsolt-kolbay-sonarsource
Copy link
Contributor

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource commented Feb 23, 2023

Fixes #6704

Exceptions were added for the following test cases:

  • class has attributes
  • class is derived from a generic class/interface
  • class contains conditional compiler directive
  • class is derived from System.Attribute or implements the IActionResult interface in ASP.NET

The rule message was changed to be similar to Java and other languages covering S2094.

@andrei-epure-sonarsource
Copy link
Contributor

(.NET ITs failed due to a nuget failure, I retried to check if it's intermittent stuff)

Copy link
Contributor

@andrei-epure-sonarsource andrei-epure-sonarsource left a comment

Choose a reason for hiding this comment

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

(early feedback even if not yet in review)

Copy link
Contributor

@andrei-epure-sonarsource andrei-epure-sonarsource left a comment

Choose a reason for hiding this comment

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

Good stuff!

low ccov is fine for defensive coding

the rspec should be fixed first

@sonarcloud
Copy link

sonarcloud bot commented Feb 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarcloud
Copy link

sonarcloud bot commented Feb 24, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

89.7% 89.7% Coverage
0.0% 0.0% Duplication

@andrei-epure-sonarsource
Copy link
Contributor

andrei-epure-sonarsource commented Feb 24, 2023

The : code smell is too small to retrigger a full CI for a fix.

The S2743 code smell is difficult to overcome because of the facade. It could be fixed with a default interface implementation, but the target runtime doesn't support this feature.

Copy link
Contributor

@andrei-epure-sonarsource andrei-epure-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM

@andrei-epure-sonarsource andrei-epure-sonarsource merged commit a06e58f into master Feb 24, 2023
@andrei-epure-sonarsource andrei-epure-sonarsource deleted the Zsolt/S2094-add-new-exceptions branch February 24, 2023 11:11
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.

New Rule S2094: Classes should not be empty
2 participants