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 S2930 FN: Track System.Threading.CancellationTokenSource #8302

Conversation

sagi1623
Copy link
Contributor

@sagi1623 sagi1623 commented Nov 2, 2023

Fixes #6050

@pavel-mikula-sonarsource
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource left a comment

Choose a reason for hiding this comment

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

Hi Čaba, Akka and Nancy needs to be convinced a little about the value of this change :)

@pavel-mikula-sonarsource
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

sonarcloud bot commented Nov 6, 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

Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-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
New FPs are existing structural limitation of the rule itself.

"id": "S2930",
"message": "Dispose 'engineDisposedCts' when it is no longer needed.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/NancyEngine.cs#L98",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a FP, as it is disposed in dispose method and we can't go cross-procedure

"id": "S2930",
"message": "Dispose 'engineDisposedCts' when it is no longer needed.",
"location": {
"uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/sources/Nancy/src/Nancy/NancyEngine.cs#L98",
Copy link
Contributor

Choose a reason for hiding this comment

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

Also FP, stored to a field, disposed in Dispose method

Copy link

sonarcloud bot commented Nov 6, 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

@pavel-mikula-sonarsource pavel-mikula-sonarsource merged commit 22c0988 into SonarSource:master Nov 6, 2023
26 checks passed
@sagi1623 sagi1623 deleted the AraGimLeg/S2930-CancellationTokenSource branch November 6, 2023 11:37
@antonioaversa antonioaversa modified the milestone: 9.14 Nov 23, 2023
vgmello pushed a commit to ellosoft/aws-cred-mgr that referenced this pull request Dec 4, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[SonarAnalyzer.CSharp](https://redirect.sonarsource.com/doc/sonar-visualstudio.html)
([source](https://togithub.com/SonarSource/sonar-dotnet)) |
`9.12.0.78982` -> `9.14.0.81108` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/SonarAnalyzer.CSharp/9.14.0.81108?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/SonarAnalyzer.CSharp/9.14.0.81108?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/SonarAnalyzer.CSharp/9.12.0.78982/9.14.0.81108?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/SonarAnalyzer.CSharp/9.12.0.78982/9.14.0.81108?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>SonarSource/sonar-dotnet (SonarAnalyzer.CSharp)</summary>

###
[`v9.14.0.81108`](https://togithub.com/SonarSource/sonar-dotnet/releases/tag/9.14.0.81108):
9.14

[Compare
Source](https://togithub.com/SonarSource/sonar-dotnet/compare/9.12.0.78982...9.14.0.81108)

Hello everyone!

We are happy to announce that we now have 5 dedicated Blazor rules 🚀 🥳

Special thanks to our contributor (and former colleague)
[@&#8203;sagi1623](https://togithub.com/sagi1623) for fixing
[SonarSource/sonar-dotnet#8302.

##### Improvements

- [8274](https://togithub.com/SonarSource/sonar-dotnet/issues/8274) -
\[C#] New rule S6797: Query parameter should be of supported type
- [8278](https://togithub.com/SonarSource/sonar-dotnet/issues/8278) -
\[C#] New rule S6798: \[JSInvokable] attribute should only be used on
public methods
- [8275](https://togithub.com/SonarSource/sonar-dotnet/issues/8275) -
\[C#] New rule S6800: Component parameter type should match the route
parameter type constraint
- [8277](https://togithub.com/SonarSource/sonar-dotnet/issues/8277) -
\[C#] New rule S6802: Using lambda expressions in loops should be
avoided in Blazor markup section
- [8338](https://togithub.com/SonarSource/sonar-dotnet/issues/8338) -
\[C#] New rule S6803: Parameters with SupplyParameterFromQuery attribute
should be used only in routable components
- [8228](https://togithub.com/SonarSource/sonar-dotnet/issues/8228) -
\[C#] Deprecate S4212
- [8346](https://togithub.com/SonarSource/sonar-dotnet/issues/8346) -
Create CFG from member node
- [8271](https://togithub.com/SonarSource/sonar-dotnet/pull/8271) -
Adding missing operation wrappers and syntax kinds to the shim layer
- [8230](https://togithub.com/SonarSource/sonar-dotnet/issues/8230) -
Update Signing Certificate
- [8290](https://togithub.com/SonarSource/sonar-dotnet/issues/8290) -
Update RSPEC before 9.14 release

##### Bug Fixes

- [8310](https://togithub.com/SonarSource/sonar-dotnet/issues/8310) -
\[C#, VB.NET] Fix S2068 AD0001: Overflow exception when a configuration
file value is a number greater than Int32.MaxValue

##### False Positive

- [8285](https://togithub.com/SonarSource/sonar-dotnet/issues/8285) -
\[C#, VB.NET] Fix S2583 FP: Number constraint from remainder calculation
is not correct.
- [8358](https://togithub.com/SonarSource/sonar-dotnet/issues/8358) -
\[C#] Fix S2743 FP: Arrow properties do not have static fields
- [7624](https://togithub.com/SonarSource/sonar-dotnet/issues/7624) -
\[C#] Fix S3604 FP: Primary constructors

##### False Negative

- [8335](https://togithub.com/SonarSource/sonar-dotnet/pull/8335) -
\[C#] Fix S2259 FN: FlowCaptures in Field/PropertyReference.Instance
- [6050](https://togithub.com/SonarSource/sonar-dotnet/issues/6050) -
\[C#] Fix S2930 FN: Track System.Threading.CancellationTokenSource

##### Performance

- [8181](https://togithub.com/SonarSource/sonar-dotnet/pull/8181) -
\[C#] Improve S5332 performance: Reuse compiled regex

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ellosoft/aws-cred-mgr).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuODEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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 S2930 FN: Track System.Threading.CancellationTokenSource
3 participants