Skip to content

Fix S3963 FP: Static constructor with conditional and no static filed initialization#9512

Merged
sebastien-marichal merged 3 commits intomasterfrom
sma/s3963-fp
Jul 11, 2024
Merged

Fix S3963 FP: Static constructor with conditional and no static filed initialization#9512
sebastien-marichal merged 3 commits intomasterfrom
sma/s3963-fp

Conversation

@sebastien-marichal
Copy link
Contributor

Fixes #6343

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 - mino polishing - ignore if you wish as it does not worth blocking the whole PR for this.

.Count();
var hasIfOrSwitch = Array.Exists(bodyDescendantNodes, x => x.IsAnyKind(SyntaxKind.IfStatement, SyntaxKind.SwitchStatement));
if ((hasIfOrSwitch && assignedFieldCount <= 1)
if ((hasIfOrSwitch && assignedFieldCount == 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

one line :)

@sebastien-marichal sebastien-marichal enabled auto-merge (squash) July 11, 2024 11:53
@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

@sebastien-marichal sebastien-marichal merged commit bc2307e into master Jul 11, 2024
@sebastien-marichal sebastien-marichal deleted the sma/s3963-fp branch July 11, 2024 12:18
@sebastien-marichal
Copy link
Contributor Author

Peach validation:

  • 39 Lost issues => All TNs

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 S3963 FP: Static constructor with conditional and no static filed initialization

2 participants