Skip to content

Fix S1144 FN: Unused local functions#9071

Merged
cristian-ambrosini-sonarsource merged 4 commits intomasterfrom
cristian/S1144-local-functions
Apr 11, 2024
Merged

Fix S1144 FN: Unused local functions#9071
cristian-ambrosini-sonarsource merged 4 commits intomasterfrom
cristian/S1144-local-functions

Conversation

@cristian-ambrosini-sonarsource
Copy link
Contributor

Fixes #6699

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not strictly related to unused local functions, but requested in the same ticket.

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! Nitpicks only

Copy link
Contributor

Choose a reason for hiding this comment

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

This should follow the same pattern as the cases above using SyntaxKindEx.LocalFunctionStatement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot cast to LocalFunctionStatementSyntax because we don't have it, so it would be something like:
SyntaxKindEx.LocalFunctionStatement => ((LocalFunctionStatementSyntaxWrapper)methodDeclaration).Identifier,
I'm not a fan of it, I prefer using LocalFunctionStatementSyntaxWrapper.IsInstance to reduce the assumptions.

Copy link
Contributor

Choose a reason for hiding this comment

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

But it's the same assumption as in the three cases above.

@Tim-Pohlmann
Copy link
Contributor

Coverage seems low despite the gate being green. Please try to increase it before merging.

@sonarqubecloud
Copy link

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

@sonarqubecloud
Copy link

@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource deleted the cristian/S1144-local-functions branch April 11, 2024 16:09
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 S1144 FN: Unused local functions

3 participants

Comments