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: Allow to have empty class with non-empty ctor for base class #6960

Merged

Conversation

Corniel
Copy link
Contributor

@Corniel Corniel commented Mar 20, 2023

Fixes #6953

Also fixes FN for empty record w/o brackets.

Copy link
Contributor

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource left a comment

Choose a reason for hiding this comment

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

Nicely done. Only some minor comments.

Copy link
Contributor

@zsolt-kolbay-sonarsource zsolt-kolbay-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
Kudos for reorganizing the test cases!
There are some merge conflicts that need to be resolved.

@Corniel
Copy link
Contributor Author

Corniel commented Apr 6, 2023

@zsolt-kolbay-sonarsource Rebase done.

@zsolt-kolbay-sonarsource
Copy link
Contributor

/azp run Sonar.Net

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

thanks @Corniel - I've left some last comments

@Corniel
Copy link
Contributor Author

Corniel commented Apr 6, 2023

@andrei-epure-sonarsource Did all of them.

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!

(note: I didn't check in detail each of the test cases that they got moved, I just sampled some)

@andrei-epure-sonarsource
Copy link
Contributor

/azp run Sonar.Net

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Corniel
Copy link
Contributor Author

Corniel commented Apr 11, 2023

@zsolt-kolbay-sonarsource while reviewing some code with a collegae, I spotted a false negative for this rule:

record EmptyChildWithoutBrackets : EmptyRecord; // Noncompliant

While at it, I extended the rule to also cover this.

@zsolt-kolbay-sonarsource
Copy link
Contributor

/azp run Sonar.Net

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@zsolt-kolbay-sonarsource
Copy link
Contributor

The fix for the FN requires an update of the ITs. Once you've done that I'll merge the PR.

@Corniel
Copy link
Contributor Author

Corniel commented Apr 19, 2023

@zsolt-kolbay-sonarsource Can you do that for me please?

@zsolt-kolbay-sonarsource
Copy link
Contributor

/azp run Sonar.Net

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sonarcloud
Copy link

sonarcloud bot commented Apr 19, 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 Apr 19, 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

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource merged commit 0d01a33 into SonarSource:master Apr 19, 2023
22 checks passed
@Corniel Corniel deleted the corniel/s2094-fp-records branch April 19, 2023 15:13
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 S2094 FP: Records which set the base record's properties in their initializer
3 participants