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

New rule S6960 for C#: Controllers should not have too many responsibilities #9111

Merged

Conversation

antonioaversa
Copy link
Contributor

@antonioaversa antonioaversa commented Apr 17, 2024

Fixes #9089

@github-actions github-actions bot added this to In progress in Best Kanban Apr 17, 2024
@github-actions github-actions bot added the Sprint: ASP.NET Web API ASP.NET rules for Web API label Apr 17, 2024
@antonioaversa antonioaversa force-pushed the antonio/S6960-too-many-responsibilities branch 3 times, most recently from c109ac7 to eeb986b Compare April 18, 2024 15:57
@antonioaversa antonioaversa marked this pull request as ready for review April 18, 2024 16:04
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Apr 18, 2024
@antonioaversa antonioaversa marked this pull request as draft April 19, 2024 09:40
@antonioaversa
Copy link
Contributor Author

Moved back to draft as the Disjoint Sets primitives have been extracted into a dedicated class and a dedicated PR:
#9145

This PR now has #9145 as a dependency.

Copy link
Contributor

Choose a reason for hiding this comment

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

Amazing work, very clever and clean implementation 💘
Left some questions and some cleaning-up suggestions.
I did not go over the test cases again, I trust that you copied what was already reviewed on the RSPEC side.
If there are changes, please let me know with a comment where I should look.

@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Apr 19, 2024
@antonioaversa antonioaversa force-pushed the antonio/S6960-too-many-responsibilities branch 2 times, most recently from 15ce7c2 to c4ac7ce Compare April 19, 2024 15:18
@antonioaversa antonioaversa changed the base branch from master to antonio/S6960-disjoint-sets April 19, 2024 15:19
@antonioaversa antonioaversa marked this pull request as ready for review April 19, 2024 15:41
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Apr 19, 2024
@antonioaversa
Copy link
Contributor Author

@gregory-paidis-sonarsource I have undrafted the PR, after changing the base to the PR with the Disjoint Sets data structure.
You can now go for a second round of review.

@mary-georgiou-sonarsource
Copy link
Contributor

Looks good, left only two small suggestions.

I have a couple of questions, as I missed the previous meeting:

  1. How come we did not go with the attributes, and instead take into account all classes/interfaces by default?
  2. Do you plan to exclude abstract controllers before we merge, or will you do a small update PR just for that?
  1. We decided to not rush adding the attributes as they cannot be removed once added. It would be problematic for the users.
  2. I've added the abstract classes exception.

@mary-georgiou-sonarsource
Copy link
Contributor

@gregory-paidis-sonarsource BTW, I'd ignore the code smell as it won't fix for us.

Copy link

sonarcloud bot commented May 2, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 2, 2024

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban May 2, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource merged commit e0dce12 into master May 2, 2024
28 checks passed
Best Kanban automation moved this from Review approved to Validate Peach May 2, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource deleted the antonio/S6960-too-many-responsibilities branch May 2, 2024 15:36
@mary-georgiou-sonarsource mary-georgiou-sonarsource removed this from Validate Peach in Best Kanban May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sprint: ASP.NET Web API ASP.NET rules for Web API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New rule S6960 for C#: Controllers should not have too many responsibilities
4 participants