Skip to content

SONARPY-664 Rule S5781: Expressions creating sets should not have dup…#723

Merged
guillaume-dequenne merged 2 commits into
masterfrom
SONARPY-664
May 19, 2020
Merged

SONARPY-664 Rule S5781: Expressions creating sets should not have dup…#723
guillaume-dequenne merged 2 commits into
masterfrom
SONARPY-664

Conversation

@guillaume-dequenne

Copy link
Copy Markdown
Contributor

…licate values

@gyula-sallai-sonarsource gyula-sallai-sonarsource left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, added one minor suggestion.

context.registerSyntaxNodeConsumer(Tree.Kind.SET_LITERAL, ctx -> {
SetLiteral setLiteral = (SetLiteral) ctx.syntaxNode();
Set<Integer> issueIndexes = new HashSet<>();
if (setLiteral.elements().size() > 100) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minor I would add this as a constant with a name indicative of why it was introduced.

@sonarsource-next

Copy link
Copy Markdown

Kudos, SonarQube 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

@guillaume-dequenne guillaume-dequenne merged commit 9f928f8 into master May 19, 2020
@guillaume-dequenne guillaume-dequenne deleted the SONARPY-664 branch May 19, 2020 07:41
hashicorp-vault-sonar-prod Bot pushed a commit that referenced this pull request Dec 19, 2025
…items or keys expect wrongly a positional argument (#723)

GitOrigin-RevId: af439fbf65cb8a525ffb4bbc878d82cc0ea8ff7a
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.

2 participants