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

Disjoint Sets primitives #9145

Merged
merged 9 commits into from Apr 24, 2024
Merged

Disjoint Sets primitives #9145

merged 9 commits into from Apr 24, 2024

Conversation

antonioaversa
Copy link
Contributor

Part of #9089

@antonioaversa
Copy link
Contributor Author

@mary-georgiou-sonarsource @gregory-paidis-sonarsource Regarding this issue on SonarCloud: the result of DisjointSets has to be predictable. Therefore, order is important, and that's why I used a List, for both inner and outer structures.

Wrapping the inner list into a non-generic structure to fix the issue, in my opinion, will make the code that manipulates the structure more complex and less clear. So I would declare the issue as Wont Fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice testcases!
Left a few comments, mostly optional and questions.

@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Apr 19, 2024
Copy link
Contributor

@mary-georgiou-sonarsource mary-georgiou-sonarsource left a comment

Choose a reason for hiding this comment

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

It's super clear what this code is doing and it's very elegant.
However, I feel like when I see it it's not part of this codebase somehow.

If I read it without any context, I would have a hard time getting a quick idea of where it can be used and what its purpose is in the context of sonar-dotnet.

Maybe it's better to create a base class analyzer called "FindClassCodepedencies" or something similar, and then we can extend this class for every rule that needs this functionality.

WDYT? this is a question also for @gregory-paidis-sonarsource

namespace SonarAnalyzer.Helpers;

public static class DisjointSetsPrimitives
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a comment here explaining a bit about the purpose of the class and these methods in the context of sonar-dotnet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Left only one comment, about how to utilize this class.

@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Apr 22, 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 In progress to Review approved in Best Kanban Apr 23, 2024
Copy link
Contributor

@mary-georgiou-sonarsource mary-georgiou-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

@github-actions github-actions bot moved this from Review approved to Review in progress in Best Kanban Apr 23, 2024
@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban Apr 23, 2024
Copy link

sonarcloud bot commented Apr 23, 2024

Quality Gate Passed Quality Gate passed

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 Apr 23, 2024

@antonioaversa antonioaversa enabled auto-merge (squash) April 23, 2024 15:37
@antonioaversa antonioaversa merged commit f47e64a into master Apr 24, 2024
25 checks passed
Best Kanban automation moved this from Review approved to Validate Peach Apr 24, 2024
@antonioaversa antonioaversa deleted the antonio/S6960-disjoint-sets branch April 24, 2024 15:23
@antonioaversa antonioaversa moved this from Validate Peach to Done 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
None yet
Projects
Best Kanban
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants