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

Add reproducers for S2583/S2589 issues #7793

Merged
merged 8 commits into from
Aug 15, 2023
Merged

Conversation

mary-georgiou-sonarsource
Copy link
Contributor

@mary-georgiou-sonarsource mary-georgiou-sonarsource commented Aug 15, 2023

Add repros for #5002, #5601, #739, #2411
Update UTs and UT annotations.

Copy link
Contributor

@Tim-Pohlmann Tim-Pohlmann left a comment

Choose a reason for hiding this comment

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

LGTM; Just nitpicks.

return false;
}

if (foundA) // Noncompliant FP, we run the loop only three times and SE never learns that foundA can be True.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (foundA) // Noncompliant FP, we run the loop only three times and SE never learns that foundA can be True.
if (foundA) // Noncompliant FP, we run the loop twice but the second branch never leaves the loop


if (foundA) // Noncompliant FP, we run the loop only three times and SE never learns that foundA can be True.
{
return true; // Secondary
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return true; // Secondary
return true; // Secondary FP

{
public void Method(Guid guid)
{
if (guid == null || guid == Guid.Empty) // Noncompliant S2589, no secondary issue is raised.
Copy link
Contributor

Choose a reason for hiding this comment

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

Validate the message to prove that the correct issue is being raised.

@sonarqubecloud
Copy link

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

@sonarqubecloud
Copy link

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

@mary-georgiou-sonarsource mary-georgiou-sonarsource merged commit d952b1a into master Aug 15, 2023
@mary-georgiou-sonarsource mary-georgiou-sonarsource deleted the mary/fix-uts branch August 15, 2023 15:43
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